Bump version to 24.04.3.4
[LibreOffice.git] / basctl / source / basicide / uiobject.cxx
blobb875b1eceda7150754a1e21c4be12d7d7badb555
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #include <memory>
11 #include "uiobject.hxx"
12 #include <vcl/xtextedt.hxx>
14 namespace basctl
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();
27 sal_Int32 i, nParas;
28 OUStringBuffer aRes;
29 for (i = 0, nParas = pEditEngine->GetParagraphCount(); i < nParas; ++i)
31 aRes.append(pEditEngine->GetText(i) + "\n");
34 aMap["Text"] = aRes.makeStringAndClear();
36 return aMap;
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"; }
48 } // namespace basctl
50 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */