1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 #include "uiobject.hxx"
12 #include <vcl/xtextedt.hxx>
16 EditorWindowUIObject::EditorWindowUIObject(const VclPtr
<basctl::EditorWindow
>& xEditorWindow
)
17 : WindowUIObject(xEditorWindow
)
18 , mxEditorWindow(xEditorWindow
)
22 StringMap
EditorWindowUIObject::get_state()
24 StringMap aMap
= WindowUIObject::get_state();
26 ExtTextEngine
* pEditEngine
= mxEditorWindow
->GetEditEngine();
29 for (i
= 0, nParas
= pEditEngine
->GetParagraphCount(); i
< nParas
; ++i
)
31 aRes
.append(pEditEngine
->GetText(i
) + "\n");
34 aMap
["Text"] = aRes
.makeStringAndClear();
39 std::unique_ptr
<UIObject
> EditorWindowUIObject::create(vcl::Window
* pWindow
)
41 basctl::EditorWindow
* pEditorWindow
= dynamic_cast<basctl::EditorWindow
*>(pWindow
);
42 assert(pEditorWindow
);
43 return std::unique_ptr
<UIObject
>(new EditorWindowUIObject(pEditorWindow
));
46 OUString
EditorWindowUIObject::get_name() const { return "EditorWindowUIObject"; }
50 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */