diff options
author | Jean-Noël Rouvignac <jn.rouvignac@gmail.com> | 2013-02-08 09:06:10 +0100 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-02-08 14:57:16 +0000 |
commit | 9e310cc32923ceb4b18d97ce68d54a339b935f01 (patch) | |
tree | d79b44b80c15f6bdb3116db4c9b6955a9e6cb4c9 /svx | |
parent | 9c427991d9658a870ee0eb1bdc4cd3b393c93fd5 (diff) |
fdo#38838 Some removal/replacement of the String/UniString with OUString
Change-Id: I6daea312198fae3a9717bd8d4fea6371aa4cd275
Reviewed-on: https://gerrit.libreoffice.org/1962
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Tor Lillqvist <tml@iki.fi>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/svx/fmview.hxx | 2 | ||||
-rw-r--r-- | svx/source/form/filtnav.cxx | 22 | ||||
-rw-r--r-- | svx/source/form/fmpage.cxx | 8 | ||||
-rw-r--r-- | svx/source/form/fmshimp.cxx | 22 | ||||
-rw-r--r-- | svx/source/form/fmsrcimp.cxx | 17 | ||||
-rw-r--r-- | svx/source/form/fmview.cxx | 10 | ||||
-rw-r--r-- | svx/source/form/tabwin.cxx | 9 | ||||
-rw-r--r-- | svx/source/inc/filtnav.hxx | 2 |
8 files changed, 44 insertions, 48 deletions
diff --git a/svx/inc/svx/fmview.hxx b/svx/inc/svx/fmview.hxx index c46bbdb5ca19..d31c225df119 100644 --- a/svx/inc/svx/fmview.hxx +++ b/svx/inc/svx/fmview.hxx @@ -72,7 +72,7 @@ public: @deprecated This method is deprecated. Use the version with a ODataAccessDescriptor instead. */ - SdrObject* CreateFieldControl(const UniString& rFieldDesc) const; + SdrObject* CreateFieldControl(const OUString& rFieldDesc) const; /** create a control pair (label/bound control) for the database field description given. */ diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 8fec3cf8e182..11a449c40407 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -877,7 +877,7 @@ void FmFilterModel::Remove( const ::std::vector<FmFilterData*>::iterator& rPos ) } //------------------------------------------------------------------------ -sal_Bool FmFilterModel::ValidateText(FmFilterItem* pItem, UniString& rText, UniString& rErrorMsg) const +sal_Bool FmFilterModel::ValidateText(FmFilterItem* pItem, OUString& rText, OUString& rErrorMsg) const { FmFormItem* pFormItem = PTR_CAST( FmFormItem, pItem->GetParent()->GetParent() ); try @@ -1092,14 +1092,14 @@ void FmFilterItemsString::InitViewData( SvTreeListBox* pView,SvTreeListEntry* pE //======================================================================== class FmFilterString : public SvLBoxString { - UniString m_aName; + OUString m_aName; public: - FmFilterString( SvTreeListEntry* pEntry, sal_uInt16 nFlags, const XubString& rStr, const UniString& aName) + FmFilterString( SvTreeListEntry* pEntry, sal_uInt16 nFlags, const XubString& rStr, const OUString& aName) :SvLBoxString(pEntry,nFlags,rStr) ,m_aName(aName) { - m_aName.AppendAscii(": "); + m_aName += ": "; } virtual void Paint(const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry); @@ -1231,8 +1231,8 @@ sal_Bool FmFilterNavigator::EditedEntry( SvTreeListEntry* pEntry, const rtl::OUS DBG_ASSERT(((FmFilterData*)pEntry->GetUserData())->ISA(FmFilterItem), "FmFilterNavigator::EditedEntry() wrong entry"); - UniString aText(comphelper::string::strip(rNewText, ' ')); - if (aText.Len() == 0) + OUString aText(comphelper::string::strip(rNewText, ' ')); + if (aText.isEmpty()) { // deleting the entry asynchron sal_uLong nEvent; @@ -1240,7 +1240,7 @@ sal_Bool FmFilterNavigator::EditedEntry( SvTreeListEntry* pEntry, const rtl::OUS } else { - UniString aErrorMsg; + OUString aErrorMsg; if (m_pModel->ValidateText((FmFilterItem*)pEntry->GetUserData(), aText, aErrorMsg)) { @@ -1732,12 +1732,12 @@ void FmFilterNavigator::Command( const CommandEvent& rEvt ) case SID_FM_FILTER_IS_NULL: case SID_FM_FILTER_IS_NOT_NULL: { - UniString aErrorMsg; - UniString aText; + OUString aErrorMsg; + OUString aText; if (nSlotId == SID_FM_FILTER_IS_NULL) - aText.AssignAscii("IS NULL"); + aText = "IS NULL"; else - aText.AssignAscii("IS NOT NULL"); + aText = "IS NOT NULL"; m_pModel->ValidateText((FmFilterItem*)pClicked->GetUserData(), aText, aErrorMsg); diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx index 8059fcd364f0..bcf3147b90dd 100644 --- a/svx/source/form/fmpage.cxx +++ b/svx/source/form/fmpage.cxx @@ -173,16 +173,16 @@ sal_Bool FmFormPage::RequestHelp( Window* pWindow, SdrView* pView, if ( !pFormObject ) return sal_False; - UniString aHelpText; + OUString aHelpText; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xSet( pFormObject->GetUnoControlModel(), ::com::sun::star::uno::UNO_QUERY ); if (xSet.is()) { if (::comphelper::hasProperty(FM_PROP_HELPTEXT, xSet)) aHelpText = ::comphelper::getString(xSet->getPropertyValue(FM_PROP_HELPTEXT)).getStr(); - if (!aHelpText.Len() && ::comphelper::hasProperty(FM_PROP_TARGET_URL, xSet)) + if (!aHelpText.getLength() && ::comphelper::hasProperty(FM_PROP_TARGET_URL, xSet)) { - ::rtl::OUString aText = ::comphelper::getString(xSet->getPropertyValue(FM_PROP_TARGET_URL)); + OUString aText = ::comphelper::getString(xSet->getPropertyValue(FM_PROP_TARGET_URL)); INetURLObject aUrl(aText); // testen, ob es ein Protokoll-Typ ist, den ich anzeigen will @@ -200,7 +200,7 @@ sal_Bool FmFormPage::RequestHelp( Window* pWindow, SdrView* pView, } } } - if ( aHelpText.Len() != 0 ) + if ( aHelpText.getLength() != 0 ) { // Hilfe anzeigen Rectangle aItemRect = pObj->GetCurrentBoundRect(); diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 31304ac7aa00..b71785a8dc6d 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -1565,8 +1565,8 @@ void FmXFormShell::ExecuteSearch() // wenn der Dialog initial den Text des aktiven Controls anbieten soll, muss dieses ein XTextComponent-Interface habe, // ausserdem macht das nur Sinn, wenn das aktuelle Feld auch an ein Tabellen- (oder was-auch-immer-)Feld gebunden ist - UniString strActiveField; - UniString strInitialText; + OUString strActiveField; + OUString strInitialText; // ... das bekomme ich von meinem FormController DBG_ASSERT(m_xActiveController.is(), "FmXFormShell::ExecuteSearch : no active controller !"); Reference< XControl> xActiveControl( m_xActiveController->getCurrentControl()); @@ -2393,7 +2393,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn // -------------------------------------------------------------------------------------------- // assemble the list of fields to involve (that is, the ControlSources of all fields that have such a property) - UniString strFieldList, sFieldDisplayNames; + OUString strFieldList, sFieldDisplayNames; m_arrSearchedControls.clear(); m_arrRelativeGridColumn.clear(); @@ -2497,11 +2497,11 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn // the cursor has a field matching the control source ? if (xValidFormFields->hasByName(aName)) { - strFieldList += aName.getStr(); - strFieldList += ';'; + strFieldList = strFieldList + OUString(aName.getStr()) + ";"; - sFieldDisplayNames += ::comphelper::getString(xCurrentColModel->getPropertyValue(FM_PROP_LABEL)).getStr(); - sFieldDisplayNames += ';'; + sFieldDisplayNames = sFieldDisplayNames + + OUString(::comphelper::getString(xCurrentColModel->getPropertyValue(FM_PROP_LABEL)).getStr()) + + ";"; pfmscContextInfo->arrFields.push_back(xCurrentColumn); @@ -2527,12 +2527,12 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn if (IsSearchableControl(xControl)) { // all tests passed -> take along in the list - strFieldList += sControlSource.getStr(); - strFieldList += ';'; + strFieldList = strFieldList + OUString(sControlSource.getStr()) + ";"; // the label which should appear for the control : - sFieldDisplayNames += getLabelName(Reference< XPropertySet>(xControlModel, UNO_QUERY)).getStr(); - sFieldDisplayNames += ';'; + sFieldDisplayNames = sFieldDisplayNames + + OUString(getLabelName(Reference< XPropertySet>(xControlModel, UNO_QUERY)).getStr()) + + ";"; // mark the SdrObject (accelerates the treatment in OnFoundData) m_arrSearchedControls.push_back(pCurrent); diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx index d52ce82af6d3..2e5edd8354dc 100644 --- a/svx/source/form/fmsrcimp.cxx +++ b/svx/source/form/fmsrcimp.cxx @@ -989,24 +989,23 @@ void FmSearchEngine::SearchNextImpl() if (!m_bWildcard) { // da natuerlich in allen anderen Faellen auch * und ? im Suchstring erlaubt sind, aber nicht als WildCards zaehlen // sollen, muss ich normieren - UniString aTmp(strSearchExpression); - const rtl::OUString s_sStar("\\*"); - const rtl::OUString s_sQuotation("\\?"); - aTmp.SearchAndReplaceAll(rtl::OUString('*'), s_sStar); - aTmp.SearchAndReplaceAll(rtl::OUString('?'), s_sQuotation); + OUString aTmp(strSearchExpression); + const OUString s_sStar("\\*"); + const OUString s_sQuotation("\\?"); + aTmp = aTmp.replaceAll("*", s_sStar); + aTmp = aTmp.replaceAll("?", s_sQuotation); strSearchExpression = aTmp; switch (m_nPosition) { case MATCHING_ANYWHERE : - strSearchExpression = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")) + strSearchExpression - + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")); + strSearchExpression = "*" + strSearchExpression + "*"; break; case MATCHING_BEGINNING : - strSearchExpression = strSearchExpression + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")); + strSearchExpression = strSearchExpression + "*"; break; case MATCHING_END : - strSearchExpression = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")) + strSearchExpression; + strSearchExpression = "*" + strSearchExpression; break; case MATCHING_WHOLETEXT : break; diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx index 047e9ab4c55c..abd632ba6838 100644 --- a/svx/source/form/fmview.cxx +++ b/svx/source/form/fmview.cxx @@ -424,12 +424,12 @@ SdrObject* FmFormView::CreateXFormsControl( const OXFormsDescriptor &_rDesc ) } //------------------------------------------------------------------------ -SdrObject* FmFormView::CreateFieldControl(const UniString& rFieldDesc) const +SdrObject* FmFormView::CreateFieldControl(const OUString& rFieldDesc) const { - ::rtl::OUString sDataSource = rFieldDesc.GetToken(0,sal_Unicode(11)); - ::rtl::OUString sObjectName = rFieldDesc.GetToken(1,sal_Unicode(11)); - sal_uInt16 nObjectType = (sal_uInt16)rFieldDesc.GetToken(2,sal_Unicode(11)).ToInt32(); - ::rtl::OUString sFieldName = rFieldDesc.GetToken(3,sal_Unicode(11)); + OUString sDataSource = rFieldDesc.getToken(0,sal_Unicode(11)); + OUString sObjectName = rFieldDesc.getToken(1,sal_Unicode(11)); + sal_uInt16 nObjectType = (sal_uInt16)rFieldDesc.getToken(2,sal_Unicode(11)).toInt32(); + OUString sFieldName = rFieldDesc.getToken(3,sal_Unicode(11)); if (sFieldName.isEmpty() || sObjectName.isEmpty() || sDataSource.isEmpty()) return NULL; diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx index 7be58df51c18..a7d96f60ef0f 100644 --- a/svx/source/form/tabwin.cxx +++ b/svx/source/form/tabwin.cxx @@ -336,7 +336,7 @@ void FmFieldWin::UpdateContent(const ::com::sun::star::uno::Reference< ::com::su { // ListBox loeschen pListBox->Clear(); - UniString aTitle(SVX_RES(RID_STR_FIELDSELECTION)); + OUString aTitle(SVX_RES(RID_STR_FIELDSELECTION)); SetText(aTitle); if (!xForm.is()) @@ -370,7 +370,7 @@ void FmFieldWin::UpdateContent(const ::com::sun::star::uno::Reference< ::com::su } // Prefix setzen - UniString aPrefix; + OUString aPrefix; StringListResource aPrefixes( SVX_RES( RID_RSC_TABWIN_PREFIX ) ); switch (m_nObjectType) @@ -399,10 +399,7 @@ void FmFieldWin::UpdateContent(const ::com::sun::star::uno::Reference< ::com::su m_pChangeListener->addProperty(FM_PROP_COMMANDTYPE); // Titel setzen - aTitle.AppendAscii(" "); - aTitle += aPrefix; - aTitle.AppendAscii(" "); - aTitle += m_aObjectName.getStr(); + aTitle = aTitle + " " + aPrefix + " " + OUString(m_aObjectName.getStr()); SetText( aTitle ); } catch( const Exception& ) diff --git a/svx/source/inc/filtnav.hxx b/svx/source/inc/filtnav.hxx index c23630afd930..aeaee7408cc1 100644 --- a/svx/source/inc/filtnav.hxx +++ b/svx/source/inc/filtnav.hxx @@ -176,7 +176,7 @@ public: void Update(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & xControllers, const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > & xCurrent); void Clear(); - sal_Bool ValidateText(FmFilterItem* pItem, UniString& rText, UniString& rErrorMsg) const; + sal_Bool ValidateText(FmFilterItem* pItem, OUString& rText, OUString& rErrorMsg) const; void Append(FmFilterItems* pItems, FmFilterItem* pFilterItem); void SetTextForItem(FmFilterItem* pItem, const ::rtl::OUString& rText); |