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 /vcl | |
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>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/scrwnd.hxx | 3 | ||||
-rw-r--r-- | vcl/source/control/button.cxx | 8 | ||||
-rw-r--r-- | vcl/source/control/combobox.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/field.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/fixed.cxx | 9 | ||||
-rw-r--r-- | vcl/source/control/fixedhyper.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/listbox.cxx | 2 | ||||
-rw-r--r-- | vcl/source/edit/vclmedit.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 306 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 54 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 16 |
13 files changed, 209 insertions, 207 deletions
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") { |