diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-28 15:21:11 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-04-28 17:32:43 +0200 |
commit | 836c9bbb6486e9c0c81de9d7534b934699131d3d (patch) | |
tree | acf708b1da9dfb686781e5c624a08a246bd2c959 | |
parent | 9e6b275a19b3f11e9a5d87d1cbb9ad192705572f (diff) |
move builder attributes from OString to OUString
Change-Id: I235188c9a086337b104e600f31a1c81deeca6c17
Reviewed-on: https://gerrit.libreoffice.org/37076
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
40 files changed, 297 insertions, 285 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index 93d36283ed52..15778e549fac 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -657,7 +657,7 @@ VCL_BUILDER_DECL_FACTORY(SfxAccCfgTabListBox) { WinBits nWinBits = WB_TABSTOP; - OString sBorder = VclBuilder::extractCustomProperty(rMap); + OUString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index 548c3b0fc157..379067fda6f0 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -136,7 +136,7 @@ void SvxNoSpaceEdit::Modify() } } -bool SvxNoSpaceEdit::set_property(const OString &rKey, const OString &rValue) +bool SvxNoSpaceEdit::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "only-numeric") bOnlyNumeric = toBool(rValue); diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx index c56ae38198b0..634975e91f6b 100644 --- a/cui/source/options/optinet2.hxx +++ b/cui/source/options/optinet2.hxx @@ -49,7 +49,7 @@ public: {} virtual void KeyInput(const KeyEvent& rKEvent) override; virtual void Modify() override; - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; }; // class SvxProxyTabPage ------------------------------------------------- diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 858a340d7ee7..5cb57a8a3de8 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -2451,7 +2451,7 @@ VCL_BUILDER_DECL_FACTORY(AutoCompleteMultiListBox) { WinBits nWinBits = WB_TABSTOP; - OString sBorder = VclBuilder::extractCustomProperty(rMap); + OUString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx index bb3ff359b1f1..3bc9168cbc00 100644 --- a/include/svtools/treelistbox.hxx +++ b/include/svtools/treelistbox.hxx @@ -526,7 +526,7 @@ public: void set_min_width_in_chars(sal_Int32 nChars); - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; protected: using SvListView::SelectAll; diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index aaf42e73bf63..0695af5cd25a 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -48,19 +48,19 @@ namespace xmlreader { class XmlReader; } class VCL_DLLPUBLIC VclBuilder { public: - typedef std::map<OString, OString> stringmap; + typedef std::map<OString, OUString> stringmap; typedef std::map<OString, std::pair<OString, OString>> accelmap; /// These functions create a new widget with parent pParent and return it in rRet typedef void (*customMakeWidget)(VclPtr<vcl::Window> &rRet, VclPtr<vcl::Window> &pParent, stringmap &rVec); public: - VclBuilder( - vcl::Window *pParent, - const OUString& sUIRootDir, - const OUString& sUIFile, - const OString& sID = OString(), - const css::uno::Reference<css::frame::XFrame> &rFrame = css::uno::Reference<css::frame::XFrame>()); - ~VclBuilder(); + VclBuilder( + vcl::Window *pParent, + const OUString& sUIRootDir, + const OUString& sUIFile, + const OString& sID = OString(), + const css::uno::Reference<css::frame::XFrame> &rFrame = css::uno::Reference<css::frame::XFrame>()); + ~VclBuilder(); ///releases references and disposes all children. void disposeBuilder(); @@ -89,10 +89,10 @@ public: static void set_properties(vcl::Window *pWindow, const stringmap &rProps); //Convert _ gtk markup to ~ vcl markup - static OString convertMnemonicMarkup(const OString &rIn); + static OUString convertMnemonicMarkup(const OUString &rIn); - static OString extractCustomProperty(stringmap &rMap); - static FieldUnit detectUnit(OString const&); + static OUString extractCustomProperty(stringmap &rMap); + static FieldUnit detectUnit(OUString const&); static bool extractDropdown(stringmap &rMap); @@ -131,7 +131,7 @@ private: //has not been completed during the building, so properties for it //are collected here and need to be set afterwards, e.g. during //Show or Execute - stringmap m_aDeferredProperties; + stringmap m_aDeferredProperties; struct PackingData { @@ -180,14 +180,25 @@ private: } }; + struct UStringPair + { + OString m_sID; + OUString m_sValue; + UStringPair(const OString &rId, const OUString &rValue) + : m_sID(rId) + , m_sValue(rValue) + { + } + }; + typedef StringPair RadioButtonGroupMap; struct ButtonImageWidgetMap { OString m_sID; - OString m_sValue; + OUString m_sValue; bool m_bRadio; - ButtonImageWidgetMap(const OString &rId, const OString &rValue, bool bRadio) + ButtonImageWidgetMap(const OString &rId, const OUString &rValue, bool bRadio) : m_sID(rId) , m_sValue(rValue) , m_bRadio(bRadio) @@ -195,17 +206,17 @@ private: } }; - typedef StringPair TextBufferMap; - typedef StringPair WidgetAdjustmentMap; - typedef StringPair ButtonMenuMap; - typedef StringPair MnemonicWidgetMap; + typedef UStringPair TextBufferMap; + typedef UStringPair WidgetAdjustmentMap; + typedef UStringPair ButtonMenuMap; + typedef UStringPair MnemonicWidgetMap; struct ComboBoxModelMap { OString m_sID; - OString m_sValue; + OUString m_sValue; sal_Int32 m_nActiveId; - ComboBoxModelMap(const OString &rId, const OString &rValue, sal_Int32 nActiveId) + ComboBoxModelMap(const OString &rId, const OUString &rValue, sal_Int32 nActiveId) : m_sID(rId) , m_sValue(rValue) , m_nActiveId(nActiveId) @@ -215,7 +226,7 @@ private: struct ListStore { - typedef std::vector<OString> row; + typedef std::vector<OUString> row; std::vector<row> m_aEntries; }; @@ -223,8 +234,7 @@ private: static void mungeModel(ListBox &rTarget, const ListStore &rStore, sal_uInt16 nActiveId); typedef stringmap TextBuffer; - const TextBuffer* - get_buffer_by_name(const OString& sID) const; + const TextBuffer* get_buffer_by_name(const OString& sID) const; static void mungeTextBuffer(VclMultiLineEdit &rTarget, const TextBuffer &rTextBuffer); @@ -242,7 +252,7 @@ private: struct stockinfo { - OString m_sStock; + OUString m_sStock; int m_nSize; stockinfo() : m_nSize(4) {} }; @@ -256,7 +266,7 @@ private: SizeGroup() {} }; - typedef std::map< VclPtr<vcl::Window>, stringmap> AtkMap; + typedef std::map<VclPtr<vcl::Window>, stringmap> AtkMap; struct ParserState { @@ -283,7 +293,7 @@ private: Translations m_aTranslations; - std::map< VclPtr<vcl::Window>, VclPtr<vcl::Window> > m_aRedundantParentWidgets; + std::map<VclPtr<vcl::Window>, VclPtr<vcl::Window>> m_aRedundantParentWidgets; std::vector<SizeGroup> m_aSizeGroups; @@ -341,9 +351,9 @@ private: const OString &rClass, const OString &rID, stringmap &rVec); - void connectNumericFormatterAdjustment(const OString &id, const OString &rAdjustment); - void connectTimeFormatterAdjustment(const OString &id, const OString &rAdjustment); - void connectDateFormatterAdjustment(const OString &id, const OString &rAdjustment); + void connectNumericFormatterAdjustment(const OString &id, const OUString &rAdjustment); + void connectTimeFormatterAdjustment(const OString &id, const OUString &rAdjustment); + void connectDateFormatterAdjustment(const OString &id, const OUString &rAdjustment); bool extractGroup(const OString &id, stringmap &rVec); bool extractModel(const OString &id, stringmap &rVec); @@ -381,7 +391,7 @@ private: void handleRow(xmlreader::XmlReader &reader, const OString &rID, sal_Int32 nRowIndex); void handleTabChild(vcl::Window *pParent, xmlreader::XmlReader &reader); void handleMenu(xmlreader::XmlReader &reader, const OString &rID); - std::vector<OString> handleItems(xmlreader::XmlReader &reader, const OString &rID); + std::vector<OUString> handleItems(xmlreader::XmlReader &reader, const OString &rID); void handleSizeGroup(xmlreader::XmlReader &reader, const OString &rID); @@ -483,7 +493,7 @@ protected: /* * @return true if rValue is "True", "true", "1", etc. */ -bool VCL_DLLPUBLIC toBool(const OString &rValue); +bool VCL_DLLPUBLIC toBool(const OUString &rValue); #endif diff --git a/include/vcl/builderfactory.hxx b/include/vcl/builderfactory.hxx index 423152221d8e..fbb53cc5f89f 100644 --- a/include/vcl/builderfactory.hxx +++ b/include/vcl/builderfactory.hxx @@ -34,7 +34,7 @@ #define VCL_BUILDER_FACTORY_CONSTRUCTOR(typeName,arg2) \ VCL_BUILDER_DECL_FACTORY(typeName) \ { \ - OString sBorder = VclBuilder::extractCustomProperty(rMap); \ + OUString sBorder = VclBuilder::extractCustomProperty(rMap); \ WinBits wb = arg2; \ if (!sBorder.isEmpty()) \ wb |= WB_BORDER; \ diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx index 73b9a6d026fc..c1e433edae14 100644 --- a/include/vcl/button.hxx +++ b/include/vcl/button.hxx @@ -93,7 +93,7 @@ public: void SetFocusRect( const tools::Rectangle& rFocusRect ); bool IsSmallSymbol() const; void SetSmallSymbol(); - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; /// Sets the button state according to the FeatureStateEvent emitted by an Uno state change. virtual void statusChanged(const css::frame::FeatureStateEvent& rEvent); @@ -163,7 +163,7 @@ public: Size CalcMinimumSize() const; virtual Size GetOptimalSize() const override; - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; virtual void ShowFocus(const tools::Rectangle& rRect) override; protected: @@ -382,7 +382,7 @@ public: */ std::vector<VclPtr<RadioButton> > GetRadioButtonGroup(bool bIncludeThis = true) const; - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; /* * Group this RadioButton with another @@ -475,7 +475,7 @@ public: void SetToggleHdl( const Link<CheckBox&,void>& rLink ) { maToggleHdl = rLink; } void SetLegacyNoTextAlign( bool bVal ) { mbLegacyNoTextAlign = bVal; } - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; virtual void ShowFocus(const tools::Rectangle& rRect) override; virtual FactoryFunction GetUITestFactory() const override; diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx index 9377bd9f94c9..fd9306d2e8c4 100644 --- a/include/vcl/combobox.hxx +++ b/include/vcl/combobox.hxx @@ -172,7 +172,7 @@ public: void setMaxWidthChars(sal_Int32 nWidth); - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; virtual FactoryFunction GetUITestFactory() const override; }; diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx index 478215e8d299..8c63e57c7415 100644 --- a/include/vcl/dialog.hxx +++ b/include/vcl/dialog.hxx @@ -89,7 +89,7 @@ public: virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override; - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; VclButtonBox* get_action_area() { return mpActionArea; } VclBox* get_content_area() { return mpContentArea; } diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx index e588869ea429..fd84f1d3d7cd 100644 --- a/include/vcl/edit.hxx +++ b/include/vcl/edit.hxx @@ -258,7 +258,7 @@ public: virtual OUString GetSurroundingText() const override; virtual Selection GetSurroundingTextSelection() const override; - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; void SetTextFilter(TextFilter* pFilter) { mpFilterText = pFilter; } diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx index 149043562f80..763fe714d9f0 100644 --- a/include/vcl/field.hxx +++ b/include/vcl/field.hxx @@ -451,7 +451,7 @@ public: virtual void Down() override; virtual void First() override; virtual void Last() override; - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; virtual void dispose() override; }; @@ -514,7 +514,7 @@ public: MapUnit eInUnit, FieldUnit eOutUnit ) { return ConvertDoubleValue( static_cast<double>(nValue), nDecDigits, eInUnit, eOutUnit ); } - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; virtual void dispose() override; }; diff --git a/include/vcl/fixed.hxx b/include/vcl/fixed.hxx index d73c91e26789..df7deaf9408c 100644 --- a/include/vcl/fixed.hxx +++ b/include/vcl/fixed.hxx @@ -73,7 +73,7 @@ public: static Size getTextDimensions(Control const *pControl, const OUString &rTxt, long nMaxWidth); Size CalcMinimumSize(long nMaxWidth = 0x7fffffff) const; virtual Size GetOptimalSize() const override; - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; void set_mnemonic_widget(vcl::Window *pWindow); vcl::Window* get_mnemonic_widget() const { return m_pMnemonicWindow; } }; @@ -176,9 +176,9 @@ public: bool SetModeImage( const Image& rImage ); const Image& GetModeImage( ) const { return maImage;} - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; - static Image loadThemeImage(const OString &rFileName); + static Image loadThemeImage(const OUString &rFileName); }; #endif // INCLUDED_VCL_FIXED_HXX diff --git a/include/vcl/fixedhyper.hxx b/include/vcl/fixedhyper.hxx index 4a5dd3a69160..c0ecc88db1e4 100644 --- a/include/vcl/fixedhyper.hxx +++ b/include/vcl/fixedhyper.hxx @@ -86,7 +86,7 @@ class VCL_DLLPUBLIC FixedHyperlink : public FixedText */ virtual void KeyInput( const KeyEvent& rKEvt ) override; - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; /** sets m_aClickHdl with rLink. diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx index 28c6464c0257..753d86f8039d 100644 --- a/include/vcl/layout.hxx +++ b/include/vcl/layout.hxx @@ -87,7 +87,7 @@ public: { m_bHomogeneous = bHomogeneous; } - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; protected: virtual sal_uInt16 getDefaultAccessibleRole() const override; void accumulateMaxes(const Size &rChildSize, Size &rSize) const; @@ -202,7 +202,7 @@ public: , m_eLayoutStyle(VclButtonBoxStyle::Default) { } - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; void sort_native_button_order(); protected: virtual Size calculateRequisition() const override; @@ -350,7 +350,7 @@ public: { return m_nColumnSpacing; } - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; }; class VCL_DLLPUBLIC VclBin : public VclContainer @@ -426,7 +426,7 @@ public: , m_fYScale(1.0) { } - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; protected: virtual Size calculateRequisition() const override; virtual void setAllocation(const Size &rAllocation) override; @@ -456,7 +456,7 @@ public: virtual void dispose() override; virtual vcl::Window *get_child() override; virtual const vcl::Window *get_child() const override; - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; bool get_expanded() const { return m_pDisclosureButton->IsChecked(); @@ -489,7 +489,7 @@ public: virtual void dispose() override; virtual vcl::Window *get_child() override; virtual const vcl::Window *get_child() const override; - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; ScrollBar& getVertScrollBar() { return *m_pVScroll; } ScrollBar& getHorzScrollBar() { return *m_pHScroll; } Size getVisibleChildSize() const; @@ -615,7 +615,7 @@ public: { return m_eMode; } - bool set_property(const OString &rKey, const OString &rValue); + bool set_property(const OString &rKey, const OUString &rValue); }; enum class VclButtonsType @@ -665,7 +665,7 @@ public: VclMessageType eMessageType = VclMessageType::Error, VclButtonsType eButtonsType = VclButtonsType::Ok); MessageDialog(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription); - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; virtual short Execute() override; ///Emitted when an action widget is clicked virtual void response(short nResponseId); diff --git a/include/vcl/lstbox.hxx b/include/vcl/lstbox.hxx index 16d2f302c481..bfdb013038b1 100644 --- a/include/vcl/lstbox.hxx +++ b/include/vcl/lstbox.hxx @@ -262,7 +262,7 @@ public: void setMaxWidthChars(sal_Int32 nWidth); - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; void EnableQuickSelection( bool b ); diff --git a/include/vcl/vclmedit.hxx b/include/vcl/vclmedit.hxx index 3a8bc9ccd47f..f792a4681abc 100644 --- a/include/vcl/vclmedit.hxx +++ b/include/vcl/vclmedit.hxx @@ -132,7 +132,7 @@ public: void EnableCursor( bool bEnable ); - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; }; #endif // INCLUDED_VCL_VCLMEDIT_HXX diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 16c7abd21e7f..36370a7c8137 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1469,14 +1469,14 @@ public: * * @return false if property is unknown */ - virtual bool set_property(const OString &rKey, const OString &rValue); + virtual bool set_property(const OString &rKey, const OUString &rValue); /* * Sets a font attribute * * @return false if attribute is unknown */ - bool set_font_attribute(const OString &rKey, const OString &rValue); + bool set_font_attribute(const OString &rKey, const OUString &rValue); /* * Adds this widget to the xGroup VclSizeGroup diff --git a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx index a91b99b3ff6f..71e2896c9e0d 100644 --- a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx +++ b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx @@ -152,7 +152,7 @@ VCL_BUILDER_DECL_FACTORY(ScTabBgColorValueSet) { WinBits nWinBits = WB_TABSTOP; - OString sBorder = VclBuilder::extractCustomProperty(rMap); + OUString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 363efea0bc38..156a422f2c33 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -289,7 +289,7 @@ ContentListBox_Impl::ContentListBox_Impl(vcl::Window* pParent, WinBits nStyle) VCL_BUILDER_DECL_FACTORY(ContentListBox) { WinBits nWinStyle = WB_TABSTOP; - OString sBorder = VclBuilder::extractCustomProperty(rMap); + OUString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; rRet = VclPtr<ContentListBox_Impl>::Create(pParent, nWinStyle); @@ -476,7 +476,7 @@ IndexBox_Impl::IndexBox_Impl(vcl::Window* pParent, WinBits nStyle) VCL_BUILDER_DECL_FACTORY(IndexBox) { WinBits nWinBits = WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK; - OString sBorder = VclBuilder::extractCustomProperty(rMap); + OUString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; VclPtrInstance<IndexBox_Impl> pListBox(pParent, nWinBits); @@ -884,7 +884,7 @@ void SearchBox_Impl::Select() VCL_BUILDER_DECL_FACTORY(SearchResultsBox) { WinBits nWinBits = WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK; - OString sBorder = VclBuilder::extractCustomProperty(rMap); + OUString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; VclPtrInstance<SearchResultsBox_Impl> pListBox(pParent, nWinBits); @@ -1145,7 +1145,7 @@ BookmarksBox_Impl::BookmarksBox_Impl(vcl::Window* pParent, WinBits nStyle) VCL_BUILDER_DECL_FACTORY(BookmarksBox) { WinBits nWinBits = WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE; - OString sBorder = VclBuilder::extractCustomProperty(rMap); + OUString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; VclPtrInstance<BookmarksBox_Impl> pListBox(pParent, nWinBits); diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 12de87dbd8fb..cfe4dc630c9b 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -3739,7 +3739,7 @@ void SvTreeListBox::set_min_width_in_chars(sal_Int32 nChars) queue_resize(); } -bool SvTreeListBox::set_property(const OString &rKey, const OString &rValue) +bool SvTreeListBox::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "min-width-chars") { diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index 760261e00a48..def4825ac14d 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1035,7 +1035,7 @@ HatchingLB::HatchingLB( vcl::Window* pParent, WinBits nWinStyle) VCL_BUILDER_DECL_FACTORY(HatchingLB) { WinBits nWinStyle = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE; - OString sBorder = VclBuilder::extractCustomProperty(rMap); + OUString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; VclPtrInstance<HatchingLB> pListBox(pParent, nWinStyle); @@ -1075,7 +1075,7 @@ GradientLB::GradientLB( vcl::Window* pParent, WinBits aWB) VCL_BUILDER_DECL_FACTORY(GradientLB) { WinBits nWinStyle = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE; - OString sBorder = VclBuilder::extractCustomProperty(rMap); + OUString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; VclPtrInstance<GradientLB> pListBox(pParent, nWinStyle); @@ -1115,7 +1115,7 @@ BitmapLB::BitmapLB( vcl::Window* pParent, WinBits aWB) VCL_BUILDER_DECL_FACTORY(BitmapLB) { WinBits nWinStyle = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE; - OString sBorder = VclBuilder::extractCustomProperty(rMap); + OUString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; VclPtrInstance<BitmapLB> pListBox(pParent, nWinStyle); @@ -1252,7 +1252,7 @@ VCL_BUILDER_DECL_FACTORY(LineLB) WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE|WB_TABSTOP; if (bDropdown) nWinBits |= WB_DROPDOWN; - OString sBorder = VclBuilder::extractCustomProperty(rMap); + OUString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; VclPtrInstance<LineLB> pListBox(pParent, nWinBits); @@ -1350,7 +1350,7 @@ VCL_BUILDER_DECL_FACTORY(LineEndLB) WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE|WB_TABSTOP; if (bDropdown) nWinBits |= WB_DROPDOWN; - OString sBorder = VclBuilder::extractCustomProperty(rMap); + OUString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; VclPtrInstance<LineEndLB> pListBox(pParent, nWinBits); diff --git a/svx/source/dialog/relfld.cxx b/svx/source/dialog/relfld.cxx index 452a15f253c6..84c564f5864e 100644 --- a/svx/source/dialog/relfld.cxx +++ b/svx/source/dialog/relfld.cxx @@ -39,7 +39,7 @@ SvxRelativeField::SvxRelativeField( VCL_BUILDER_DECL_FACTORY(SvxRelativeField) { - OString const custom(VclBuilder::extractCustomProperty(rMap)); + OUString const custom(VclBuilder::extractCustomProperty(rMap)); FieldUnit const eUnit(VclBuilder::detectUnit(custom)); rRet = VclPtr<SvxRelativeField>::Create(pParent, WB_BORDER | WB_SPIN | WB_REPEAT | diff --git a/svx/source/dialog/txencbox.cxx b/svx/source/dialog/txencbox.cxx index 4836db8009a6..72250ca8eb8a 100644 --- a/svx/source/dialog/txencbox.cxx +++ b/svx/source/dialog/txencbox.cxx @@ -45,7 +45,7 @@ VCL_BUILDER_DECL_FACTORY(SvxTextEncodingBox) bool bDropdown = VclBuilder::extractDropdown(rMap); if (bDropdown) nWinBits |= WB_DROPDOWN; - OString sBorder = VclBuilder::extractCustomProperty(rMap); + OUString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; VclPtrInstance<SvxTextEncodingBox> pListBox(pParent, nWinBits); diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index ada5795548c3..4929214a84d9 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -1265,7 +1265,7 @@ VCL_BUILDER_DECL_FACTORY(SelectionListBox) if (bDropdown) nBits |= WB_DROPDOWN; - OString sBorder = VclBuilder::extractCustomProperty(rMap); + OUString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nBits |= WB_BORDER; diff --git a/sw/source/uibase/inc/numberingtypelistbox.hxx b/sw/source/uibase/inc/numberingtypelistbox.hxx index 784817410e86..bcd9d47e185e 100644 --- a/sw/source/uibase/inc/numberingtypelistbox.hxx +++ b/sw/source/uibase/inc/numberingtypelistbox.hxx @@ -49,7 +49,7 @@ public: virtual ~SwNumberingTypeListBox() override; virtual void dispose() override; - virtual bool set_property(const OString &rKey, const OString &rValue) override; + virtual bool set_property(const OString &rKey, const OUString &rValue) override; void Reload(SwInsertNumTypes nTypeFlags); diff --git a/sw/source/uibase/misc/numberingtypelistbox.cxx b/sw/source/uibase/misc/numberingtypelistbox.cxx index d66ac3e1963f..bfd69cd51aa9 100644 --- a/sw/source/uibase/misc/numberingtypelistbox.cxx +++ b/sw/source/uibase/misc/numberingtypelistbox.cxx @@ -49,7 +49,7 @@ SwNumberingTypeListBox::SwNumberingTypeListBox( vcl::Window* pWin, WinBits nStyl pImpl->xInfo.set(xDefNum, uno::UNO_QUERY); } -bool SwNumberingTypeListBox::set_property(const OString &rKey, const OString &rValue) +bool SwNumberingTypeListBox::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "type") Reload(static_cast<SwInsertNumTypes>(rValue.toInt32())); diff --git a/vcl/inc/scrwnd.hxx b/vcl/inc/scrwnd.hxx index db002d2290e6..de6e1320b1e5 100644 --- a/vcl/inc/scrwnd.hxx +++ b/vcl/inc/scrwnd.hxx @@ -54,9 +54,8 @@ private: sal_uLong mnActDist; long mnActDeltaX; long mnActDeltaY; - void ImplCreateImageList(); - void ImplSetRegion( const Bitmap& rRegionBmp ); + void ImplSetRegion(const Bitmap& rRegionBmp); using Window::ImplGetMousePointer; PointerStyle ImplGetMousePointer( long nDistX, long nDistY ); void ImplDrawWheel(vcl::RenderContext& rRenderContext); diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index ec1d80ca63e7..b2fe0fea93bd 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -593,7 +593,7 @@ bool Button::IsSmallSymbol () const return mpButtonData->mbSmallSymbol; } -bool Button::set_property(const OString &rKey, const OString &rValue) +bool Button::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "image-position") { @@ -1668,7 +1668,7 @@ Size PushButton::GetOptimalSize() const return CalcMinimumSize(); } -bool PushButton::set_property(const OString &rKey, const OString &rValue) +bool PushButton::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "has-default") { @@ -2644,7 +2644,7 @@ void RadioButton::SetState( bool bCheck ) } } -bool RadioButton::set_property(const OString &rKey, const OString &rValue) +bool RadioButton::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "active") SetState(toBool(rValue)); @@ -3558,7 +3558,7 @@ void CheckBox::SetState( TriState eState ) } } -bool CheckBox::set_property(const OString &rKey, const OString &rValue) +bool CheckBox::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "active") SetState(toBool(rValue) ? TRISTATE_TRUE : TRISTATE_FALSE); diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index a0218d8ada95..cc8959373cfb 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -1494,7 +1494,7 @@ void ComboBox::setMaxWidthChars(sal_Int32 nWidth) } } -bool ComboBox::set_property(const OString &rKey, const OString &rValue) +bool ComboBox::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "max-width-chars") setMaxWidthChars(rValue.toInt32()); diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 70cebbbc77f3..0a778b86148f 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -179,7 +179,7 @@ void Edit::setMaxWidthChars(sal_Int32 nWidth) } } -bool Edit::set_property(const OString &rKey, const OString &rValue) +bool Edit::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "width-chars") SetWidthInChars(rValue.toInt32()); @@ -212,7 +212,7 @@ bool Edit::set_property(const OString &rKey, const OString &rValue) SetStyle(nBits); } else if (rKey == "placeholder-text") - SetPlaceholderText(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); + SetPlaceholderText(rValue); else return Control::set_property(rKey, rValue); return true; diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 4b1a66a5cf3b..b6d3b082cbda 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -748,7 +748,7 @@ void NumericField::dispose() SpinField::dispose(); } -bool NumericField::set_property(const OString &rKey, const OString &rValue) +bool NumericField::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "digits") SetDecimalDigits(rValue.toInt32()); @@ -1524,7 +1524,7 @@ Size MetricField::CalcMinimumSize() const return calcMinimumSize(*this, *this); } -bool MetricField::set_property(const OString &rKey, const OString &rValue) +bool MetricField::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "digits") SetDecimalDigits(rValue.toInt32()); diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx index 6722fd345de6..96da4001428a 100644 --- a/vcl/source/control/fixed.cxx +++ b/vcl/source/control/fixed.cxx @@ -391,7 +391,7 @@ void FixedText::setMinWidthChars(sal_Int32 nWidth) } } -bool FixedText::set_property(const OString &rKey, const OString &rValue) +bool FixedText::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "max-width-chars") setMaxWidthChars(rValue.toInt32()); @@ -968,14 +968,13 @@ bool FixedImage::SetModeImage( const Image& rImage ) return true; } - -Image FixedImage::loadThemeImage(const OString &rFileName) +Image FixedImage::loadThemeImage(const OUString &rFileName) { - BitmapEx aBitmap(OStringToOUString(rFileName, RTL_TEXTENCODING_UTF8)); + BitmapEx aBitmap(rFileName); return Image(aBitmap); } -bool FixedImage::set_property(const OString &rKey, const OString &rValue) +bool FixedImage::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "pixbuf") { diff --git a/vcl/source/control/fixedhyper.cxx b/vcl/source/control/fixedhyper.cxx index 052973d92ef4..4d0631b85867 100644 --- a/vcl/source/control/fixedhyper.cxx +++ b/vcl/source/control/fixedhyper.cxx @@ -140,10 +140,10 @@ void FixedHyperlink::SetText(const OUString& rNewDescription) m_nTextLen = GetCtrlTextWidth(GetText()); } -bool FixedHyperlink::set_property(const OString &rKey, const OString &rValue) +bool FixedHyperlink::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "uri") - SetURL(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); + SetURL(rValue); else return FixedText::set_property(rKey, rValue); return true; diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx index 2e3334efea81..fe07dc901c06 100644 --- a/vcl/source/control/listbox.cxx +++ b/vcl/source/control/listbox.cxx @@ -1408,7 +1408,7 @@ void ListBox::setMaxWidthChars(sal_Int32 nWidth) } } -bool ListBox::set_property(const OString &rKey, const OString &rValue) +bool ListBox::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "active") SelectEntryPos(rValue.toInt32()); diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx index a62146d1dec5..c48808c2a942 100644 --- a/vcl/source/edit/vclmedit.cxx +++ b/vcl/source/edit/vclmedit.cxx @@ -1590,7 +1590,7 @@ void VclMultiLineEdit::EnableCursor( bool bEnable ) GetTextView()->EnableCursor( bEnable ); } -bool VclMultiLineEdit::set_property(const OString &rKey, const OString &rValue) +bool VclMultiLineEdit::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "cursor-visible") EnableCursor(toBool(rValue)); diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index d01f87e4a75e..a65919836d21 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -47,9 +47,14 @@ #include <dlfcn.h> #endif +bool toBool(const OString &rValue) +{ + return (!rValue.isEmpty() && (rValue[0] == 't' || rValue[0] == 'T' || rValue[0] == '1')); +} + namespace { - OUString mapStockToImageResource(const OString& sType) + OUString mapStockToImageResource(const OUString& sType) { if (sType == "gtk-index") return OUString(SV_RESID_BITMAP_INDEX); @@ -58,7 +63,7 @@ namespace return OUString(); } - SymbolType mapStockToSymbol(const OString& sType) + SymbolType mapStockToSymbol(const OUString& sType) { SymbolType eRet = SymbolType::DONTKNOW; if (sType == "gtk-media-next") @@ -217,7 +222,7 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr aEnd = m_pParserState->m_aMnemonicWidgetMaps.end(); aI != aEnd; ++aI) { FixedText *pOne = get<FixedText>(aI->m_sID); - vcl::Window *pOther = get<vcl::Window>(aI->m_sValue); + vcl::Window *pOther = get<vcl::Window>(aI->m_sValue.toUtf8()); SAL_WARN_IF(!pOne || !pOther, "vcl", "missing either source " << aI->m_sID << " or target " << aI->m_sValue << " member of Mnemonic Widget Mapping"); if (pOne && pOther) pOne->set_mnemonic_widget(pOther); @@ -233,8 +238,8 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr for (stringmap::const_iterator aP = rMap.begin(), aEndP = rMap.end(); aP != aEndP; ++aP) { - const OString &rTarget = aP->second; - vcl::Window *pTarget = get<vcl::Window>(rTarget); + const OUString &rTarget = aP->second; + vcl::Window *pTarget = get<vcl::Window>(rTarget.toUtf8()); SAL_WARN_IF(!pTarget, "vcl", "missing member of a11y relation: " << rTarget.getStr()); if (!pTarget) @@ -270,7 +275,7 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr { ListBox *pTarget = get<ListBox>(aI->m_sID); // pStore may be empty - const ListStore *pStore = get_model_by_name(aI->m_sValue); + const ListStore *pStore = get_model_by_name(aI->m_sValue.toUtf8()); SAL_WARN_IF(!pTarget, "vcl", "missing elements of combobox"); if (pTarget && pStore) mungeModel(*pTarget, *pStore, aI->m_nActiveId); @@ -281,7 +286,7 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr aEnd = m_pParserState->m_aTextBufferMaps.end(); aI != aEnd; ++aI) { VclMultiLineEdit *pTarget = get<VclMultiLineEdit>(aI->m_sID); - const TextBuffer *pBuffer = get_buffer_by_name(aI->m_sValue); + const TextBuffer *pBuffer = get_buffer_by_name(aI->m_sValue.toUtf8()); SAL_WARN_IF(!pTarget || !pBuffer, "vcl", "missing elements of textview/textbuffer"); if (pTarget && pBuffer) mungeTextBuffer(*pTarget, *pBuffer); @@ -292,7 +297,7 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr aEnd = m_pParserState->m_aNumericFormatterAdjustmentMaps.end(); aI != aEnd; ++aI) { NumericFormatter *pTarget = dynamic_cast<NumericFormatter*>(get<vcl::Window>(aI->m_sID)); - const Adjustment *pAdjustment = get_adjustment_by_name(aI->m_sValue); + const Adjustment *pAdjustment = get_adjustment_by_name(aI->m_sValue.toUtf8()); SAL_WARN_IF(!pTarget, "vcl", "missing NumericFormatter element of spinbutton/adjustment"); SAL_WARN_IF(!pAdjustment, "vcl", "missing Adjustment element of spinbutton/adjustment"); if (pTarget && pAdjustment) @@ -303,7 +308,7 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr aEnd = m_pParserState->m_aTimeFormatterAdjustmentMaps.end(); aI != aEnd; ++aI) { TimeField *pTarget = dynamic_cast<TimeField*>(get<vcl::Window>(aI->m_sID)); - const Adjustment *pAdjustment = get_adjustment_by_name(aI->m_sValue); + const Adjustment *pAdjustment = get_adjustment_by_name(aI->m_sValue.toUtf8()); SAL_WARN_IF(!pTarget || !pAdjustment, "vcl", "missing elements of spinbutton/adjustment"); if (pTarget && pAdjustment) mungeAdjustment(*pTarget, *pAdjustment); @@ -313,7 +318,7 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr aEnd = m_pParserState->m_aDateFormatterAdjustmentMaps.end(); aI != aEnd; ++aI) { DateField *pTarget = dynamic_cast<DateField*>(get<vcl::Window>(aI->m_sID)); - const Adjustment *pAdjustment = get_adjustment_by_name(aI->m_sValue); + const Adjustment *pAdjustment = get_adjustment_by_name(aI->m_sValue.toUtf8()); SAL_WARN_IF(!pTarget || !pAdjustment, "vcl", "missing elements of spinbutton/adjustment"); if (pTarget && pAdjustment) mungeAdjustment(*pTarget, *pAdjustment); @@ -324,7 +329,7 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr aEnd = m_pParserState->m_aScrollAdjustmentMaps.end(); aI != aEnd; ++aI) { ScrollBar *pTarget = get<ScrollBar>(aI->m_sID); - const Adjustment *pAdjustment = get_adjustment_by_name(aI->m_sValue); + const Adjustment *pAdjustment = get_adjustment_by_name(aI->m_sValue.toUtf8()); SAL_WARN_IF(!pTarget || !pAdjustment, "vcl", "missing elements of scrollbar/adjustment"); if (pTarget && pAdjustment) mungeAdjustment(*pTarget, *pAdjustment); @@ -336,7 +341,7 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr aIterator != m_pParserState->m_aSliderAdjustmentMaps.end(); ++aIterator) { Slider* pTarget = dynamic_cast<Slider*>(get<vcl::Window>(aIterator->m_sID)); - const Adjustment* pAdjustment = get_adjustment_by_name(aIterator->m_sValue); + const Adjustment* pAdjustment = get_adjustment_by_name(aIterator->m_sValue.toUtf8()); SAL_WARN_IF(!pTarget || !pAdjustment, "vcl", "missing elements of scale(slider)/adjustment"); if (pTarget && pAdjustment) { @@ -354,7 +359,7 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr aEndP = aI->m_aProperties.end(); aP != aEndP; ++aP) { const OString &rKey = aP->first; - const OString &rValue = aP->second; + const OUString &rValue = aP->second; xGroup->set_property(rKey, rValue); } @@ -367,7 +372,7 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr } //Set button images when everything has been imported - std::set<OString> aImagesToBeRemoved; + std::set<OUString> aImagesToBeRemoved; for (std::vector<ButtonImageWidgetMap>::iterator aI = m_pParserState->m_aButtonImageWidgetMaps.begin(), aEnd = m_pParserState->m_aButtonImageWidgetMaps.end(); aI != aEnd; ++aI) { @@ -386,14 +391,14 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr pTarget = pTargetRadio; } - FixedImage *pImage = get<FixedImage>(aI->m_sValue); + FixedImage *pImage = get<FixedImage>(aI->m_sValue.toUtf8()); SAL_WARN_IF(!pTarget || !pImage, "vcl", "missing elements of button/image/stock"); if (!pTarget || !pImage) continue; aImagesToBeRemoved.insert(aI->m_sValue); - VclBuilder::StockMap::iterator aFind = m_pParserState->m_aStockMap.find(aI->m_sValue); + VclBuilder::StockMap::iterator aFind = m_pParserState->m_aStockMap.find(aI->m_sValue.toUtf8()); if (aFind == m_pParserState->m_aStockMap.end()) { if (!aI->m_bRadio) @@ -445,10 +450,10 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr //There may be duplicate use of an Image, so we used a set to collect and //now we can remove them from the tree after their final munge - for (std::set<OString>::iterator aI = aImagesToBeRemoved.begin(), + for (std::set<OUString>::iterator aI = aImagesToBeRemoved.begin(), aEnd = aImagesToBeRemoved.end(); aI != aEnd; ++aI) { - delete_by_name(*aI); + delete_by_name(aI->toUtf8()); } //Set button menus when everything has been imported @@ -456,7 +461,7 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr aEnd = m_pParserState->m_aButtonMenuMaps.end(); aI != aEnd; ++aI) { MenuButton *pTarget = get<MenuButton>(aI->m_sID); - PopupMenu *pMenu = get_menu(aI->m_sValue); + PopupMenu *pMenu = get_menu(aI->m_sValue.toUtf8()); SAL_WARN_IF(!pTarget || !pMenu, "vcl", "missing elements of button/menu"); if (!pTarget || !pMenu) @@ -587,9 +592,9 @@ void VclBuilder::handleTranslations(xmlreader::XmlReader &reader) } } -OString VclBuilder::extractCustomProperty(VclBuilder::stringmap &rMap) +OUString VclBuilder::extractCustomProperty(VclBuilder::stringmap &rMap) { - OString sCustomProperty; + OUString sCustomProperty; VclBuilder::stringmap::iterator aFind = rMap.find(OString("customproperty")); if (aFind != rMap.end()) { @@ -613,9 +618,9 @@ namespace return bDrawValue; } - OString extractValuePos(VclBuilder::stringmap& rMap) + OUString extractValuePos(VclBuilder::stringmap& rMap) { - OString sRet("top"); + OUString sRet("top"); VclBuilder::stringmap::iterator aFind = rMap.find(OString("value_pos")); if (aFind != rMap.end()) { @@ -625,9 +630,9 @@ namespace return sRet; } - OString extractTypeHint(VclBuilder::stringmap &rMap) + OUString extractTypeHint(VclBuilder::stringmap &rMap) { - OString sRet("normal"); + OUString sRet("normal"); VclBuilder::stringmap::iterator aFind = rMap.find(OString("type-hint")); if (aFind != rMap.end()) { @@ -709,9 +714,9 @@ namespace return bInconsistent; } - OString extractIconName(VclBuilder::stringmap &rMap) + OUString extractIconName(VclBuilder::stringmap &rMap) { - OString sIconName; + OUString sIconName; VclBuilder::stringmap::iterator aFind = rMap.find(OString("icon-name")); if (aFind != rMap.end()) { @@ -721,58 +726,58 @@ namespace return sIconName; } - OUString getStockText(const OString &rType) + OUString getStockText(const OUString &rType) { if (rType == "gtk-ok") - return (VclResId(SV_BUTTONTEXT_OK).toString()); + return VclResId(SV_BUTTONTEXT_OK); else if (rType == "gtk-cancel") - return (VclResId(SV_BUTTONTEXT_CANCEL).toString()); + return VclResId(SV_BUTTONTEXT_CANCEL); else if (rType == "gtk-help") - return (VclResId(SV_BUTTONTEXT_HELP).toString()); + return VclResId(SV_BUTTONTEXT_HELP); else if (rType == "gtk-close") - return (VclResId(SV_BUTTONTEXT_CLOSE).toString()); + return VclResId(SV_BUTTONTEXT_CLOSE); else if (rType == "gtk-revert-to-saved") - return (VclResId(SV_BUTTONTEXT_RESET).toString()); + return VclResId(SV_BUTTONTEXT_RESET); else if (rType == "gtk-add") - return (VclResId(SV_BUTTONTEXT_ADD).toString()); + return VclResId(SV_BUTTONTEXT_ADD); else if (rType == "gtk-delete") - return (VclResId(SV_BUTTONTEXT_DELETE).toString()); + return VclResId(SV_BUTTONTEXT_DELETE); else if (rType == "gtk-remove") - return (VclResId(SV_BUTTONTEXT_REMOVE).toString()); + return VclResId(SV_BUTTONTEXT_REMOVE); else if (rType == "gtk-new") - return (VclResId(SV_BUTTONTEXT_NEW).toString()); + return VclResId(SV_BUTTONTEXT_NEW); else if (rType == "gtk-edit") - return (VclResId(SV_BUTTONTEXT_EDIT).toString()); + return VclResId(SV_BUTTONTEXT_EDIT); else if (rType == "gtk-apply") - return (VclResId(SV_BUTTONTEXT_APPLY).toString()); + return VclResId(SV_BUTTONTEXT_APPLY); else if (rType == "gtk-save") - return (VclResId(SV_BUTTONTEXT_SAVE).toString()); + return VclResId(SV_BUTTONTEXT_SAVE); else if (rType == "gtk-open") - return (VclResId(SV_BUTTONTEXT_OPEN).toString()); + return VclResId(SV_BUTTONTEXT_OPEN); else if (rType == "gtk-undo") - return (VclResId(SV_BUTTONTEXT_UNDO).toString()); + return VclResId(SV_BUTTONTEXT_UNDO); else if (rType == "gtk-paste") - return (VclResId(SV_BUTTONTEXT_PASTE).toString()); + return VclResId(SV_BUTTONTEXT_PASTE); else if (rType == "gtk-media-next") - return (VclResId(SV_BUTTONTEXT_NEXT).toString()); + return VclResId(SV_BUTTONTEXT_NEXT); else if (rType == "gtk-go-up") - return (VclResId(SV_BUTTONTEXT_GO_UP).toString()); + return VclResId(SV_BUTTONTEXT_GO_UP); else if (rType == "gtk-go-down") - return (VclResId(SV_BUTTONTEXT_GO_DOWN).toString()); + return VclResId(SV_BUTTONTEXT_GO_DOWN); else if (rType == "gtk-clear") - return (VclResId(SV_BUTTONTEXT_CLEAR).toString()); + return VclResId(SV_BUTTONTEXT_CLEAR); else if (rType == "gtk-media-play") - return (VclResId(SV_BUTTONTEXT_PLAY).toString()); + return VclResId(SV_BUTTONTEXT_PLAY); else if (rType == "gtk-find") - return (VclResId(SV_BUTTONTEXT_FIND).toString()); + return VclResId(SV_BUTTONTEXT_FIND); else if (rType == "gtk-stop") - return (VclResId(SV_BUTTONTEXT_STOP).toString()); + return VclResId(SV_BUTTONTEXT_STOP); else if (rType == "gtk-connect") - return (VclResId(SV_BUTTONTEXT_CONNECT).toString()); + return VclResId(SV_BUTTONTEXT_CONNECT); else if (rType == "gtk-yes") - return (VclResId(SV_BUTTONTEXT_YES).toString()); + return VclResId(SV_BUTTONTEXT_YES); else if (rType == "gtk-no") - return (VclResId(SV_BUTTONTEXT_NO).toString()); + return VclResId(SV_BUTTONTEXT_NO); SAL_WARN("vcl.layout", "unknown stock type: " << rType.getStr()); return OUString(); } @@ -804,9 +809,9 @@ namespace return nBits; } - OString extractLabel(VclBuilder::stringmap &rMap) + OUString extractLabel(VclBuilder::stringmap &rMap) { - OString sType; + OUString sType; VclBuilder::stringmap::iterator aFind = rMap.find(OString("label")); if (aFind != rMap.end()) { @@ -816,9 +821,9 @@ namespace return sType; } - OString extractActionName(VclBuilder::stringmap &rMap) + OUString extractActionName(VclBuilder::stringmap &rMap) { - OString sActionName; + OUString sActionName; VclBuilder::stringmap::iterator aFind = rMap.find(OString("action-name")); if (aFind != rMap.end()) { @@ -840,8 +845,8 @@ namespace Size extractSizeRequest(VclBuilder::stringmap &rMap) { - OString sWidthRequest("0"); - OString sHeightRequest("0"); + OUString sWidthRequest("0"); + OUString sHeightRequest("0"); VclBuilder::stringmap::iterator aFind = rMap.find(OString("width-request")); if (aFind != rMap.end()) { @@ -857,9 +862,9 @@ namespace return Size(sWidthRequest.toInt32(), sHeightRequest.toInt32()); } - OString extractTooltipText(VclBuilder::stringmap &rMap) + OUString extractTooltipText(VclBuilder::stringmap &rMap) { - OString sTooltipText; + OUString sTooltipText; VclBuilder::stringmap::iterator aFind = rMap.find(OString("tooltip-text")); if (aFind == rMap.end()) aFind = rMap.find(OString("tooltip-markup")); @@ -876,7 +881,7 @@ namespace if (!rFrame.is()) return; - OUString aCommand(OStringToOUString(extractActionName(rMap), RTL_TEXTENCODING_UTF8)); + OUString aCommand(extractActionName(rMap)); if (aCommand.isEmpty()) return; @@ -907,7 +912,7 @@ namespace if (bIsStock) { - OString sType = extractLabel(rMap); + OUString sType = extractLabel(rMap); if (sType == "gtk-ok") xWindow = VclPtr<OKButton>::Create(pParent, nBits); else if (sType == "gtk-cancel") @@ -960,9 +965,9 @@ namespace return xWindow; } - OString extractUnit(const OString& sPattern) + OUString extractUnit(const OUString& sPattern) { - OString sUnit(sPattern); + OUString sUnit(sPattern); for (sal_Int32 i = 0; i < sPattern.getLength(); ++i) { if (sPattern[i] != '.' && sPattern[i] != ',' && sPattern[i] != '0') @@ -974,7 +979,7 @@ namespace return sUnit; } - int extractDecimalDigits(const OString& sPattern) + int extractDecimalDigits(const OUString& sPattern) { int nDigits = 0; bool bAfterPoint = false; @@ -993,7 +998,7 @@ namespace return nDigits; } - FieldUnit detectMetricUnit(const OString& sUnit) + FieldUnit detectMetricUnit(const OUString& sUnit) { FieldUnit eUnit = FUNIT_NONE; @@ -1044,12 +1049,12 @@ namespace nBits |= WB_SIZEABLE; if (extractCloseable(rMap)) nBits |= WB_CLOSEABLE; - OString sBorder = VclBuilder::extractCustomProperty(rMap); + OUString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nBits |= WB_BORDER; if (!extractDecorated(rMap)) nBits |= WB_OWNERDRAWDECORATION; - OString sType(extractTypeHint(rMap)); + OUString sType(extractTypeHint(rMap)); if (sType == "utility") nBits |= WB_SYSTEMWINDOW | WB_DIALOGCONTROL | WB_MOVEABLE; else if (sType == "popup-menu") @@ -1062,9 +1067,9 @@ namespace } } -FieldUnit VclBuilder::detectUnit(OString const& rString) +FieldUnit VclBuilder::detectUnit(OUString const& rString) { - OString const unit(extractUnit(rString)); + OUString const unit(extractUnit(rString)); return detectMetricUnit(unit); } @@ -1081,30 +1086,30 @@ bool VclBuilder::extractGroup(const OString &id, stringmap &rMap) VclBuilder::stringmap::iterator aFind = rMap.find(OString("group")); if (aFind != rMap.end()) { - OString sID = aFind->second; + OUString sID = aFind->second; sal_Int32 nDelim = sID.indexOf(':'); if (nDelim != -1) sID = sID.copy(0, nDelim); - m_pParserState->m_aGroupMaps.push_back(RadioButtonGroupMap(id, sID)); + m_pParserState->m_aGroupMaps.push_back(RadioButtonGroupMap(id, sID.toUtf8())); rMap.erase(aFind); return true; } return false; } -void VclBuilder::connectNumericFormatterAdjustment(const OString &id, const OString &rAdjustment) +void VclBuilder::connectNumericFormatterAdjustment(const OString &id, const OUString &rAdjustment) { if (!rAdjustment.isEmpty()) m_pParserState->m_aNumericFormatterAdjustmentMaps.push_back(WidgetAdjustmentMap(id, rAdjustment)); } -void VclBuilder::connectTimeFormatterAdjustment(const OString &id, const OString &rAdjustment) +void VclBuilder::connectTimeFormatterAdjustment(const OString &id, const OUString &rAdjustment) { if (!rAdjustment.isEmpty()) m_pParserState->m_aTimeFormatterAdjustmentMaps.push_back(WidgetAdjustmentMap(id, rAdjustment)); } -void VclBuilder::connectDateFormatterAdjustment(const OString &id, const OString &rAdjustment) +void VclBuilder::connectDateFormatterAdjustment(const OString &id, const OUString &rAdjustment) { if (!rAdjustment.isEmpty()) m_pParserState->m_aDateFormatterAdjustmentMaps.push_back(WidgetAdjustmentMap(id, rAdjustment)); @@ -1148,9 +1153,9 @@ namespace return bSelectable; } - OString extractAdjustment(VclBuilder::stringmap &rMap) + OUString extractAdjustment(VclBuilder::stringmap &rMap) { - OString sAdjustment; + OUString sAdjustment; VclBuilder::stringmap::iterator aFind = rMap.find(OString("adjustment")); if (aFind != rMap.end()) { @@ -1236,7 +1241,7 @@ void VclBuilder::extractMnemonicWidget(const OString &rLabelID, stringmap &rMap) VclBuilder::stringmap::iterator aFind = rMap.find(OString("mnemonic-widget")); if (aFind != rMap.end()) { - OString sID = aFind->second; + OUString sID = aFind->second; sal_Int32 nDelim = sID.indexOf(':'); if (nDelim != -1) sID = sID.copy(0, nDelim); @@ -1265,9 +1270,9 @@ void VclBuilder::cleanupWidgetOwnScrolling(vcl::Window *pScrollParent, vcl::Wind { //remove the redundant scrolling parent sal_Int32 nWidthReq = pScrollParent->get_width_request(); - rMap[OString("width-request")] = OString::number(nWidthReq); + rMap[OString("width-request")] = OUString::number(nWidthReq); sal_Int32 nHeightReq = pScrollParent->get_height_request(); - rMap[OString("height-request")] = OString::number(nHeightReq); + rMap[OString("height-request")] = OUString::number(nHeightReq); m_pParserState->m_aRedundantParentWidgets[pScrollParent] = pWindow; } @@ -1382,7 +1387,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & else if (name == "GtkButton") { VclPtr<Button> xButton; - OString sMenu = extractCustomProperty(rMap); + OUString sMenu = extractCustomProperty(rMap); if (sMenu.isEmpty()) xButton = extractStockAndBuildPushButton(pParent, rMap); else @@ -1397,7 +1402,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & else if (name == "GtkToggleButton") { VclPtr<Button> xButton; - OString sMenu = extractCustomProperty(rMap); + OUString sMenu = extractCustomProperty(rMap); assert(sMenu.getLength() && "not implemented yet"); xButton = extractStockAndBuildMenuToggleButton(pParent, rMap); m_pParserState->m_aButtonMenuMaps.push_back(ButtonMenuMap(id, sMenu)); @@ -1409,7 +1414,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & { extractGroup(id, rMap); WinBits nBits = WB_CLIPCHILDREN|WB_CENTER|WB_VCENTER|WB_3DLOOK; - OString sWrap = extractCustomProperty(rMap); + OUString sWrap = extractCustomProperty(rMap); if (!sWrap.isEmpty()) nBits |= WB_WORDBREAK; VclPtr<RadioButton> xButton = VclPtr<RadioButton>::Create(pParent, nBits); @@ -1419,7 +1424,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & else if (name == "GtkCheckButton") { WinBits nBits = WB_CLIPCHILDREN|WB_CENTER|WB_VCENTER|WB_3DLOOK; - OString sWrap = extractCustomProperty(rMap); + OUString sWrap = extractCustomProperty(rMap); if (!sWrap.isEmpty()) nBits |= WB_WORDBREAK; //maybe always import as TriStateBox and enable/disable tristate @@ -1436,9 +1441,9 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & } else if (name == "GtkSpinButton") { - OString sAdjustment = extractAdjustment(rMap); - OString sPattern = extractCustomProperty(rMap); - OString sUnit = extractUnit(sPattern); + OUString sAdjustment = extractAdjustment(rMap); + OUString sPattern = extractCustomProperty(rMap); + OUString sUnit = extractUnit(sPattern); WinBits nBits = WB_CLIPCHILDREN|WB_LEFT|WB_BORDER|WB_3DLOOK; if (!id.endsWith("-nospin")) @@ -1472,7 +1477,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & VclPtrInstance<MetricField> xField(pParent, nBits); xField->SetUnit(eUnit); if (eUnit == FUNIT_CUSTOM) - xField->SetCustomUnitText(OStringToOUString(sUnit, RTL_TEXTENCODING_UTF8)); + xField->SetCustomUnitText(sUnit); xWindow = xField; } } @@ -1481,7 +1486,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & xWindow = VclPtr<FixedHyperlink>::Create(pParent, WB_CENTER|WB_VCENTER|WB_3DLOOK|WB_NOLABEL); else if ((name == "GtkComboBox") || (name == "GtkComboBoxText") || (name == "VclComboBoxText")) { - OString sPattern = extractCustomProperty(rMap); + OUString sPattern = extractCustomProperty(rMap); extractModel(id, rMap); WinBits nBits = WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK; @@ -1493,9 +1498,9 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & if (!sPattern.isEmpty()) { - OString sAdjustment = extractAdjustment(rMap); + OUString sAdjustment = extractAdjustment(rMap); connectNumericFormatterAdjustment(id, sAdjustment); - OString sUnit = extractUnit(sPattern); + OUString sUnit = extractUnit(sPattern); FieldUnit eUnit = detectMetricUnit(sUnit); SAL_WARN("vcl.layout", "making metric box for type: " << name.getStr() << " unit: " << sUnit.getStr() @@ -1506,7 +1511,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & xBox->SetUnit(eUnit); xBox->SetDecimalDigits(extractDecimalDigits(sPattern)); if (eUnit == FUNIT_CUSTOM) - xBox->SetCustomUnitText(OStringToOUString(sUnit, RTL_TEXTENCODING_UTF8)); + xBox->SetCustomUnitText(sUnit); xWindow = xBox; } else if (extractEntry(rMap)) @@ -1524,8 +1529,8 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & } else if (name == "VclComboBoxNumeric") { - OString sPattern = extractCustomProperty(rMap); - OString sAdjustment = extractAdjustment(rMap); + OUString sPattern = extractCustomProperty(rMap); + OUString sAdjustment = extractAdjustment(rMap); extractModel(id, rMap); WinBits nBits = WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK; @@ -1538,7 +1543,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & if (!sPattern.isEmpty()) { connectNumericFormatterAdjustment(id, sAdjustment); - OString sUnit = extractUnit(sPattern); + OUString sUnit = extractUnit(sPattern); FieldUnit eUnit = detectMetricUnit(sUnit); SAL_INFO("vcl.layout", "making metric box for " << name.getStr() << " " << sUnit.getStr()); VclPtrInstance<MetricBox> xBox(pParent, nBits); @@ -1546,7 +1551,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & xBox->SetUnit(eUnit); xBox->SetDecimalDigits(extractDecimalDigits(sPattern)); if (eUnit == FUNIT_CUSTOM) - xBox->SetCustomUnitText(OStringToOUString(sUnit, RTL_TEXTENCODING_UTF8)); + xBox->SetCustomUnitText(sUnit); xWindow = xBox; } else @@ -1569,7 +1574,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & //d) remove the users of makeSvTreeViewBox extractModel(id, rMap); WinBits nWinStyle = WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE; - OString sBorder = extractCustomProperty(rMap); + OUString sBorder = extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; //ListBox manages its own scrolling, @@ -1581,7 +1586,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & else if (name == "GtkLabel") { WinBits nWinStyle = WB_CENTER|WB_VCENTER|WB_3DLOOK; - OString sBorder = extractCustomProperty(rMap); + OUString sBorder = extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; extractMnemonicWidget(id, rMap); @@ -1601,7 +1606,6 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & { rMap["visible"] = "false"; } - } else if (name == "GtkSeparator") { @@ -1643,7 +1647,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & } else if (name == "GtkDrawingArea") { - OString sBorder = extractCustomProperty(rMap); + OUString sBorder = extractCustomProperty(rMap); xWindow = VclPtr<vcl::Window>::Create(pParent, sBorder.isEmpty() ? 0 : WB_BORDER); } else if (name == "GtkTextView") @@ -1651,7 +1655,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & extractBuffer(id, rMap); WinBits nWinStyle = WB_CLIPCHILDREN|WB_LEFT; - OString sBorder = extractCustomProperty(rMap); + OUString sBorder = extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; //VclMultiLineEdit manages its own scrolling, @@ -1670,7 +1674,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & bool bDrawValue = extractDrawValue(rMap); if (bDrawValue) { - OString sValuePos = extractValuePos(rMap); + OUString sValuePos = extractValuePos(rMap); (void)sValuePos; } bVertical = extractOrientation(rMap); @@ -1689,7 +1693,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & ToolBox *pToolBox = dynamic_cast<ToolBox*>(pParent); if (pToolBox) { - OUString aCommand(OStringToOUString(extractActionName(rMap), RTL_TEXTENCODING_UTF8)); + OUString aCommand(extractActionName(rMap)); sal_uInt16 nItemId = 0; ToolBoxItemBits nBits = ToolBoxItemBits::NONE; @@ -1709,16 +1713,16 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & { nItemId = pToolBox->GetItemCount() + 1; //TODO: ImplToolItems::size_type -> sal_uInt16! - pToolBox->InsertItem(nItemId, OStringToOUString(extractLabel(rMap), RTL_TEXTENCODING_UTF8), nBits); + pToolBox->InsertItem(nItemId, extractLabel(rMap), nBits); pToolBox->SetItemCommand(nItemId, aCommand); pToolBox->SetHelpId(nItemId, m_sHelpRoot + id); } - OString sTooltip(extractTooltipText(rMap)); + OUString sTooltip(extractTooltipText(rMap)); if (!sTooltip.isEmpty()) - pToolBox->SetQuickHelpText(nItemId, OStringToOUString(sTooltip, RTL_TEXTENCODING_UTF8)); + pToolBox->SetQuickHelpText(nItemId, sTooltip); - OString sIconName(extractIconName(rMap)); + OUString sIconName(extractIconName(rMap)); if (!sIconName.isEmpty()) pToolBox->SetItemImage(nItemId, FixedImage::loadThemeImage(sIconName)); @@ -1795,7 +1799,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & setupFromActionName(static_cast<Button*>(xWindow.get()), rMap, m_xFrame); else if (xWindow->GetType() == WindowType::MENUBUTTON) { - OString sMenu = extractCustomProperty(rMap); + OUString sMenu = extractCustomProperty(rMap); if (!sMenu.isEmpty()) m_pParserState->m_aButtonMenuMaps.push_back(ButtonMenuMap(id, sMenu)); setupFromActionName(static_cast<Button*>(xWindow.get()), rMap, m_xFrame); @@ -1845,7 +1849,7 @@ void VclBuilder::set_properties(vcl::Window *pWindow, const stringmap &rProps) for (stringmap::const_iterator aI = rProps.begin(), aEnd = rProps.end(); aI != aEnd; ++aI) { const OString &rKey = aI->first; - const OString &rValue = aI->second; + const OUString &rValue = aI->second; pWindow->set_property(rKey, rValue); } } @@ -1905,7 +1909,7 @@ VclPtr<vcl::Window> VclBuilder::insertObject(vcl::Window *pParent, const OString for (stringmap::iterator aI = rPango.begin(), aEnd = rPango.end(); aI != aEnd; ++aI) { const OString &rKey = aI->first; - const OString &rValue = aI->second; + const OUString &rValue = aI->second; pCurrentChild->set_font_attribute(rKey, rValue); } @@ -1966,7 +1970,7 @@ void VclBuilder::handleTabChild(vcl::Window *pParent, xmlreader::XmlReader &read if (nDelim != -1) { OString sPattern = sID.copy(nDelim+1); - aProperties[OString("customproperty")] = sPattern; + aProperties[OString("customproperty")] = OUString::fromUtf8(sPattern); sID = sID.copy(0, nDelim); } } @@ -2000,8 +2004,7 @@ void VclBuilder::handleTabChild(vcl::Window *pParent, xmlreader::XmlReader &read if (aFind != aProperties.end()) { sal_uInt16 nPageId = pTabControl->GetCurPageId(); - pTabControl->SetPageText(nPageId, - OStringToOUString(aFind->second, RTL_TEXTENCODING_UTF8)); + pTabControl->SetPageText(nPageId, aFind->second); pTabControl->SetPageName(nPageId, sID); if (context.size() != 0) { @@ -2240,7 +2243,7 @@ void VclBuilder::collectPangoAttribute(xmlreader::XmlReader &reader, stringmap & } if (!sProperty.isEmpty()) - rMap[sProperty] = sValue; + rMap[sProperty] = OUString::fromUtf8(sValue); } void VclBuilder::collectAtkAttribute(xmlreader::XmlReader &reader, stringmap &rMap) @@ -2269,7 +2272,7 @@ void VclBuilder::collectAtkAttribute(xmlreader::XmlReader &reader, stringmap &rM } if (!sProperty.isEmpty()) - rMap[sProperty] = sValue; + rMap[sProperty] = OUString::fromUtf8(sValue); } void VclBuilder::handleRow(xmlreader::XmlReader &reader, const OString &rID, sal_Int32 nRowIndex) @@ -2320,7 +2323,7 @@ void VclBuilder::handleRow(xmlreader::XmlReader &reader, const OString &rID, sal if (aRow.size() < nId+1) aRow.resize(nId+1); - aRow[nId] = sValue; + aRow[nId] = OUString::fromUtf8(sValue); } } @@ -2408,7 +2411,7 @@ void VclBuilder::handleAtkObject(xmlreader::XmlReader &reader, const OString &rI for (stringmap::iterator aI = aProperties.begin(), aEnd = aProperties.end(); aI != aEnd; ++aI) { const OString &rKey = aI->first; - const OString &rValue = aI->second; + const OUString &rValue = aI->second; if (pWindow && rKey.match("AtkObject::")) pWindow->set_property(rKey.copy(RTL_CONSTASCII_LENGTH("AtkObject::")), rValue); @@ -2417,11 +2420,11 @@ void VclBuilder::handleAtkObject(xmlreader::XmlReader &reader, const OString &rI } } -std::vector<OString> VclBuilder::handleItems(xmlreader::XmlReader &reader, const OString &rID) +std::vector<OUString> VclBuilder::handleItems(xmlreader::XmlReader &reader, const OString & rID) { int nLevel = 1; - std::vector<OString> aItems; + std::vector<OUString> aItems; sal_Int32 nItemIndex = 0; while(true) @@ -2464,7 +2467,7 @@ std::vector<OString> VclBuilder::handleItems(xmlreader::XmlReader &reader, const sValue = OUStringToOString(sTmp, RTL_TEXTENCODING_UTF8); } - aItems.push_back(sValue); + aItems.push_back(OUString::fromUtf8(sValue)); ++nItemIndex; } } @@ -2562,7 +2565,7 @@ void VclBuilder::handleMenuObject(PopupMenu *pParent, xmlreader::XmlReader &read { OString sClass; OString sID; - OString sCustomProperty; + OUString sCustomProperty; PopupMenu *pSubMenu = nullptr; xmlreader::Span name; @@ -2582,7 +2585,7 @@ void VclBuilder::handleMenuObject(PopupMenu *pParent, xmlreader::XmlReader &read sal_Int32 nDelim = sID.indexOf(':'); if (nDelim != -1) { - sCustomProperty = sID.copy(nDelim+1); + sCustomProperty = OUString::fromUtf8(sID.copy(nDelim+1)); sID = sID.copy(0, nDelim); } } @@ -2688,9 +2691,9 @@ void VclBuilder::handleSizeGroup(xmlreader::XmlReader &reader, const OString &rI } } -OString VclBuilder::convertMnemonicMarkup(const OString &rIn) +OUString VclBuilder::convertMnemonicMarkup(const OUString &rIn) { - OStringBuffer aRet(rIn); + OUStringBuffer aRet(rIn); for (sal_Int32 nI = 0; nI < aRet.getLength(); ++nI) { if (aRet[nI] == '_' && nI+1 < aRet.getLength()) @@ -2741,8 +2744,8 @@ void VclBuilder::insertMenuObject(PopupMenu *pParent, PopupMenu *pSubMenu, const if (rClass == "GtkMenuItem") { - OUString sLabel(OStringToOUString(convertMnemonicMarkup(extractLabel(rProps)), RTL_TEXTENCODING_UTF8)); - OUString aCommand(OStringToOUString(extractActionName(rProps), RTL_TEXTENCODING_UTF8)); + OUString sLabel(convertMnemonicMarkup(extractLabel(rProps))); + OUString aCommand(extractActionName(rProps)); pParent->InsertItem(nNewId, sLabel, MenuItemBits::TEXT, rID); pParent->SetItemCommand(nNewId, aCommand); if (pSubMenu) @@ -2750,15 +2753,15 @@ void VclBuilder::insertMenuObject(PopupMenu *pParent, PopupMenu *pSubMenu, const } else if (rClass == "GtkCheckMenuItem") { - OUString sLabel(OStringToOUString(convertMnemonicMarkup(extractLabel(rProps)), RTL_TEXTENCODING_UTF8)); - OUString aCommand(OStringToOUString(extractActionName(rProps), RTL_TEXTENCODING_UTF8)); + OUString sLabel(convertMnemonicMarkup(extractLabel(rProps))); + OUString aCommand(extractActionName(rProps)); pParent->InsertItem(nNewId, sLabel, MenuItemBits::CHECKABLE, rID); pParent->SetItemCommand(nNewId, aCommand); } else if (rClass == "GtkRadioMenuItem") { - OUString sLabel(OStringToOUString(convertMnemonicMarkup(extractLabel(rProps)), RTL_TEXTENCODING_UTF8)); - OUString aCommand(OStringToOUString(extractActionName(rProps), RTL_TEXTENCODING_UTF8)); + OUString sLabel(convertMnemonicMarkup(extractLabel(rProps))); + OUString aCommand(extractActionName(rProps)); pParent->InsertItem(nNewId, sLabel, MenuItemBits::AUTOCHECK | MenuItemBits::RADIOCHECK, rID); pParent->SetItemCommand(nNewId, aCommand); } @@ -2776,12 +2779,12 @@ void VclBuilder::insertMenuObject(PopupMenu *pParent, PopupMenu *pSubMenu, const for (stringmap::iterator aI = rProps.begin(), aEnd = rProps.end(); aI != aEnd; ++aI) { const OString &rKey = aI->first; - const OString &rValue = aI->second; + const OUString &rValue = aI->second; if (rKey == "tooltip-markup") - pParent->SetTipHelpText(nNewId, OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); + pParent->SetTipHelpText(nNewId, rValue); else if (rKey == "tooltip-text") - pParent->SetTipHelpText(nNewId, OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); + pParent->SetTipHelpText(nNewId, rValue); else if (rKey == "visible") pParent->ShowItem(nNewId, toBool(rValue)); else if (rKey == "has-default" && toBool(rValue)) @@ -2807,15 +2810,15 @@ void VclBuilder::insertMenuObject(PopupMenu *pParent, PopupMenu *pSubMenu, const /// Insert items to a ComboBox or a ListBox. /// They have no common ancestor that would have 'InsertEntry()', so use a template. -template<typename T> bool insertItems(vcl::Window *pWindow, VclBuilder::stringmap &rMap, const std::vector<OString> &rItems) +template<typename T> bool insertItems(vcl::Window *pWindow, VclBuilder::stringmap &rMap, const std::vector<OUString> &rItems) { T *pContainer = dynamic_cast<T*>(pWindow); if (!pContainer) return false; sal_uInt16 nActiveId = extractActive(rMap); - for (std::vector<OString>::const_iterator aI = rItems.begin(), aEnd = rItems.end(); aI != aEnd; ++aI) - pContainer->InsertEntry(OStringToOUString(*aI, RTL_TEXTENCODING_UTF8)); + for (std::vector<OUString>::const_iterator aI = rItems.begin(), aEnd = rItems.end(); aI != aEnd; ++aI) + pContainer->InsertEntry(*aI); if (nActiveId < rItems.size()) pContainer->SelectEntryPos(nActiveId); @@ -2826,7 +2829,7 @@ VclPtr<vcl::Window> VclBuilder::handleObject(vcl::Window *pParent, xmlreader::Xm { OString sClass; OString sID; - OString sCustomProperty; + OUString sCustomProperty; xmlreader::Span name; int nsId; @@ -2845,7 +2848,7 @@ VclPtr<vcl::Window> VclBuilder::handleObject(vcl::Window *pParent, xmlreader::Xm sal_Int32 nDelim = sID.indexOf(':'); if (nDelim != -1) { - sCustomProperty = sID.copy(nDelim+1); + sCustomProperty = OUString::fromUtf8(sID.copy(nDelim+1)); sID = sID.copy(0, nDelim); } } @@ -2874,8 +2877,9 @@ VclPtr<vcl::Window> VclBuilder::handleObject(vcl::Window *pParent, xmlreader::Xm int nLevel = 1; - stringmap aProperties, aPangoAttributes, aAtkAttributes; - std::vector<OString> aItems; + stringmap aProperties, aPangoAttributes; + stringmap aAtkAttributes; + std::vector<OUString> aItems; if (!sCustomProperty.isEmpty()) aProperties[OString("customproperty")] = sCustomProperty; @@ -3228,11 +3232,11 @@ void VclBuilder::collectProperty(xmlreader::XmlReader &reader, const OString &rI if (m_pStringReplace) { OUString sTmp = (*m_pStringReplace)(OStringToOUString(sValue, RTL_TEXTENCODING_UTF8)); - rMap[sProperty] = OUStringToOString(sTmp, RTL_TEXTENCODING_UTF8); + rMap[sProperty] = sTmp; } else { - rMap[sProperty] = sValue; + rMap[sProperty] = OUString::fromUtf8(sValue); } } } @@ -3460,7 +3464,7 @@ void VclBuilder::mungeModel(ListBox &rTarget, const ListStore &rStore, sal_uInt1 aI != aEnd; ++aI) { const ListStore::row &rRow = *aI; - sal_uInt16 nEntry = rTarget.InsertEntry(OStringToOUString(rRow[0], RTL_TEXTENCODING_UTF8)); + sal_uInt16 nEntry = rTarget.InsertEntry(rRow[0]); if (rRow.size() > 1) { sal_IntPtr nValue = rRow[1].toInt32(); @@ -3478,7 +3482,7 @@ void VclBuilder::mungeAdjustment(NumericFormatter &rTarget, const Adjustment &rA for (stringmap::const_iterator aI = rAdjustment.begin(), aEnd = rAdjustment.end(); aI != aEnd; ++aI) { const OString &rKey = aI->first; - const OString &rValue = aI->second; + const OUString &rValue = aI->second; if (rKey == "upper") { @@ -3514,7 +3518,7 @@ void VclBuilder::mungeAdjustment(TimeField &rTarget, const Adjustment &rAdjustme for (stringmap::const_iterator aI = rAdjustment.begin(), aEnd = rAdjustment.end(); aI != aEnd; ++aI) { const OString &rKey = aI->first; - const OString &rValue = aI->second; + const OUString &rValue = aI->second; if (rKey == "upper") { @@ -3545,7 +3549,7 @@ void VclBuilder::mungeAdjustment(DateField &rTarget, const Adjustment &rAdjustme for (stringmap::const_iterator aI = rAdjustment.begin(), aEnd = rAdjustment.end(); aI != aEnd; ++aI) { const OString &rKey = aI->first; - const OString &rValue = aI->second; + const OUString &rValue = aI->second; if (rKey == "upper") { @@ -3576,7 +3580,7 @@ void VclBuilder::mungeAdjustment(ScrollBar &rTarget, const Adjustment &rAdjustme for (stringmap::const_iterator aI = rAdjustment.begin(), aEnd = rAdjustment.end(); aI != aEnd; ++aI) { const OString &rKey = aI->first; - const OString &rValue = aI->second; + const OUString &rValue = aI->second; if (rKey == "upper") rTarget.SetRangeMax(rValue.toInt32()); @@ -3600,7 +3604,7 @@ void VclBuilder::mungeAdjustment(Slider& rTarget, const Adjustment& rAdjustment) for (stringmap::const_iterator aI = rAdjustment.begin(), aEnd = rAdjustment.end(); aI != aEnd; ++aI) { const OString &rKey = aI->first; - const OString &rValue = aI->second; + const OUString &rValue = aI->second; if (rKey == "upper") rTarget.SetRangeMax(rValue.toInt32()); @@ -3624,10 +3628,10 @@ void VclBuilder::mungeTextBuffer(VclMultiLineEdit &rTarget, const TextBuffer &rT for (stringmap::const_iterator aI = rTextBuffer.begin(), aEnd = rTextBuffer.end(); aI != aEnd; ++aI) { const OString &rKey = aI->first; - const OString &rValue = aI->second; + const OUString &rValue = aI->second; if (rKey == "text") - rTarget.SetText(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); + rTarget.SetText(rValue); else { SAL_INFO("vcl.layout", "unhandled property :" << rKey.getStr()); diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index da4524ff183e..080e9ace55fb 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -1168,7 +1168,7 @@ void Dialog::queue_resize(StateChangedType eReason) SystemWindow::queue_resize(eReason); } -bool Dialog::set_property(const OString &rKey, const OString &rValue) +bool Dialog::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "border-width") set_border_width(rValue.toInt32()); diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 8b98c39b41c5..e73808df8e9b 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -262,10 +262,10 @@ void VclContainer::Command(const CommandEvent& rCEvt) aMenu->InsertItem( nLocalID, - VclResId(SV_BUTTONTEXT_SCREENSHOT).toString()); + VclResId(SV_BUTTONTEXT_SCREENSHOT)); aMenu->SetHelpText( nLocalID, - VclResId(SV_HELPTEXT_SCREENSHOT).toString()); + VclResId(SV_HELPTEXT_SCREENSHOT)); aMenu->SetHelpId( nLocalID, "InteractiveScreenshotMode"); @@ -486,7 +486,7 @@ void VclBox::setAllocation(const Size &rAllocation) } } -bool VclBox::set_property(const OString &rKey, const OString &rValue) +bool VclBox::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "spacing") set_spacing(rValue.toInt32()); @@ -706,7 +706,7 @@ Size VclButtonBox::calculateRequisition() const return addSpacing(addReqGroups(aReq), nVisibleChildren); } -bool VclButtonBox::set_property(const OString &rKey, const OString &rValue) +bool VclButtonBox::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "layout-style") { @@ -1429,12 +1429,12 @@ void VclGrid::setAllocation(const Size& rAllocation) } } -bool toBool(const OString &rValue) +bool toBool(const OUString &rValue) { return (!rValue.isEmpty() && (rValue[0] == 't' || rValue[0] == 'T' || rValue[0] == '1')); } -bool VclGrid::set_property(const OString &rKey, const OString &rValue) +bool VclGrid::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "row-spacing") set_row_spacing(rValue.toInt32()); @@ -1646,7 +1646,7 @@ void VclAlignment::setAllocation(const Size &rAllocation) setLayoutAllocation(*pChild, aChildPos, aAllocation); } -bool VclAlignment::set_property(const OString &rKey, const OString &rValue) +bool VclAlignment::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "bottom-padding") m_nBottomPadding = rValue.toInt32(); @@ -1777,7 +1777,7 @@ void VclExpander::setAllocation(const Size &rAllocation) } } -bool VclExpander::set_property(const OString &rKey, const OString &rValue) +bool VclExpander::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "expanded") set_expanded(toBool(rValue)); @@ -2005,7 +2005,7 @@ Size VclScrolledWindow::getVisibleChildSize() const return aRet; } -bool VclScrolledWindow::set_property(const OString &rKey, const OString &rValue) +bool VclScrolledWindow::set_property(const OString &rKey, const OUString &rValue) { bool bRet = VclBin::set_property(rKey, rValue); m_pVScroll->Show((GetStyle() & WB_VSCROLL) != 0); @@ -2130,20 +2130,20 @@ void VclSizeGroup::set_mode(VclSizeGroupMode eMode) } -bool VclSizeGroup::set_property(const OString &rKey, const OString &rValue) +bool VclSizeGroup::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "ignore-hidden") set_ignore_hidden(toBool(rValue)); else if (rKey == "mode") { VclSizeGroupMode eMode = VclSizeGroupMode::Horizontal; - if (rValue.equals("none")) + if (rValue == "none") eMode = VclSizeGroupMode::NONE; - else if (rValue.equals("horizontal")) + else if (rValue == "horizontal") eMode = VclSizeGroupMode::Horizontal; - else if (rValue.equals("vertical")) + else if (rValue == "vertical") eMode = VclSizeGroupMode::Vertical; - else if (rValue.equals("both")) + else if (rValue == "both") eMode = VclSizeGroupMode::Both; else { @@ -2454,22 +2454,22 @@ OUString const & MessageDialog::get_secondary_text() const return m_sSecondaryString; } -bool MessageDialog::set_property(const OString &rKey, const OString &rValue) +bool MessageDialog::set_property(const OString &rKey, const OUString &rValue) { if (rKey == "text") - set_primary_text(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); + set_primary_text(rValue); else if (rKey == "secondary-text") - set_secondary_text(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); + set_secondary_text(rValue); else if (rKey == "message-type") { VclMessageType eMode = VclMessageType::Info; - if (rValue.equals("info")) + if (rValue == "info") eMode = VclMessageType::Info; - else if (rValue.equals("warning")) + else if (rValue == "warning") eMode = VclMessageType::Warning; - else if (rValue.equals("question")) + else if (rValue == "question") eMode = VclMessageType::Question; - else if (rValue.equals("error")) + else if (rValue == "error") eMode = VclMessageType::Error; else { @@ -2480,17 +2480,17 @@ bool MessageDialog::set_property(const OString &rKey, const OString &rValue) else if (rKey == "buttons") { VclButtonsType eMode = VclButtonsType::NONE; - if (rValue.equals("none")) + if (rValue == "none") eMode = VclButtonsType::NONE; - else if (rValue.equals("ok")) + else if (rValue == "ok") eMode = VclButtonsType::Ok; - else if (rValue.equals("cancel")) + else if (rValue == "cancel") eMode = VclButtonsType::Cancel; - else if (rValue.equals("close")) + else if (rValue == "close") eMode = VclButtonsType::Close; - else if (rValue.equals("yes-no")) + else if (rValue == "yes-no") eMode = VclButtonsType::YesNo; - else if (rValue.equals("ok-cancel")) + else if (rValue == "ok-cancel") eMode = VclButtonsType::OkCancel; else { diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 4db55175a0c8..20e1855a37fa 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1395,7 +1395,7 @@ void Window::queue_resize(StateChangedType eReason) namespace { - VclAlign toAlign(const OString &rValue) + VclAlign toAlign(const OUString &rValue) { VclAlign eRet = VclAlign::Fill; @@ -1411,7 +1411,7 @@ namespace } } -bool Window::set_font_attribute(const OString &rKey, const OString &rValue) +bool Window::set_font_attribute(const OString &rKey, const OUString &rValue) { if (rKey == "weight") { @@ -1470,11 +1470,11 @@ bool Window::set_font_attribute(const OString &rKey, const OString &rValue) return true; } -bool Window::set_property(const OString &rKey, const OString &rValue) +bool Window::set_property(const OString &rKey, const OUString &rValue) { if ((rKey == "label") || (rKey == "title") || (rKey == "text") ) { - SetText(OStringToOUString(VclBuilder::convertMnemonicMarkup(rValue), RTL_TEXTENCODING_UTF8)); + SetText(VclBuilder::convertMnemonicMarkup(rValue)); } else if (rKey == "visible") Show(toBool(rValue)); @@ -1553,9 +1553,9 @@ bool Window::set_property(const OString &rKey, const OString &rValue) else if (rKey == "valign") set_valign(toAlign(rValue)); else if (rKey == "tooltip-markup") - SetQuickHelpText(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); + SetQuickHelpText(rValue); else if (rKey == "tooltip-text") - SetQuickHelpText(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); + SetQuickHelpText(rValue); else if (rKey == "border-width") set_border_width(rValue.toInt32()); else if (rKey == "margin-left") @@ -1588,11 +1588,11 @@ bool Window::set_property(const OString &rKey, const OString &rValue) } else if (rKey == "accessible-name") { - SetAccessibleName(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); + SetAccessibleName(rValue); } else if (rKey == "accessible-description") { - SetAccessibleDescription(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); + SetAccessibleDescription(rValue); } else if (rKey == "use-markup") { |