[Libreoffice-commits] core.git: 38 commits - dbaccess/inc dbaccess/source drawinglayer/source fpicker/source include/drawinglayer include/sfx2 include/svtools sc/inc sc/source sfx2/source svtools/source sw/source
Noel Grandin
noel at peralex.com
Thu Aug 22 01:50:52 PDT 2013
dbaccess/inc/pch/precompiled_dbu.hxx | 1
dbaccess/source/ui/dlg/CollectionView.cxx | 1
drawinglayer/source/attribute/fontattribute.cxx | 20 -
drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx | 4
drawinglayer/source/primitive2d/textlayoutdevice.cxx | 16
drawinglayer/source/primitive2d/textprimitive2d.cxx | 4
drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx | 4
drawinglayer/source/processor2d/vclhelperbufferdevice.cxx | 6
drawinglayer/source/processor2d/vclprocessor2d.cxx | 4
fpicker/source/office/iodlg.cxx | 8
include/drawinglayer/attribute/fontattribute.hxx | 12
include/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx | 4
include/drawinglayer/primitive2d/textlayoutdevice.hxx | 14
include/drawinglayer/primitive2d/textprimitive2d.hxx | 6
include/sfx2/frmhtmlw.hxx | 12
include/sfx2/titledockwin.hxx | 8
include/sfx2/tplpitem.hxx | 6
include/sfx2/unoctitm.hxx | 2
include/sfx2/viewfac.hxx | 10
include/sfx2/viewfrm.hxx | 2
include/sfx2/viewsh.hxx | 2
include/svtools/QueryFolderName.hxx | 8
include/svtools/accessibletableprovider.hxx | 2
include/svtools/addresstemplate.hxx | 6
include/svtools/brwbox.hxx | 2
include/svtools/calendar.hxx | 2
include/svtools/ctrlbox.hxx | 6
include/svtools/ctrltool.hxx | 6
include/svtools/editbrowsebox.hxx | 18 -
include/svtools/editimplementation.hxx | 6
include/svtools/ehdl.hxx | 8
include/svtools/filectrl.hxx | 4
include/svtools/fileurlbox.hxx | 4
include/svtools/fileview.hxx | 28 -
include/svtools/fmtfield.hxx | 12
include/svtools/grfmgr.hxx | 20 -
include/svtools/helpopt.hxx | 8
include/svtools/htmlout.hxx | 25 -
include/svtools/htmltokn.h | 12
include/svtools/imagemgr.hxx | 12
include/svtools/svtabbx.hxx | 2
include/svtools/treelistbox.hxx | 10
sc/inc/filter.hxx | 2
sc/source/filter/html/htmlexp.cxx | 2
sc/source/filter/inc/ftools.hxx | 2
sc/source/filter/inc/htmlexp.hxx | 4
sc/source/ui/docshell/docsh.cxx | 2
sc/source/ui/docshell/impex.cxx | 2
sc/source/ui/inc/impex.hxx | 4
sfx2/source/bastyp/frmhtmlw.cxx | 6
sfx2/source/control/unoctitm.cxx | 2
sfx2/source/dialog/titledockwin.cxx | 6
sfx2/source/dialog/tplpitem.cxx | 2
sfx2/source/doc/docfac.cxx | 2
sfx2/source/view/viewfac.cxx | 6
sfx2/source/view/viewfrm.cxx | 2
sfx2/source/view/viewsh.cxx | 2
svtools/source/brwbox/brwbox3.cxx | 2
svtools/source/brwbox/datwin.cxx | 12
svtools/source/brwbox/datwin.hxx | 20 -
svtools/source/brwbox/ebbcontrols.cxx | 6
svtools/source/config/fontsubstconfig.cxx | 2
svtools/source/config/helpopt.cxx | 20 -
svtools/source/contnr/contentenumeration.cxx | 4
svtools/source/contnr/contentenumeration.hxx | 4
svtools/source/contnr/fileview.cxx | 129 +++----
svtools/source/contnr/imivctl.hxx | 4
svtools/source/contnr/imivctl1.cxx | 28 -
svtools/source/contnr/ivctrl.cxx | 2
svtools/source/contnr/svtabbx.cxx | 6
svtools/source/contnr/templwin.cxx | 174 ++++------
svtools/source/contnr/templwin.hxx | 76 ++--
svtools/source/contnr/treelistbox.cxx | 18 -
svtools/source/control/calendar.cxx | 10
svtools/source/control/ctrlbox.cxx | 22 -
svtools/source/control/ctrltool.cxx | 14
svtools/source/control/fileurlbox.cxx | 6
svtools/source/control/fmtfield.cxx | 42 +-
svtools/source/control/inettbc.cxx | 170 ++++-----
svtools/source/control/stdmenu.cxx | 8
svtools/source/control/tabbar.cxx | 2
svtools/source/control/toolbarmenu.cxx | 6
svtools/source/control/toolbarmenuacc.cxx | 6
svtools/source/control/toolbarmenuimp.hxx | 6
svtools/source/control/valueacc.cxx | 6
svtools/source/dialogs/addresstemplate.cxx | 58 +--
svtools/source/dialogs/insdlg.cxx | 6
svtools/source/dialogs/roadmapwizard.cxx | 2
svtools/source/filter/SvFilterOptionsDialog.cxx | 26 -
svtools/source/filter/exportdialog.cxx | 28 -
svtools/source/filter/exportdialog.hxx | 26 -
svtools/source/graphic/descriptor.cxx | 2
svtools/source/graphic/grfcache.cxx | 2
svtools/source/graphic/grfmgr.cxx | 66 +--
svtools/source/graphic/provider.cxx | 10
svtools/source/misc/ehdl.cxx | 24 -
svtools/source/misc/embedhlp.cxx | 2
svtools/source/misc/embedtransfer.cxx | 2
svtools/source/misc/imagemgr.cxx | 97 ++---
svtools/source/misc/imap.cxx | 4
svtools/source/misc/imap2.cxx | 68 +--
svtools/source/misc/langtab.cxx | 7
svtools/source/misc/templatefoldercache.cxx | 24 -
svtools/source/misc/transfer.cxx | 2
svtools/source/svhtml/htmlkywd.cxx | 91 ++---
svtools/source/svhtml/htmlout.cxx | 66 +--
svtools/source/svhtml/parhtml.cxx | 95 ++---
svtools/source/svrtf/parrtf.cxx | 51 +-
svtools/source/svrtf/svparser.cxx | 2
svtools/source/table/gridtablerenderer.cxx | 2
svtools/source/uno/genericunodialog.cxx | 2
svtools/source/uno/statusbarcontroller.cxx | 2
svtools/source/uno/toolboxcontroller.cxx | 2
svtools/source/uno/unoiface.cxx | 36 --
svtools/source/uno/unoimap.cxx | 10
svtools/source/urlobj/inetimg.cxx | 34 -
sw/source/filter/html/htmlforw.cxx | 2
sw/source/filter/html/wrthtml.cxx | 2
sw/source/filter/html/wrthtml.hxx | 2
119 files changed, 1005 insertions(+), 1048 deletions(-)
New commits:
commit 7fb84f7dc2dc05688d6afdeb2fc6bd3ee3ac8ae8
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 21 17:44:11 2013 +0200
convert include/sfx2/titledockwin.hxx from String to OUString
Change-Id: Ifd4f1548ad98665288b2b2ea8f14fa0a7e3bd697
diff --git a/include/sfx2/titledockwin.hxx b/include/sfx2/titledockwin.hxx
index 09b500c..5712d32 100644
--- a/include/sfx2/titledockwin.hxx
+++ b/include/sfx2/titledockwin.hxx
@@ -50,7 +50,7 @@ namespace sfx2
/** sets a title to be displayed in the docking window
*/
- void SetTitle( const String& i_rTitle );
+ void SetTitle( const OUString& i_rTitle );
/** adds a drop down item to the toolbox. Usually, this is used to add some kind of menu to the toolbox.
@@ -63,7 +63,7 @@ namespace sfx2
@return
the ID of the newly created toolbox item
*/
- sal_uInt16 AddDropDownToolBoxItem( const String& i_rItemText, const OString& i_nHelpId, const Link& i_rCallback )
+ sal_uInt16 AddDropDownToolBoxItem( const OUString& i_rItemText, const OString& i_nHelpId, const Link& i_rCallback )
{
return impl_addDropDownToolBoxItem( i_rItemText, i_nHelpId, i_rCallback );
}
@@ -113,13 +113,13 @@ namespace sfx2
/** internal version of AddDropDownToolBoxItem
*/
- sal_uInt16 impl_addDropDownToolBoxItem( const String& i_rItemText, const OString& i_nHelpId, const Link& i_rCallback );
+ sal_uInt16 impl_addDropDownToolBoxItem( const OUString& i_rItemText, const OString& i_nHelpId, const Link& i_rCallback );
/** returns the current title.
If no title has been set via SetTitle, then the window text (Window::GetText) is returned.
*/
- String impl_getTitle() const;
+ OUString impl_getTitle() const;
private:
DECL_LINK( OnToolboxItemSelected, ToolBox* );
diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx
index a8cb0a1..6d33c39 100644
--- a/sfx2/source/dialog/titledockwin.cxx
+++ b/sfx2/source/dialog/titledockwin.cxx
@@ -81,7 +81,7 @@ namespace sfx2
}
//------------------------------------------------------------------------------------------------------------------
- void TitledDockingWindow::SetTitle( const String& i_rTitle )
+ void TitledDockingWindow::SetTitle( const OUString& i_rTitle )
{
m_sTitle = i_rTitle;
Invalidate();
@@ -220,7 +220,7 @@ namespace sfx2
}
//------------------------------------------------------------------------------------------------------------------
- String TitledDockingWindow::impl_getTitle() const
+ OUString TitledDockingWindow::impl_getTitle() const
{
return !m_sTitle.isEmpty() ? m_sTitle : GetText();
}
@@ -237,7 +237,7 @@ namespace sfx2
}
//------------------------------------------------------------------------------------------------------------------
- sal_uInt16 TitledDockingWindow::impl_addDropDownToolBoxItem( const String& i_rItemText, const OString& i_nHelpId, const Link& i_rCallback )
+ sal_uInt16 TitledDockingWindow::impl_addDropDownToolBoxItem( const OUString& i_rItemText, const OString& i_nHelpId, const Link& i_rCallback )
{
// Add the menu before the closer button.
const sal_uInt16 nItemCount( m_aToolbox.GetItemCount() );
commit 48ee66ae5e54d3afd85747edea0f0efa1abf2a79
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 21 17:30:24 2013 +0200
convert include/sfx2/tplpitem.hxx from String to OUString
Change-Id: Idcacda16e53c0abf55c59638951c5f58c0ece4aa
diff --git a/include/sfx2/tplpitem.hxx b/include/sfx2/tplpitem.hxx
index 58f0618..9327803 100644
--- a/include/sfx2/tplpitem.hxx
+++ b/include/sfx2/tplpitem.hxx
@@ -28,16 +28,16 @@
class SFX2_DLLPUBLIC SfxTemplateItem: public SfxFlagItem
{
- String aStyle;
+ OUString aStyle;
public:
TYPEINFO();
SfxTemplateItem();
SfxTemplateItem( sal_uInt16 nWhich,
- const String &rStyle,
+ const OUString &rStyle,
sal_uInt16 nMask = SFXSTYLEBIT_ALL );
SfxTemplateItem( const SfxTemplateItem& );
- const String& GetStyleName() const { return aStyle; }
+ const OUString& GetStyleName() const { return aStyle; }
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual int operator==( const SfxPoolItem& ) const;
diff --git a/sfx2/source/dialog/tplpitem.cxx b/sfx2/source/dialog/tplpitem.cxx
index 438ce08..b5c8dc6 100644
--- a/sfx2/source/dialog/tplpitem.cxx
+++ b/sfx2/source/dialog/tplpitem.cxx
@@ -35,7 +35,7 @@ SfxTemplateItem::SfxTemplateItem() :
SfxTemplateItem::SfxTemplateItem
(
sal_uInt16 nWhichId, // Slot-ID
- const String& rStyle, // Name of the current Styles
+ const OUString& rStyle, // Name of the current Styles
sal_uInt16 nValue // Flags for the filters of the automatic display
) : SfxFlagItem( nWhichId, nValue ),
aStyle( rStyle )
commit f83906c04ba7e2d2416c2c5504f13efe758afcdc
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 21 16:56:19 2013 +0200
convert include/sfx2/unoctitm.cxx from String to OUString
Change-Id: Ief905dc3f4a809bd84a48ed6754040886b30da09
diff --git a/include/sfx2/unoctitm.hxx b/include/sfx2/unoctitm.hxx
index 591f7bb..321de22 100644
--- a/include/sfx2/unoctitm.hxx
+++ b/include/sfx2/unoctitm.hxx
@@ -54,7 +54,7 @@ class SfxUnoControllerItem : public ::cppu::WeakImplHelper1< css::frame::XSta
public:
- SfxUnoControllerItem( SfxControllerItem*, SfxBindings&, const String& );
+ SfxUnoControllerItem( SfxControllerItem*, SfxBindings&, const OUString& );
~SfxUnoControllerItem();
const ::com::sun::star::util::URL& GetCommand() const
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index a8f1c8c..09c57b3 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -90,7 +90,7 @@ const char* URLTypeNames[URLType_COUNT] =
"double"
};
-SfxUnoControllerItem::SfxUnoControllerItem( SfxControllerItem *pItem, SfxBindings& rBind, const String& rCmd )
+SfxUnoControllerItem::SfxUnoControllerItem( SfxControllerItem *pItem, SfxBindings& rBind, const OUString& rCmd )
: pCtrlItem( pItem )
, pBindings( &rBind )
{
commit e27e53feea8822ee3ce10ee66a7ff0dbbbf5ee1a
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 21 16:39:39 2013 +0200
convert include/sfx2/viewfac.hxx from String to OUString
Change-Id: Ia0cea486e77e449f86cf21013dd193523868261f
diff --git a/include/sfx2/viewfac.hxx b/include/sfx2/viewfac.hxx
index 3348cb6..7ff4572 100644
--- a/include/sfx2/viewfac.hxx
+++ b/include/sfx2/viewfac.hxx
@@ -38,22 +38,22 @@ public:
sal_uInt16 nOrdinal, const sal_Char* asciiViewName );
SfxViewShell *CreateInstance(SfxViewFrame *pViewFrame, SfxViewShell *pOldSh);
- sal_uInt16 GetOrdinal() const { return nOrd; }
+ sal_uInt16 GetOrdinal() const { return nOrd; }
/// returns a legacy view name. This is "view" with an appended ordinal/ID.
- String GetLegacyViewName() const;
+ OUString GetLegacyViewName() const;
/** returns a API-compatible view name.
For details on which view names are specified, see the XModel2.getAvailableViewControllerNames
documentation.
*/
- String GetAPIViewName() const;
+ OUString GetAPIViewName() const;
private:
- SfxViewCtor fnCreate;
+ SfxViewCtor fnCreate;
sal_uInt16 nOrd;
- const String m_sViewName;
+ const OUString m_sViewName;
};
#endif
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index 932b1a9..5047195 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -149,7 +149,7 @@ void SfxObjectFactory::RegisterViewFactory
const String sViewName( rFactory.GetAPIViewName() );
for ( SfxViewFactoryArr_Impl::const_iterator it = pImpl->aViewFactoryArr.begin(); it != pImpl->aViewFactoryArr.end(); ++it )
{
- if ( !(*it)->GetAPIViewName().Equals( sViewName ) )
+ if ( (*it)->GetAPIViewName() != sViewName )
continue;
OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM(
"SfxObjectFactory::RegisterViewFactory: duplicate view name '"));
diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx
index 52e4180..a3e2f58 100644
--- a/sfx2/source/view/viewfac.cxx
+++ b/sfx2/source/view/viewfac.cxx
@@ -31,7 +31,7 @@ SfxViewShell *SfxViewFactory::CreateInstance(SfxViewFrame *pFrame, SfxViewShell
return (*fnCreate)(pFrame, pOldSh);
}
-String SfxViewFactory::GetLegacyViewName() const
+OUString SfxViewFactory::GetLegacyViewName() const
{
OUStringBuffer aViewName;
aViewName.appendAscii(RTL_CONSTASCII_STRINGPARAM("view"));
@@ -39,9 +39,9 @@ String SfxViewFactory::GetLegacyViewName() const
return aViewName.makeStringAndClear();
}
-String SfxViewFactory::GetAPIViewName() const
+OUString SfxViewFactory::GetAPIViewName() const
{
- if ( m_sViewName.Len() > 0 )
+ if ( !m_sViewName.isEmpty() )
return m_sViewName;
if ( GetOrdinal() == 0 )
commit b2a196a8a16e6d093dcbcaef471e5f6b41e33821
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 21 15:20:38 2013 +0200
convert include/sfx2/viewfrm.hxx from String to OUString
Change-Id: I0d8443b6c288449b74baa5d56593390ba3a9e419
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index 7c92eb4..7840b29 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -223,7 +223,7 @@ public:
SAL_DLLPRIVATE const Size& GetMargin_Impl() const;
SAL_DLLPRIVATE void SetActiveChildFrame_Impl( SfxViewFrame* );
SAL_DLLPRIVATE SfxViewFrame* GetActiveChildFrame_Impl() const;
- SAL_DLLPRIVATE String GetActualPresentationURL_Impl() const;
+ SAL_DLLPRIVATE OUString GetActualPresentationURL_Impl() const;
SAL_DLLPRIVATE void MiscExec_Impl(SfxRequest &);
SAL_DLLPRIVATE void MiscState_Impl(SfxItemSet &);
SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl( sal_uInt16 nId );
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index e1fcdc4..12be6d8 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2487,7 +2487,7 @@ sal_Bool SfxViewFrame::DoClose()
return GetFrame().DoClose();
}
-String SfxViewFrame::GetActualPresentationURL_Impl() const
+OUString SfxViewFrame::GetActualPresentationURL_Impl() const
{
if ( xObjSh.Is() )
return xObjSh->GetMedium()->GetName();
commit 59979e617c5717cf49272c6a8f580dede2866f25
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 21 14:02:39 2013 +0200
convert include/sfx2/viewsh.hxx from String to OUString
and de-virtual JumpToMark because no-one seems to be overriding it.
Change-Id: I35cf856d817f2685463ae5ef9f2ebc00e515fe3d
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 9b5f0bc..17ae07b 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -180,7 +180,7 @@ public:
virtual void UIActivating( SfxInPlaceClient* pClient );
virtual void UIDeactivated( SfxInPlaceClient* pClient );
- virtual void JumpToMark( const String& rMark );
+ void JumpToMark( const OUString& rMark );
void VisAreaChanged(const Rectangle& rRect);
// Misc
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 995a000..273fcb5 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1870,7 +1870,7 @@ SfxFrame* SfxViewShell::GetSmartSelf( SfxFrame* pSelf, SfxMedium& /*rMedium*/ )
//------------------------------------------------------------------------
-void SfxViewShell::JumpToMark( const String& rMark )
+void SfxViewShell::JumpToMark( const OUString& rMark )
{
SfxStringItem aMarkItem( SID_JUMPTOMARK, rMark );
GetViewFrame()->GetDispatcher()->Execute(
commit 5527d5c4e064f417c4cd5f868e9fafffaa5aab41
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 21 13:18:34 2013 +0200
convert drawinglayer module from String to OUString
Change-Id: I115dfd5ca7d343b220b2a3e8aa0565f9e4689042
diff --git a/drawinglayer/source/attribute/fontattribute.cxx b/drawinglayer/source/attribute/fontattribute.cxx
index 7f4316f..9f824ed 100644
--- a/drawinglayer/source/attribute/fontattribute.cxx
+++ b/drawinglayer/source/attribute/fontattribute.cxx
@@ -31,8 +31,8 @@ namespace drawinglayer
{
public:
/// core data
- String maFamilyName; // Font Family Name
- String maStyleName; // Font Style Name
+ OUString maFamilyName; // Font Family Name
+ OUString maStyleName; // Font Style Name
sal_uInt16 mnWeight; // Font weight
/// bitfield
@@ -45,8 +45,8 @@ namespace drawinglayer
unsigned mbMonospaced : 1;
ImpFontAttribute(
- const String& rFamilyName,
- const String& rStyleName,
+ const OUString& rFamilyName,
+ const OUString& rStyleName,
sal_uInt16 nWeight,
bool bSymbol,
bool bVertical,
@@ -83,8 +83,8 @@ namespace drawinglayer
}
// data read access
- const String& getFamilyName() const { return maFamilyName; }
- const String& getStyleName() const { return maStyleName; }
+ const OUString& getFamilyName() const { return maFamilyName; }
+ const OUString& getStyleName() const { return maStyleName; }
sal_uInt16 getWeight() const { return mnWeight; }
bool getSymbol() const { return mbSymbol; }
bool getVertical() const { return mbVertical; }
@@ -116,8 +116,8 @@ namespace drawinglayer
}
FontAttribute::FontAttribute(
- const String& rFamilyName,
- const String& rStyleName,
+ const OUString& rFamilyName,
+ const OUString& rStyleName,
sal_uInt16 nWeight,
bool bSymbol,
bool bVertical,
@@ -161,12 +161,12 @@ namespace drawinglayer
return rCandidate.mpFontAttribute == mpFontAttribute;
}
- const String& FontAttribute::getFamilyName() const
+ const OUString& FontAttribute::getFamilyName() const
{
return mpFontAttribute->getFamilyName();
}
- const String& FontAttribute::getStyleName() const
+ const OUString& FontAttribute::getStyleName() const
{
return mpFontAttribute->getStyleName();
}
diff --git a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
index 258ccec..d1b6b32 100644
--- a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
@@ -38,7 +38,7 @@ namespace drawinglayer
void TextDecoratedPortionPrimitive2D::impCreateGeometryContent(
std::vector< Primitive2DReference >& rTarget,
basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans,
- const String& rText,
+ const OUString& rText,
xub_StrLen aTextPosition,
xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray,
@@ -311,7 +311,7 @@ namespace drawinglayer
// TextSimplePortionPrimitive2D parameters
const basegfx::B2DHomMatrix& rNewTransform,
- const String& rText,
+ const OUString& rText,
xub_StrLen aTextPosition,
xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray,
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index 409f225..9fa8901 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -215,7 +215,7 @@ namespace drawinglayer
}
double TextLayouterDevice::getTextWidth(
- const String& rText,
+ const OUString& rText,
sal_uInt32 nIndex,
sal_uInt32 nLength) const
{
@@ -224,14 +224,14 @@ namespace drawinglayer
bool TextLayouterDevice::getTextOutlines(
basegfx::B2DPolyPolygonVector& rB2DPolyPolyVector,
- const String& rText,
+ const OUString& rText,
sal_uInt32 nIndex,
sal_uInt32 nLength,
const ::std::vector< double >& rDXArray) const
{
const sal_uInt32 nDXArrayCount(rDXArray.size());
sal_uInt32 nTextLength(nLength);
- const sal_uInt32 nStringLength(rText.Len());
+ const sal_uInt32 nStringLength(rText.getLength());
if(nTextLength + nIndex > nStringLength)
{
@@ -273,12 +273,12 @@ namespace drawinglayer
}
basegfx::B2DRange TextLayouterDevice::getTextBoundRect(
- const String& rText,
+ const OUString& rText,
sal_uInt32 nIndex,
sal_uInt32 nLength) const
{
sal_uInt32 nTextLength(nLength);
- const sal_uInt32 nStringLength(rText.Len());
+ const sal_uInt32 nStringLength(rText.getLength());
if(nTextLength + nIndex > nStringLength)
{
@@ -322,7 +322,7 @@ namespace drawinglayer
void TextLayouterDevice::addTextRectActions(
const Rectangle& rRectangle,
- const String& rText,
+ const OUString& rText,
sal_uInt16 nStyle,
GDIMetaFile& rGDIMetaFile) const
{
@@ -331,13 +331,13 @@ namespace drawinglayer
}
::std::vector< double > TextLayouterDevice::getTextArray(
- const String& rText,
+ const OUString& rText,
sal_uInt32 nIndex,
sal_uInt32 nLength) const
{
::std::vector< double > aRetval;
sal_uInt32 nTextLength(nLength);
- const sal_uInt32 nStringLength(rText.Len());
+ const sal_uInt32 nStringLength(rText.getLength());
if(nTextLength + nIndex > nStringLength)
{
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index 16f60f5..ae96188 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -220,7 +220,7 @@ namespace drawinglayer
TextSimplePortionPrimitive2D::TextSimplePortionPrimitive2D(
const basegfx::B2DHomMatrix& rNewTransform,
- const String& rText,
+ const OUString& rText,
xub_StrLen aTextPosition,
xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray,
@@ -243,7 +243,7 @@ namespace drawinglayer
mnWidthToFill(nWidthToFill)
{
#if OSL_DEBUG_LEVEL > 0
- const xub_StrLen aStringLength(getText().Len());
+ const sal_Int32 aStringLength(getText().getLength());
OSL_ENSURE(aStringLength >= getTextPosition() && aStringLength >= getTextPosition() + getTextLength(),
"TextSimplePortionPrimitive2D with text out of range (!)");
#endif
diff --git a/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx
index ce7ed37..956b8a0 100644
--- a/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx
@@ -89,7 +89,7 @@ namespace drawinglayer
const double fStrikeCharCount(fabs(getWidth()/fStrikeCharWidth));
const sal_uInt32 nStrikeCharCount(static_cast< sal_uInt32 >(fStrikeCharCount + 0.5));
std::vector<double> aDXArray(nStrikeCharCount);
- String aStrikeoutString;
+ OUString aStrikeoutString;
for(sal_uInt32 a(0); a < nStrikeCharCount; a++)
{
@@ -102,7 +102,7 @@ namespace drawinglayer
getObjectTransformation(),
aStrikeoutString,
0,
- aStrikeoutString.Len(),
+ aStrikeoutString.getLength(),
aDXArray,
getFontAttribute(),
getLocale(),
diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
index 0dbd56e..46ad65b 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
@@ -292,7 +292,7 @@ namespace drawinglayer
if(bDoSaveForVisualControl)
{
- SvFileStream aNew((const String&)String( "c:\\content.bmp" ), STREAM_WRITE|STREAM_TRUNC);
+ SvFileStream aNew( "c:\\content.bmp", STREAM_WRITE|STREAM_TRUNC);
WriteDIB(aContent, aNew, false, true);
}
@@ -303,7 +303,7 @@ namespace drawinglayer
if(bDoSaveForVisualControl)
{
- SvFileStream aNew((const String&)String( "c:\\transparence.bmp" ), STREAM_WRITE|STREAM_TRUNC);
+ SvFileStream aNew( "c:\\transparence.bmp", STREAM_WRITE|STREAM_TRUNC);
WriteDIB(aAlphaMask.GetBitmap(), aNew, false, true);
}
@@ -316,7 +316,7 @@ namespace drawinglayer
if(bDoSaveForVisualControl)
{
- SvFileStream aNew((const String&)String( "c:\\mask.bmp" ), STREAM_WRITE|STREAM_TRUNC);
+ SvFileStream aNew( "c:\\mask.bmp", STREAM_WRITE|STREAM_TRUNC);
WriteDIB(aMask, aNew, false, true);
}
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 3eb8001..1666149 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -274,7 +274,7 @@ namespace drawinglayer
mpOutputDevice->SetFont(aFont);
mpOutputDevice->SetTextColor(Color(aRGBFontColor));
- String aText( rTextCandidate.getText() );
+ OUString aText( rTextCandidate.getText() );
xub_StrLen nPos = rTextCandidate.getTextPosition();
xub_StrLen nLen = rTextCandidate.getTextLength();
@@ -295,7 +295,7 @@ namespace drawinglayer
nChars = nWidthToFill / nWidth;
OUStringBuffer aFilled;
- comphelper::string::padToLength(aFilled, (sal_uInt16)nChars, aText.GetChar(0));
+ comphelper::string::padToLength(aFilled, (sal_uInt16)nChars, aText[0]);
aText = aFilled.makeStringAndClear();
nPos = 0;
nLen = nChars;
diff --git a/include/drawinglayer/attribute/fontattribute.hxx b/include/drawinglayer/attribute/fontattribute.hxx
index b49ab83..dda163f 100644
--- a/include/drawinglayer/attribute/fontattribute.hxx
+++ b/include/drawinglayer/attribute/fontattribute.hxx
@@ -26,7 +26,9 @@
//////////////////////////////////////////////////////////////////////////////
// predefines
-class String;
+namespace rtl {
+ class OUString;
+}
namespace drawinglayer { namespace attribute {
class ImpFontAttribute;
@@ -55,8 +57,8 @@ namespace drawinglayer
/// constructors/assignmentoperator/destructor
/// TODO: pair kerning and CJK kerning
FontAttribute(
- const String& rFamilyName,
- const String& rStyleName,
+ const rtl::OUString& rFamilyName,
+ const rtl::OUString& rStyleName,
sal_uInt16 nWeight,
bool bSymbol = false,
bool bVertical = false,
@@ -77,8 +79,8 @@ namespace drawinglayer
bool operator==(const FontAttribute& rCandidate) const;
/// data read access
- const String& getFamilyName() const;
- const String& getStyleName() const;
+ const rtl::OUString& getFamilyName() const;
+ const rtl::OUString& getStyleName() const;
sal_uInt16 getWeight() const;
bool getSymbol() const;
bool getVertical() const;
diff --git a/include/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx b/include/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
index a469f80..5756784 100644
--- a/include/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
@@ -72,7 +72,7 @@ namespace drawinglayer
void impCreateGeometryContent(
std::vector< Primitive2DReference >& rTarget,
basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans,
- const String& rText,
+ const OUString& rText,
xub_StrLen aTextPosition,
xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray,
@@ -88,7 +88,7 @@ namespace drawinglayer
/// TextSimplePortionPrimitive2D parameters
const basegfx::B2DHomMatrix& rNewTransform,
- const String& rText,
+ const OUString& rText,
xub_StrLen aTextPosition,
xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray,
diff --git a/include/drawinglayer/primitive2d/textlayoutdevice.hxx b/include/drawinglayer/primitive2d/textlayoutdevice.hxx
index a0338a3..90ffb17 100644
--- a/include/drawinglayer/primitive2d/textlayoutdevice.hxx
+++ b/include/drawinglayer/primitive2d/textlayoutdevice.hxx
@@ -33,7 +33,9 @@
// predefines
class VirtualDevice;
class Font;
-class String;
+namespace rtl {
+ class OUString;
+};
class OutputDevice;
class GDIMetaFile;
@@ -81,19 +83,19 @@ namespace drawinglayer
double getStrikeoutOffset() const;
double getTextWidth(
- const String& rText,
+ const rtl::OUString& rText,
sal_uInt32 nIndex,
sal_uInt32 nLength) const;
bool getTextOutlines(
basegfx::B2DPolyPolygonVector&,
- const String& rText,
+ const rtl::OUString& rText,
sal_uInt32 nIndex,
sal_uInt32 nLength,
const ::std::vector< double >& rDXArray) const;
basegfx::B2DRange getTextBoundRect(
- const String& rText,
+ const rtl::OUString& rText,
sal_uInt32 nIndex,
sal_uInt32 nLength) const;
@@ -102,12 +104,12 @@ namespace drawinglayer
void addTextRectActions(
const Rectangle& rRectangle,
- const String& rText,
+ const rtl::OUString& rText,
sal_uInt16 nStyle,
GDIMetaFile& rGDIMetaFile) const;
::std::vector< double > getTextArray(
- const String& rText,
+ const rtl::OUString& rText,
sal_uInt32 nIndex,
sal_uInt32 nLength) const;
};
diff --git a/include/drawinglayer/primitive2d/textprimitive2d.hxx b/include/drawinglayer/primitive2d/textprimitive2d.hxx
index b0c28c8..e38086f 100644
--- a/include/drawinglayer/primitive2d/textprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/textprimitive2d.hxx
@@ -97,7 +97,7 @@ namespace drawinglayer
basegfx::B2DHomMatrix maTextTransform;
/// The text, used from maTextPosition up to maTextPosition + maTextLength
- String maText;
+ OUString maText;
/// The index from where on maText is used
xub_StrLen maTextPosition;
@@ -130,7 +130,7 @@ namespace drawinglayer
/// constructor
TextSimplePortionPrimitive2D(
const basegfx::B2DHomMatrix& rNewTransform,
- const String& rText,
+ const OUString& rText,
xub_StrLen aTextPosition,
xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray,
@@ -148,7 +148,7 @@ namespace drawinglayer
/// data read access
const basegfx::B2DHomMatrix& getTextTransform() const { return maTextTransform; }
- const String& getText() const { return maText; }
+ const OUString& getText() const { return maText; }
xub_StrLen getTextPosition() const { return maTextPosition; }
xub_StrLen getTextLength() const { return maTextLength; }
const ::std::vector< double >& getDXArray() const { return maDXArray; }
commit 3728952b56e0690f09ed375e683ff09bc3fbff71
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 21 11:33:46 2013 +0200
convert svtools/source/contnr/* from String to OUString
Change-Id: I51ad001473a83eb336f6b00fd989b9e6b2f73ec5
diff --git a/svtools/source/config/fontsubstconfig.cxx b/svtools/source/config/fontsubstconfig.cxx
index d0c9399..2f55f5d 100644
--- a/svtools/source/config/fontsubstconfig.cxx
+++ b/svtools/source/config/fontsubstconfig.cxx
@@ -189,7 +189,7 @@ void SvtFontSubstConfig::Apply()
nFlags |= FONT_SUBSTITUTE_ALWAYS;
if(pSubs->bReplaceOnScreenOnly)
nFlags |= FONT_SUBSTITUTE_SCREENONLY;
- OutputDevice::AddFontSubstitute( String(pSubs->sFont), String(pSubs->sReplaceBy), nFlags );
+ OutputDevice::AddFontSubstitute( pSubs->sFont, pSubs->sReplaceBy, nFlags );
}
OutputDevice::EndFontSubstitution();
diff --git a/svtools/source/contnr/contentenumeration.cxx b/svtools/source/contnr/contentenumeration.cxx
index 081a7a6..49b935f 100644
--- a/svtools/source/contnr/contentenumeration.cxx
+++ b/svtools/source/contnr/contentenumeration.cxx
@@ -107,7 +107,7 @@ namespace svt
m_pResultHandler = NULL;
m_pTranslator = NULL;
m_aFolder.aContent = ::ucbhelper::Content();
- m_aFolder.sURL = String();
+ m_aFolder.sURL = "";
}
//--------------------------------------------------------------------
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx
index c04a8c0..3b2874c 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -420,8 +420,8 @@ OUString SvTabListBox::GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const
{
if ( nCol == 0 )
{
- String sRet = static_cast<const SvLBoxString*>(pStr)->GetText();
- if ( sRet.Len() == 0 )
+ OUString sRet = static_cast<const SvLBoxString*>(pStr)->GetText();
+ if ( sRet.isEmpty() )
sRet = SVT_RESSTR( STR_SVT_ACC_EMPTY_FIELD );
return sRet;
}
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index cd6112b..b942469 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -1064,12 +1064,12 @@ IMPL_LINK_NOARG(SvTreeListBox, TextEditEndedHdl_Impl)
if ( nImpFlags & SVLBOX_EDTEND_CALLED ) // avoid nesting
return 0;
nImpFlags |= SVLBOX_EDTEND_CALLED;
- String aStr;
+ OUString aStr;
if ( !pEdCtrl->EditingCanceled() )
aStr = pEdCtrl->GetText();
else
aStr = pEdCtrl->GetSavedValue();
- if ( IsEmptyTextAllowed() || aStr.Len() > 0 )
+ if ( IsEmptyTextAllowed() || !aStr.isEmpty() )
EditedText( aStr );
// Hide may only be called after the new text was put into the entry, so
// that we don't call the selection handler in the GetFocus of the listbox
@@ -1781,7 +1781,7 @@ OUString SvTreeListBox::SearchEntryText( SvTreeListEntry* pEntry ) const
{
DBG_CHKTHIS(SvTreeListBox,0);
DBG_ASSERT( pEntry, "SvTreeListBox::SearchEntryText(): no entry" );
- String sRet;
+ OUString sRet;
sal_uInt16 nCount = pEntry->ItemCount();
sal_uInt16 nCur = 0;
SvLBoxItem* pItem;
@@ -3683,8 +3683,8 @@ IMPL_LINK( SvTreeListBox, DefaultCompare, SvSortData*, pData )
{
const SvTreeListEntry* pLeft = pData->pLeft;
const SvTreeListEntry* pRight = pData->pRight;
- String aLeft( ((SvLBoxString*)(pLeft->GetFirstItem(SV_ITEM_ID_LBOXSTRING)))->GetText());
- String aRight( ((SvLBoxString*)(pRight->GetFirstItem(SV_ITEM_ID_LBOXSTRING)))->GetText());
+ OUString aLeft( ((SvLBoxString*)(pLeft->GetFirstItem(SV_ITEM_ID_LBOXSTRING)))->GetText());
+ OUString aRight( ((SvLBoxString*)(pRight->GetFirstItem(SV_ITEM_ID_LBOXSTRING)))->GetText());
pImp->UpdateStringSorter();
return pImp->m_pStringSorter->compare(aLeft, aRight);
}
commit 23cafe3f1d619f715efc421de8abc0403a84f6b4
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 21 11:13:04 2013 +0200
convert svtools/source/control/* from String to OUString
Change-Id: I32e411801d3754ca635cfc3ed9529b8ea43ffa3c
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index d7c1993..c826640 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -403,7 +403,7 @@ void Calendar::ImplFormat()
for ( sal_Int16 nDayOfWeek = 0; nDayOfWeek < 7; nDayOfWeek++ )
{
// Use narrow name.
- String aDayOfWeek( maCalendarWrapper.getDisplayName(
+ OUString aDayOfWeek( maCalendarWrapper.getDisplayName(
i18n::CalendarDisplayIndex::DAY, nDay, 2));
long nOffX = (mnDayWidth-GetTextWidth( aDayOfWeek ))/2;
if ( mnWinStyle & WB_BOLDTEXT )
@@ -883,9 +883,9 @@ void Calendar::ImplDraw( sal_Bool bPaint )
// Monat in der Titleleiste ausgeben
nDeltaX = nX;
nDeltaY = nY+TITLE_BORDERY;
- String aMonthText( maCalendarWrapper.getDisplayName(
+ OUString aMonthText( maCalendarWrapper.getDisplayName(
i18n::CalendarDisplayIndex::MONTH, nMonth-1, 1));
- aMonthText += ' ';
+ aMonthText += " ";
aMonthText += OUString::number(nYear);
long nMonthTextWidth = GetTextWidth( aMonthText );
long nMonthOffX1 = 0;
@@ -903,7 +903,7 @@ void Calendar::ImplDraw( sal_Bool bPaint )
// Abbreviated month name.
aMonthText = maCalendarWrapper.getDisplayName(
i18n::CalendarDisplayIndex::MONTH, nMonth-1, 0);
- aMonthText += ' ';
+ aMonthText += " ";
aMonthText += OUString::number(nYear);
nMonthTextWidth = GetTextWidth( aMonthText );
}
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 743d065..cefcc03 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -1810,7 +1810,7 @@ void FontSizeBox::Fill( const FontInfo* pInfo, const FontList* pList )
sal_uLong nCount = aFontSizeNames.Count();
for( sal_uLong i = 0; i < nCount; i++ )
{
- String aSizeName = aFontSizeNames.GetIndexName( i );
+ OUString aSizeName = aFontSizeNames.GetIndexName( i );
sal_IntPtr nSize = aFontSizeNames.GetIndexSize( i );
ComboBox::InsertEntry( aSizeName, nPos );
ComboBox::SetEntryData( nPos, (void*)(-nSize) ); // mark as special
@@ -1823,8 +1823,8 @@ void FontSizeBox::Fill( const FontInfo* pInfo, const FontList* pList )
pTempAry = pAry;
while ( *pTempAry )
{
- String aSizeName = aFontSizeNames.Size2Name( *pTempAry );
- if ( aSizeName.Len() )
+ OUString aSizeName = aFontSizeNames.Size2Name( *pTempAry );
+ if ( !aSizeName.isEmpty() )
{
ComboBox::InsertEntry( aSizeName, nPos );
ComboBox::SetEntryData( nPos, (void*)(-(*pTempAry)) ); // mark as special
@@ -1955,8 +1955,8 @@ void FontSizeBox::SetValue( sal_Int64 nNewValue, FieldUnit eInUnit )
FontSizeNames aFontSizeNames( GetSettings().GetUILanguageTag().getLanguageType() );
// conversion loses precision; however font sizes should
// never have a problem with that
- String aName = aFontSizeNames.Size2Name( static_cast<long>(nTempValue) );
- if ( aName.Len() && (GetEntryPos( aName ) != LISTBOX_ENTRY_NOTFOUND) )
+ OUString aName = aFontSizeNames.Size2Name( static_cast<long>(nTempValue) );
+ if ( !aName.isEmpty() && (GetEntryPos( aName ) != LISTBOX_ENTRY_NOTFOUND) )
{
mnLastValue = nTempValue;
SetText( aName );
diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx
index 5adcc8d..af0f2f9 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -896,7 +896,7 @@ long FontSizeNames::Name2Size( const OUString& rName ) const
OUString FontSizeNames::Size2Name( long nValue ) const
{
- String aStr;
+ OUString aStr;
// binary search
for( long lower = 0, upper = mnElem - 1; lower <= upper; )
@@ -904,7 +904,7 @@ OUString FontSizeNames::Size2Name( long nValue ) const
long mid = (upper + lower) >> 1;
if ( nValue == mpArray[mid].mnSize )
{
- aStr = String( mpArray[mid].mszUtf8Name, RTL_TEXTENCODING_UTF8 );
+ aStr = OUString( mpArray[mid].mszUtf8Name, strlen(mpArray[mid].mszUtf8Name), RTL_TEXTENCODING_UTF8 );
break;
}
else if ( nValue < mpArray[mid].mnSize )
@@ -920,10 +920,10 @@ OUString FontSizeNames::Size2Name( long nValue ) const
OUString FontSizeNames::GetIndexName( sal_uLong nIndex ) const
{
- String aStr;
+ OUString aStr;
if ( nIndex < mnElem )
- aStr = String( mpArray[nIndex].mszUtf8Name, RTL_TEXTENCODING_UTF8 );
+ aStr = OUString( mpArray[nIndex].mszUtf8Name, strlen(mpArray[nIndex].mszUtf8Name), RTL_TEXTENCODING_UTF8 );
return aStr;
}
diff --git a/svtools/source/control/fileurlbox.cxx b/svtools/source/control/fileurlbox.cxx
index f62dae2..b027922 100644
--- a/svtools/source/control/fileurlbox.cxx
+++ b/svtools/source/control/fileurlbox.cxx
@@ -39,10 +39,10 @@ namespace svt
//---------------------------------------------------------------------
void FileURLBox::DisplayURL( const OUString& _rURL )
{
- String sOldText = GetText();
+ OUString sOldText = GetText();
OFileNotation aTransformer( _rURL, OFileNotation::N_URL );
- String sNewText = aTransformer.get( OFileNotation::N_SYSTEM );
+ OUString sNewText = aTransformer.get( OFileNotation::N_SYSTEM );
SetText( sNewText );
if ( sOldText != sNewText )
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
index 515e32e..f897d91 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -81,10 +81,10 @@ namespace validation
public:
NumberValidator( const sal_Unicode _cThSep, const sal_Unicode _cDecSep );
- sal_Bool isValidNumericFragment( const String& _rText );
+ sal_Bool isValidNumericFragment( const OUString& _rText );
private:
- sal_Bool implValidateNormalized( const String& _rText );
+ sal_Bool implValidateNormalized( const OUString& _rText );
};
//--------------------------------------------------------------------------
@@ -219,9 +219,9 @@ namespace validation
}
//--------------------------------------------------------------------------
- sal_Bool NumberValidator::implValidateNormalized( const String& _rText )
+ sal_Bool NumberValidator::implValidateNormalized( const OUString& _rText )
{
- const sal_Unicode* pCheckPos = _rText.GetBuffer();
+ const sal_Unicode* pCheckPos = _rText.getStr();
State eCurrentState = START;
while ( END != eCurrentState )
@@ -259,16 +259,16 @@ namespace validation
}
//--------------------------------------------------------------------------
- sal_Bool NumberValidator::isValidNumericFragment( const String& _rText )
+ sal_Bool NumberValidator::isValidNumericFragment( const OUString& _rText )
{
- if ( !_rText.Len() )
+ if ( _rText.isEmpty() )
// empty strings are always allowed
return sal_True;
// normalize the string
- String sNormalized( RTL_CONSTASCII_USTRINGPARAM("_") );
- sNormalized.Append( _rText );
- sNormalized.AppendAscii( "_" );
+ OUString sNormalized( "_" );
+ sNormalized += _rText;
+ sNormalized += "_";
return implValidateNormalized( sNormalized );
}
@@ -499,7 +499,7 @@ void FormattedField::impl_Modify(bool makeValueDirty)
return;
}
- String sCheck = GetText();
+ OUString sCheck = GetText();
if (CheckText(sCheck))
{
m_sLastValidText = sCheck;
@@ -879,8 +879,8 @@ long FormattedField::Notify(NotifyEvent& rNEvt)
}
else
{
- String sNew = GetTextValue();
- if (sNew.Len())
+ OUString sNew = GetTextValue();
+ if (!sNew.isEmpty())
SetTextFormatted(sNew);
else
SetTextFormatted(m_sDefaultText);
@@ -996,8 +996,8 @@ sal_Bool FormattedField::ImplGetValue(double& dNewVal)
return sal_True;
dNewVal = m_dDefaultValue;
- String sText(GetText());
- if (!sText.Len())
+ OUString sText(GetText());
+ if (sText.isEmpty())
return sal_True;
DBG_ASSERT(ImplGetFormatter() != NULL, "FormattedField::ImplGetValue : can't give you a current value without a formatter !");
@@ -1022,7 +1022,7 @@ sal_Bool FormattedField::ImplGetValue(double& dNewVal)
NUMBERFORMAT_NUMBER == m_pFormatter->GetType(nTempFormat))
// der String entspricht einer Number-Formatierung, hat also nur kein %
// -> append it
- sText += '%';
+ sText += "%";
// (with this, a input of '3' becomes '3%', which then by the formatter is translated
// into 0.03. Without this, the formatter would give us the double 3 for an input '3',
// which equals 300 percent.
@@ -1161,13 +1161,13 @@ void DoubleNumericField::ResetConformanceTester()
{
LocaleDataWrapper aLocaleInfo( LanguageTag( pFormatEntry->GetLanguage()) );
- String sSeparator = aLocaleInfo.getNumThousandSep();
- if (sSeparator.Len())
- cSeparatorThousand = sSeparator.GetBuffer()[0];
+ OUString sSeparator = aLocaleInfo.getNumThousandSep();
+ if (!sSeparator.isEmpty())
+ cSeparatorThousand = sSeparator[0];
sSeparator = aLocaleInfo.getNumDecimalSep();
- if (sSeparator.Len())
- cSeparatorDecimal = sSeparator.GetBuffer()[0];
+ if (!sSeparator.isEmpty())
+ cSeparatorDecimal = sSeparator[0];
}
delete m_pNumberValidator;
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index f1ce85d..4b9783e 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -97,8 +97,8 @@ class SvtMatchContext_Impl: public salhelper::Thread
std::vector<OUString> aCompletions;
std::vector<OUString> aURLs;
svtools::AsynchronLink aLink;
- String aBaseURL;
- String aText;
+ OUString aBaseURL;
+ OUString aText;
SvtURLBox* pBox;
sal_Bool bOnlyDirectories;
sal_Bool bNoSelection;
@@ -113,12 +113,12 @@ class SvtMatchContext_Impl: public salhelper::Thread
virtual ~SvtMatchContext_Impl();
virtual void execute();
void doExecute();
- void Insert( const String& rCompletion, const String& rURL, sal_Bool bForce = sal_False);
- void ReadFolder( const String& rURL, const String& rMatch, sal_Bool bSmart );
+ void Insert( const OUString& rCompletion, const OUString& rURL, sal_Bool bForce = sal_False);
+ void ReadFolder( const OUString& rURL, const OUString& rMatch, sal_Bool bSmart );
void FillPicklist(std::vector<OUString>& rPickList);
public:
- SvtMatchContext_Impl( SvtURLBox* pBoxP, const String& rText );
+ SvtMatchContext_Impl( SvtURLBox* pBoxP, const OUString& rText );
void Stop();
};
@@ -129,7 +129,7 @@ namespace
}
SvtMatchContext_Impl::SvtMatchContext_Impl(
- SvtURLBox* pBoxP, const String& rText )
+ SvtURLBox* pBoxP, const OUString& rText )
: Thread( "SvtMatchContext_Impl" )
, aLink( STATIC_LINK( this, SvtMatchContext_Impl, Select_Impl ) )
, aBaseURL( pBoxP->aBaseURL )
@@ -232,7 +232,7 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, )
for(std::vector<OUString>::iterator i = pThis->aCompletions.begin(); i != pThis->aCompletions.end(); ++i)
{
- String sCompletion(*i);
+ OUString sCompletion(*i);
// convert the file into an URL
OUString sURL( sCompletion );
@@ -242,8 +242,7 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, )
if ( !sURL.isEmpty() && ( sURL[sURL.getLength()-1] != '/' ))
{
- String sUpperURL( sURL );
- sUpperURL.ToUpperAscii();
+ OUString sUpperURL( sURL.toAsciiUpperCase() );
::std::vector< WildCard >::const_iterator aMatchingFilter =
::std::find_if(
@@ -265,9 +264,9 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, )
if( !pThis->bNoSelection && !pThis->aCompletions.empty() && !bValidCompletionsFiltered )
{
// select the first one
- String aTmp( pBox->GetEntry(0) );
+ OUString aTmp( pBox->GetEntry(0) );
pBox->SetText( aTmp );
- pBox->SetSelection( Selection( pThis->aText.Len(), aTmp.Len() ) );
+ pBox->SetSelection( Selection( pThis->aText.getLength(), aTmp.getLength() ) );
}
// transfer string lists to listbox and forget them
@@ -287,8 +286,8 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, )
}
//-------------------------------------------------------------------------
-void SvtMatchContext_Impl::Insert( const String& rCompletion,
- const String& rURL,
+void SvtMatchContext_Impl::Insert( const OUString& rCompletion,
+ const OUString& rURL,
sal_Bool bForce )
{
if( !bForce )
@@ -303,8 +302,8 @@ void SvtMatchContext_Impl::Insert( const String& rCompletion,
}
//-------------------------------------------------------------------------
-void SvtMatchContext_Impl::ReadFolder( const String& rURL,
- const String& rMatch,
+void SvtMatchContext_Impl::ReadFolder( const OUString& rURL,
+ const OUString& rMatch,
sal_Bool bSmart )
{
// check folder to scan
@@ -313,23 +312,23 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL,
sal_Bool bPureHomePath = sal_False;
#ifdef UNX
- bPureHomePath = aText.Search( '~' ) == 0 && aText.Search( '/' ) == STRING_NOTFOUND;
+ bPureHomePath = aText.indexOf( '~' ) == 0 && aText.indexOf( '/' ) == -1;
#endif
sal_Bool bExectMatch = bPureHomePath
- || aText.CompareToAscii( "." ) == COMPARE_EQUAL
- || (aText.Len() > 1 && aText.Copy( aText.Len() - 2, 2 ).CompareToAscii( "/." ) == COMPARE_EQUAL)
- || (aText.Len() > 2 && aText.Copy( aText.Len() - 3, 3 ).CompareToAscii( "/.." ) == COMPARE_EQUAL);
+ || aText.compareTo( "." ) == 0
+ || (aText.getLength() > 1 && aText.copy( aText.getLength() - 2, 2 ).compareTo( "/." ) == 0)
+ || (aText.getLength() > 2 && aText.copy( aText.getLength() - 3, 3 ).compareTo( "/.." ) == 0);
// for pure home paths ( ~username ) the '.' at the end of rMatch
// means that it poits to root catalog
// this is done only for file contents since home paths parsing is useful only for them
- if ( bPureHomePath && rMatch.Equals( OUString("file:///.") ) )
+ if ( bPureHomePath && rMatch == "file:///." )
{
// a home that refers to /
- String aNewText( aText );
- aNewText += '/';
+ OUString aNewText( aText );
+ aNewText += "/";
Insert( aNewText, rURL, sal_True );
return;
@@ -337,21 +336,21 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL,
// string to match with
INetURLObject aMatchObj( rMatch );
- String aMatchName;
+ OUString aMatchName;
- if ( rURL != String(aMatchObj.GetMainURL( INetURLObject::NO_DECODE ) ))
+ if ( rURL != aMatchObj.GetMainURL( INetURLObject::NO_DECODE ) )
{
aMatchName = aMatchObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
// matching is always done case insensitive, but completion will be case sensitive and case preserving
- aMatchName.ToLowerAscii();
+ aMatchName = aMatchName.toAsciiLowerCase();
// if the matchstring ends with a slash, we must search for this also
- if ( rMatch.GetChar(rMatch.Len()-1) == '/' )
- aMatchName += '/';
+ if ( rMatch[ rMatch.getLength()-1 ] == '/' )
+ aMatchName += "/";
}
- xub_StrLen nMatchLen = aMatchName.Len();
+ xub_StrLen nMatchLen = aMatchName.getLength();
INetURLObject aFolderObj( rURL );
DBG_ASSERT( aFolderObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" );
@@ -408,17 +407,17 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL,
{
while ( schedule() && xResultSet->next() )
{
- String aURL = xContentAccess->queryContentIdentifierString();
- String aTitle = xRow->getString(1);
- sal_Bool bIsFolder = xRow->getBoolean(2);
+ OUString aURL = xContentAccess->queryContentIdentifierString();
+ OUString aTitle = xRow->getString(1);
+ sal_Bool bIsFolder = xRow->getBoolean(2);
// matching is always done case insensitive, but completion will be case sensitive and case preserving
- aTitle.ToLowerAscii();
+ aTitle = aTitle.toAsciiLowerCase();
if (
!nMatchLen ||
- (bExectMatch && aMatchName.Equals(aTitle)) ||
- (!bExectMatch && aMatchName.CompareTo(aTitle, nMatchLen) == COMPARE_EQUAL)
+ (bExectMatch && aMatchName == aTitle) ||
+ (!bExectMatch && aMatchName.compareTo(aTitle, nMatchLen) == 0)
)
{
// all names fit if matchstring is empty
@@ -432,20 +431,20 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL,
aObj.setFinalSlash();
// get the last name of the URL
- String aMatch = aObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
- String aInput( aText );
+ OUString aMatch = aObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
+ OUString aInput( aText );
if ( nMatchLen )
{
- if ((aText.Len() && aText.GetChar(aText.Len() - 1) == '.') || bPureHomePath)
+ if ((aText.getLength() && aText[ aText.getLength() - 1 ] == '.') || bPureHomePath)
{
// if a "special folder" URL was typed, don't touch the user input
- aMatch.Erase( 0, nMatchLen );
+ aMatch = aMatch.copy( nMatchLen );
}
else
{
// make the user input case preserving
- DBG_ASSERT( aInput.Len() >= nMatchLen, "Suspicious Matching!" );
- aInput.Erase( aInput.Len() - nMatchLen );
+ DBG_ASSERT( aInput.getLength() >= nMatchLen, "Suspicious Matching!" );
+ aInput = aInput.copy( 0, aInput.getLength() - nMatchLen );
}
}
@@ -453,7 +452,7 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL,
// folders should get a final slash automatically
if ( bIsFolder )
- aInput += aDelimiter;
+ aInput += OUString(aDelimiter);
Insert( aInput, aObj.GetMainURL( INetURLObject::NO_DECODE ), sal_True );
}
@@ -472,7 +471,7 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL,
//-------------------------------------------------------------------------
OUString SvtURLBox::ParseSmart( OUString aText, OUString aBaseURL, const OUString& aWorkDir )
{
- String aMatch;
+ OUString aMatch;
// parse ~ for Unix systems
// does nothing for Windows
@@ -488,10 +487,10 @@ OUString SvtURLBox::ParseSmart( OUString aText, OUString aBaseURL, const OUStrin
if( aText.indexOf( '/' ) == 0 )
{
// text starting with slashes means absolute file URLs
- String aTemp = INetURLObject::GetScheme( eBaseProt );
+ OUString aTemp = INetURLObject::GetScheme( eBaseProt );
// file URL must be correctly encoded!
- String aTextURL = INetURLObject::encode( aText, INetURLObject::PART_FPATH,
+ OUString aTextURL = INetURLObject::encode( aText, INetURLObject::PART_FPATH,
'%', INetURLObject::ENCODE_ALL );
aTemp += aTextURL;
@@ -512,9 +511,9 @@ OUString SvtURLBox::ParseSmart( OUString aText, OUString aBaseURL, const OUStrin
if( aText.indexOf( '\\' ) == 0 && (aText.getLength() < 2 || aText[ 1 ] != '\\') )
{
// cut to first segment
- String aTmp = INetURLObject::GetScheme( eBaseProt );
+ OUString aTmp = INetURLObject::GetScheme( eBaseProt );
aTmp += '/';
- aTmp += String(aObj.getName( 0, true, INetURLObject::DECODE_WITH_CHARSET ));
+ aTmp += aObj.getName( 0, true, INetURLObject::DECODE_WITH_CHARSET );
aObj.SetURL( aTmp );
aSmart = aSmart.copy(1);
@@ -571,19 +570,19 @@ void SvtMatchContext_Impl::doExecute()
aURLs.clear();
// check for input
- sal_uInt16 nTextLen = aText.Len();
+ sal_uInt16 nTextLen = aText.getLength();
if ( !nTextLen )
return;
- if( aText.Search( '*' ) != STRING_NOTFOUND || aText.Search( '?' ) != STRING_NOTFOUND )
+ if( aText.indexOf( '*' ) != -1 || aText.indexOf( '?' ) != -1 )
// no autocompletion for wildcards
return;
- String aMatch;
- String aWorkDir( SvtPathOptions().GetWorkPath() );
+ OUString aMatch;
+ OUString aWorkDir( SvtPathOptions().GetWorkPath() );
INetProtocol eProt = INetURLObject::CompareProtocolScheme( aText );
INetProtocol eBaseProt = INetURLObject::CompareProtocolScheme( aBaseURL );
- if ( !aBaseURL.Len() )
+ if ( aBaseURL.isEmpty() )
eBaseProt = INetURLObject::CompareProtocolScheme( aWorkDir );
INetProtocol eSmartProt = pBox->GetSmartProtocol();
@@ -599,17 +598,17 @@ void SvtMatchContext_Impl::doExecute()
aMatch = SvtURLBox::ParseSmart( aText, aBaseURL, aWorkDir );
else
aMatch = aText;
- if ( aMatch.Len() )
+ if ( !aMatch.isEmpty() )
{
INetURLObject aURLObject( aMatch );
- String aMainURL( aURLObject.GetMainURL( INetURLObject::NO_DECODE ) );
+ OUString aMainURL( aURLObject.GetMainURL( INetURLObject::NO_DECODE ) );
// Disable autocompletion for anything but the (local) file
// system (for which access is hopefully fast), as the logic of
// how SvtMatchContext_Impl is used requires this code to run to
// completion before further user input is processed, and even
// SvtMatchContext_Impl::Stop does not guarantee a speedy
// return:
- if ( aMainURL.Len()
+ if ( !aMainURL.isEmpty()
&& aURLObject.GetProtocol() == INET_PROT_FILE )
{
// if text input is a directory, it must be part of the match list! Until then it is scanned
@@ -707,7 +706,7 @@ void SvtMatchContext_Impl::doExecute()
sal_Bool bFull = sal_False;
INetURLObject aCurObj;
- String aEmpty, aCurString, aCurMainURL;
+ OUString aEmpty, aCurString, aCurMainURL;
INetURLObject aObj;
aObj.SetSmartProtocol( eSmartProt == INET_PROT_NOT_VALID ? INET_PROT_HTTP : eSmartProt );
for( ;; )
@@ -741,8 +740,8 @@ void SvtMatchContext_Impl::doExecute()
if( eProt == INET_PROT_NOT_VALID )
{
// try if text matches the scheme
- String aScheme( INetURLObject::GetScheme( aCurObj.GetProtocol() ) );
- if ( aText.CompareIgnoreCaseToAscii( aScheme, aText.Len() ) == COMPARE_EQUAL && aText.Len() < aScheme.Len() )
+ OUString aScheme( INetURLObject::GetScheme( aCurObj.GetProtocol() ) );
+ if ( aScheme.startsWithIgnoreAsciiCase( aText ) && aText.getLength() < aScheme.getLength() )
{
if( bFull )
aMatch = aCurObj.GetMainURL( INetURLObject::NO_DECODE );
@@ -758,10 +757,10 @@ void SvtMatchContext_Impl::doExecute()
}
// now try smart matching
- aCurString.Erase( 0, aScheme.Len() );
+ aCurString = aCurString.copy( aScheme.getLength() );
}
- if( aText.CompareIgnoreCaseToAscii( aCurString, aText.Len() )== COMPARE_EQUAL )
+ if( aCurString.startsWithIgnoreAsciiCase( aText ) )
{
if( bFull )
aMatch = aCurObj.GetMainURL( INetURLObject::NO_DECODE );
@@ -773,11 +772,11 @@ void SvtMatchContext_Impl::doExecute()
aMatch = aCurObj.GetMainURL( INetURLObject::NO_DECODE );
}
- String aURL( aMatch );
+ OUString aURL( aMatch );
if( eProt == INET_PROT_NOT_VALID )
- aMatch.Erase( 0, sal::static_int_cast< xub_StrLen >(INetURLObject::GetScheme( aCurObj.GetProtocol() ).getLength()) );
+ aMatch = aMatch.copy( INetURLObject::GetScheme( aCurObj.GetProtocol() ).getLength() );
- if( aText.Len() < aMatch.Len() )
+ if( aText.getLength() < aMatch.getLength() )
Insert( aMatch, aURL );
continue;
@@ -789,9 +788,9 @@ void SvtMatchContext_Impl::doExecute()
if( bFull )
continue;
- if( aText.CompareTo( aCurMainURL, aText.Len() ) == COMPARE_EQUAL )
+ if( aText.compareTo( aCurMainURL, aText.getLength() ) == 0 )
{
- if( aText.Len() < aCurMainURL.Len() )
+ if( aText.getLength() < aCurMainURL.getLength() )
Insert( aCurMainURL, aCurMainURL );
continue;
@@ -814,13 +813,13 @@ void SvtURLBox::TryAutoComplete()
{
if( Application::AnyInput( VCL_INPUT_KEYBOARD ) ) return;
- String aCurText = GetText();
+ OUString aCurText = GetText();
Selection aSelection( GetSelection() );
- if( aSelection.Max() != aCurText.Len() )
+ if( aSelection.Max() != aCurText.getLength() )
return;
sal_uInt16 nLen = (sal_uInt16)aSelection.Min();
- aCurText.Erase( nLen );
- if( aCurText.Len() && bIsAutoCompleteEnabled )
+ aCurText = aCurText.copy( 0, nLen );
+ if( !aCurText.isEmpty() && bIsAutoCompleteEnabled )
{
if ( pCtx.is() )
{
@@ -927,8 +926,8 @@ void SvtURLBox::UpdatePickList( )
pCtx.clear();
}
- String sText = GetText();
- if ( sText.Len() && bIsAutoCompleteEnabled )
+ OUString sText = GetText();
+ if ( !sText.isEmpty() && bIsAutoCompleteEnabled )
{
pCtx = new SvtMatchContext_Impl( this, sText );
pCtx->launch();
@@ -975,15 +974,15 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl()
break;
}
- String aURL( aCurObj.GetMainURL( INetURLObject::DECODE_WITH_CHARSET ) );
+ OUString aURL( aCurObj.GetMainURL( INetURLObject::DECODE_WITH_CHARSET ) );
- if ( aURL.Len() )
+ if ( !aURL.isEmpty() )
{
- sal_Bool bFound = (aURL.GetChar(aURL.Len()-1) == '/' );
+ sal_Bool bFound = aURL[aURL.getLength()-1] == '/' ;
if ( !bFound )
{
- String aUpperURL( aURL );
- aUpperURL.ToUpperAscii();
+ OUString aUpperURL( aURL );
+ aUpperURL = aUpperURL.toAsciiUpperCase();
bFound
= (::std::find_if(
@@ -1245,11 +1244,10 @@ OUString SvtURLBox::GetURL()
sal_Bool success = (aAny >>= aFileURL);
OUString aTitle;
if(success)
- aTitle = String(
- INetURLObject(aFileURL).getName(
- INetURLObject::LAST_SEGMENT,
- true,
- INetURLObject::DECODE_WITH_CHARSET ));
+ aTitle = INetURLObject(aFileURL).getName(
+ INetURLObject::LAST_SEGMENT,
+ true,
+ INetURLObject::DECODE_WITH_CHARSET );
else
success =
UCBContentHelper::GetTitle(aURL,&aTitle);
@@ -1300,7 +1298,7 @@ sal_Bool SvtURLBox_Impl::TildeParsing(
#ifdef UNX
if( aText.indexOf( '~' ) == 0 )
{
- String aParseTilde;
+ OUString aParseTilde;
sal_Bool bTrailingSlash = sal_True; // use trailing slash
if( aText.getLength() == 1 || aText[ 1 ] == '/' )
@@ -1352,10 +1350,10 @@ sal_Bool SvtURLBox_Impl::TildeParsing(
if( !bTrailingSlash )
{
- if( !aParseTilde.Len() || aParseTilde.EqualsAscii( "/" ) )
+ if( aParseTilde.isEmpty() || aParseTilde == "/" )
{
// "/" path should be converted to "/."
- aParseTilde = OUString("/.");
+ aParseTilde = "/.";
}
else
{
@@ -1365,14 +1363,14 @@ sal_Bool SvtURLBox_Impl::TildeParsing(
}
else
{
- if( aParseTilde.GetChar( aParseTilde.Len() - 1 ) != '/' )
- aParseTilde += '/';
+ if( aParseTilde[ aParseTilde.getLength() - 1 ] != '/' )
+ aParseTilde += "/";
if( aText.getLength() > 2 )
aParseTilde += aText.copy( 2 );
}
aText = aParseTilde;
- aBaseURL = String(); // tilde provide absolute path
+ aBaseURL = ""; // tilde provide absolute path
}
#endif
diff --git a/svtools/source/control/stdmenu.cxx b/svtools/source/control/stdmenu.cxx
index 3a192a1..f579dc2 100644
--- a/svtools/source/control/stdmenu.cxx
+++ b/svtools/source/control/stdmenu.cxx
@@ -186,8 +186,8 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList )
sal_uLong nCount = aFontSizeNames.Count();
for( sal_uLong i = 0; i < nCount; i++ )
{
- String aSizeName = aFontSizeNames.GetIndexName( i );
- long nSize = aFontSizeNames.GetIndexSize( i );
+ OUString aSizeName = aFontSizeNames.GetIndexName( i );
+ long nSize = aFontSizeNames.GetIndexSize( i );
mpHeightAry[nPos] = nSize;
nPos++; // Id is nPos+1
InsertItem( nPos, aSizeName, MIB_RADIOCHECK | MIB_AUTOCHECK );
@@ -199,8 +199,8 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList )
pTempAry = pAry;
while ( *pTempAry )
{
- String aSizeName = aFontSizeNames.Size2Name( *pTempAry );
- if ( aSizeName.Len() )
+ OUString aSizeName = aFontSizeNames.Size2Name( *pTempAry );
+ if ( !aSizeName.isEmpty() )
{
mpHeightAry[nPos] = *pTempAry;
nPos++; // Id is nPos+1
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index e10bb96..4152f9d 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -1157,7 +1157,7 @@ public:
}
}
- void drawText(const String& aText)
+ void drawText(const OUString& aText)
{
Rectangle aRect = maRect;
long nTextWidth = mrParent.GetTextWidth(aText);
diff --git a/svtools/source/control/toolbarmenuacc.cxx b/svtools/source/control/toolbarmenuacc.cxx
index c7f008e..8c35f91 100644
--- a/svtools/source/control/toolbarmenuacc.cxx
+++ b/svtools/source/control/toolbarmenuacc.cxx
@@ -736,15 +736,15 @@ OUString SAL_CALL ToolbarMenuEntryAcc::getAccessibleDescription() throw (Runtime
OUString SAL_CALL ToolbarMenuEntryAcc::getAccessibleName() throw (RuntimeException)
{
const SolarMutexGuard aSolarGuard;
- String aRet;
+ OUString aRet;
if( mpParent )
{
aRet = mpParent->maText;
- if( !aRet.Len() )
+ if( aRet.isEmpty() )
{
- aRet = String( RTL_CONSTASCII_USTRINGPARAM( "Item " ) );
+ aRet = "Item ";
aRet += OUString::number( mpParent->mnEntryId );
}
}
diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx
index 1bef13a..985f9fb 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -268,7 +268,7 @@ OUString SAL_CALL ValueSetAcc::getAccessibleDescription()
{
ThrowIfDisposed();
const SolarMutexGuard aSolarGuard;
- String aRet( RTL_CONSTASCII_USTRINGPARAM( "ValueSet" ) );
+ OUString aRet( "ValueSet" );
return aRet;
}
@@ -280,12 +280,12 @@ OUString SAL_CALL ValueSetAcc::getAccessibleName()
{
ThrowIfDisposed();
const SolarMutexGuard aSolarGuard;
- String aRet;
+ OUString aRet;
if ( mpParent )
aRet = mpParent->GetAccessibleName();
- if ( !aRet.Len() )
+ if ( aRet.isEmpty() )
{
Window* pLabel = mpParent->GetAccessibleRelationLabeledBy();
if ( pLabel && pLabel != mpParent )
commit d71c8d1ed412dcf2a6a8111bc9007bc6dc73073e
Author: Noel Grandin <noel at peralex.com>
Date: Tue Aug 20 17:07:59 2013 +0200
convert svtools/source/dialogs/* from String to OUString
Change-Id: Ib868e94bb73f244fcb5b1b47962ded0118023a26
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index 246abd3..1a922f4 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -70,15 +70,15 @@ namespace svt
using namespace ::comphelper;
using namespace ::utl;
- DECLARE_STL_VECTOR( String, StringArray );
- DECLARE_STL_STDKEY_SET( OUString, StringBag );
+ typedef std::vector<OUString> StringArray;
+ typedef std::set<OUString> StringBag;
DECLARE_STL_USTRINGACCESS_MAP( OUString, MapString2String );
namespace
{
- String lcl_getSelectedDataSource( const ComboBox& _dataSourceCombo )
+ OUString lcl_getSelectedDataSource( const ComboBox& _dataSourceCombo )
{
- String selectedDataSource = _dataSourceCombo.GetText();
+ OUString selectedDataSource = _dataSourceCombo.GetText();
if ( _dataSourceCombo.GetEntryPos( selectedDataSource ) == LISTBOX_ENTRY_NOTFOUND )
{
// none of the pre-selected entries -> assume a path to a database document
@@ -187,7 +187,7 @@ public:
const AliasProgrammaticPair* pFieldsEnd = pFields + _rFields.getLength();
for (;pFields != pFieldsEnd; ++pFields)
{
- StringBagIterator aKnownPos = aKnownNames.find( pFields->ProgrammaticName );
+ StringBag::const_iterator aKnownPos = aKnownNames.find( pFields->ProgrammaticName );
if ( aKnownNames.end() != aKnownPos )
{
m_aAliases[ pFields->ProgrammaticName ] = pFields->Alias;
@@ -635,7 +635,7 @@ void AssignmentPersistentData::Commit()
long nLabelWidth = 0;
long nListBoxWidth = m_pImpl->pFields[0]->approximate_char_width() * 20;
- for (ConstStringArrayIterator aI = m_pImpl->aFieldLabels.begin(), aEnd = m_pImpl->aFieldLabels.end(); aI != aEnd; ++aI)
+ for (StringArray::const_iterator aI = m_pImpl->aFieldLabels.begin(), aEnd = m_pImpl->aFieldLabels.end(); aI != aEnd; ++aI)
{
nLabelWidth = std::max(nLabelWidth, FixedText::getTextDimensions(m_pImpl->pFieldLabels[0], *aI, 0x7FFFFFFF).Width());
}
@@ -720,7 +720,7 @@ void AssignmentPersistentData::Commit()
AliasProgrammaticPair* pPair = _rMapping.getArray();
OUString sCurrent;
- for ( ConstStringArrayIterator aProgrammatic = m_pImpl->aLogicalFieldNames.begin();
+ for ( StringArray::const_iterator aProgrammatic = m_pImpl->aLogicalFieldNames.begin();
aProgrammatic != m_pImpl->aLogicalFieldNames.end();
++aProgrammatic
)
@@ -757,8 +757,8 @@ void AssignmentPersistentData::Commit()
// AddressBookSourceDialog::loadConfiguration: inconsistence between field names and field assignments!
assert(m_pImpl->aLogicalFieldNames.size() == m_pImpl->aFieldAssignments.size());
- ConstStringArrayIterator aLogical = m_pImpl->aLogicalFieldNames.begin();
- StringArrayIterator aAssignment = m_pImpl->aFieldAssignments.begin();
+ StringArray::const_iterator aLogical = m_pImpl->aLogicalFieldNames.begin();
+ StringArray::iterator aAssignment = m_pImpl->aFieldAssignments.begin();
for ( ;
aLogical != m_pImpl->aLogicalFieldNames.end();
++aLogical, ++aAssignment
@@ -860,7 +860,7 @@ void AssignmentPersistentData::Commit()
Reference< XCompletedConnection > xDS;
if ( m_pImpl->bWorkingPersistent )
{
- String sSelectedDS = lcl_getSelectedDataSource(*m_pDatasource);
+ OUString sSelectedDS = lcl_getSelectedDataSource(*m_pDatasource);
// get the data source the user has chosen and let it build a connection
INetURLObject aURL( sSelectedDS );
@@ -932,7 +932,7 @@ void AssignmentPersistentData::Commit()
// no matter what we do here, we handled the currently selected table (no matter if successful or not)
m_pDatasource->SaveValue();
- String sSelectedTable = m_pTable->GetText();
+ OUString sSelectedTable = m_pTable->GetText();
Sequence< OUString > aColumnNames;
try
{
@@ -959,14 +959,14 @@ void AssignmentPersistentData::Commit()
const OUString* pEnd = pColumnNames + aColumnNames.getLength();
// for quicker access
- ::std::set< String > aColumnNameSet;
+ ::std::set< OUString > aColumnNameSet;
for (pColumnNames = aColumnNames.getConstArray(); pColumnNames != pEnd; ++pColumnNames)
aColumnNameSet.insert(*pColumnNames);
- std::vector<String>::iterator aInitialSelection = m_pImpl->aFieldAssignments.begin() + m_pImpl->nFieldScrollPos;
+ std::vector<OUString>::iterator aInitialSelection = m_pImpl->aFieldAssignments.begin() + m_pImpl->nFieldScrollPos;
ListBox** pListbox = m_pImpl->pFields;
- String sSaveSelection;
+ OUString sSaveSelection;
for (sal_Int32 i=0; i<FIELD_CONTROLS_VISIBLE; ++i, ++pListbox, ++aInitialSelection)
{
sSaveSelection = (*pListbox)->GetSelectEntry();
@@ -982,7 +982,7 @@ void AssignmentPersistentData::Commit()
for (pColumnNames = aColumnNames.getConstArray(); pColumnNames != pEnd; ++pColumnNames)
(*pListbox)->InsertEntry(*pColumnNames);
- if (aInitialSelection->Len() && (aColumnNameSet.end() != aColumnNameSet.find(*aInitialSelection)))
+ if (!aInitialSelection->isEmpty() && (aColumnNameSet.end() != aColumnNameSet.find(*aInitialSelection)))
// we can select the entry as specified in our field assignment array
(*pListbox)->SelectEntry(*aInitialSelection);
else
@@ -996,13 +996,13 @@ void AssignmentPersistentData::Commit()
}
// adjust m_pImpl->aFieldAssignments
- for ( StringArrayIterator aAdjust = m_pImpl->aFieldAssignments.begin();
+ for ( StringArray::iterator aAdjust = m_pImpl->aFieldAssignments.begin();
aAdjust != m_pImpl->aFieldAssignments.end();
++aAdjust
)
- if (aAdjust->Len())
+ if (!aAdjust->isEmpty())
if (aColumnNameSet.end() == aColumnNameSet.find(*aAdjust))
- aAdjust->Erase();
+ (*aAdjust) = "";
}
// -------------------------------------------------------------------
@@ -1016,7 +1016,7 @@ void AssignmentPersistentData::Commit()
// update the array where we remember the field selections
if (0 == _pListbox->GetSelectEntryPos())
// it's the "no field selection" entry
- m_pImpl->aFieldAssignments[m_pImpl->nFieldScrollPos * 2 + nListBoxIndex] = String();
+ m_pImpl->aFieldAssignments[m_pImpl->nFieldScrollPos * 2 + nListBoxIndex] = "";
else
// it's a regular field entry
m_pImpl->aFieldAssignments[m_pImpl->nFieldScrollPos * 2 + nListBoxIndex] = _pListbox->GetSelectEntry();
@@ -1035,8 +1035,8 @@ void AssignmentPersistentData::Commit()
// for the new texts
FixedText** pLeftLabelControl = m_pImpl->pFieldLabels;
FixedText** pRightLabelControl = pLeftLabelControl + 1;
- ConstStringArrayIterator pLeftColumnLabel = m_pImpl->aFieldLabels.begin() + 2 * _nPos;
- ConstStringArrayIterator pRightColumnLabel = pLeftColumnLabel + 1;
+ StringArray::const_iterator pLeftColumnLabel = m_pImpl->aFieldLabels.begin() + 2 * _nPos;
+ StringArray::const_iterator pRightColumnLabel = pLeftColumnLabel + 1;
// for the focus movement and the selection scroll
ListBox** pLeftListControl = m_pImpl->pFields;
@@ -1047,8 +1047,8 @@ void AssignmentPersistentData::Commit()
sal_Int32 nOldFocusColumn = 0;
// for the selection scroll
- ConstStringArrayIterator pLeftAssignment = m_pImpl->aFieldAssignments.begin() + 2 * _nPos;
- ConstStringArrayIterator pRightAssignment = pLeftAssignment + 1;
+ StringArray::const_iterator pLeftAssignment = m_pImpl->aFieldAssignments.begin() + 2 * _nPos;
+ StringArray::const_iterator pRightAssignment = pLeftAssignment + 1;
m_pImpl->nLastVisibleListIndex = -1;
// loop
@@ -1075,7 +1075,7 @@ void AssignmentPersistentData::Commit()
// (If sometimes we support an arbitrary number of field assignments, we would have to care for
// an invisible left hand side column, too. But right now, the left hand side controls are always
// visible)
- sal_Bool bHideRightColumn = (0 == pRightColumnLabel->Len());
+ sal_Bool bHideRightColumn = pRightColumnLabel->isEmpty();
(*pRightLabelControl)->Show(!bHideRightColumn);
(*pRightListControl)->Show(!bHideRightColumn);
// the new selections of the listboxes
@@ -1180,7 +1180,7 @@ void AssignmentPersistentData::Commit()
// -------------------------------------------------------------------
IMPL_LINK_NOARG(AddressBookSourceDialog, OnOkClicked)
{
- String sSelectedDS = lcl_getSelectedDataSource(*m_pDatasource);
+ OUString sSelectedDS = lcl_getSelectedDataSource(*m_pDatasource);
if ( m_pImpl->bWorkingPersistent )
{
m_pImpl->pConfigData->setDatasourceName(sSelectedDS);
@@ -1191,8 +1191,8 @@ void AssignmentPersistentData::Commit()
assert(m_pImpl->aLogicalFieldNames.size() == m_pImpl->aFieldAssignments.size());
// set the field assignments
- ConstStringArrayIterator aLogical = m_pImpl->aLogicalFieldNames.begin();
- ConstStringArrayIterator aAssignment = m_pImpl->aFieldAssignments.begin();
+ StringArray::const_iterator aLogical = m_pImpl->aLogicalFieldNames.begin();
+ StringArray::const_iterator aAssignment = m_pImpl->aFieldAssignments.begin();
for ( ;
aLogical != m_pImpl->aLogicalFieldNames.end();
++aLogical, ++aAssignment
diff --git a/svtools/source/dialogs/insdlg.cxx b/svtools/source/dialogs/insdlg.cxx
index 10b1fda..67e0e1a 100644
--- a/svtools/source/dialogs/insdlg.cxx
+++ b/svtools/source/dialogs/insdlg.cxx
@@ -162,7 +162,7 @@ void SvObjectServerList::FillInsertObjects()
}
SvGlobalName aClassName;
- if( aClassName.MakeId( String( aClassID )))
+ if( aClassName.MakeId( aClassID) )
{
if( !Get( aClassName ) )
// noch nicht eingetragen
@@ -175,7 +175,7 @@ void SvObjectServerList::FillInsertObjects()
#ifdef WNT
SvGlobalName aOleFact( SO3_OUT_CLASSID );
- String aOleObj( SVT_RESSTR( STR_FURTHER_OBJECT ) );
+ OUString aOleObj( SVT_RESSTR( STR_FURTHER_OBJECT ) );
aObjectServerList.push_back( SvObjectServer( aOleFact, aOleObj ) );
#endif
@@ -267,7 +267,7 @@ OUString SvPasteObjectHelper::GetSotFormatUIName( SotFormatStringId nId )
{ SOT_FORMATSTR_ID_HTML_NO_COMMENT, STR_FORMAT_ID_HTML_NO_COMMENT }
};
- String aUIName;
+ OUString aUIName;
sal_uInt16 nResId = 0;
for( sal_uInt32 i = 0, nCount = SAL_N_ELEMENTS( aSotResourcePairs ); ( i < nCount ) && !nResId; i++ )
diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx
index 8687e3d..b1d86bf2 100644
--- a/svtools/source/dialogs/roadmapwizard.cxx
+++ b/svtools/source/dialogs/roadmapwizard.cxx
@@ -47,7 +47,7 @@ namespace svt
typedef ::std::map<
WizardTypes::WizardState,
::std::pair<
- String,
+ OUString,
RoadmapWizardTypes::RoadmapPageFactory
>
> StateDescriptions;
commit 9bd6c8d02696a97359d2ed6fe349697663d6e945
Author: Noel Grandin <noel at peralex.com>
Date: Tue Aug 20 16:15:55 2013 +0200
convert svtools/source/filter/* from String to OUString
Change-Id: Ia544a7e84ac4de4f64ef4d7e71219a3f4683c430
diff --git a/svtools/source/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter/SvFilterOptionsDialog.cxx
index c2e2a3b..108020c 100644
--- a/svtools/source/filter/SvFilterOptionsDialog.cxx
+++ b/svtools/source/filter/SvFilterOptionsDialog.cxx
@@ -140,7 +140,7 @@ uno::Sequence< beans::PropertyValue > SvFilterOptionsDialog::getPropertyValues()
maMediaDescriptor.realloc( ++nCount );
// the "FilterData" Property is an Any that will contain our PropertySequence of Values
- maMediaDescriptor[ i ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "FilterData" ) );
+ maMediaDescriptor[ i ].Name = "FilterData";
maMediaDescriptor[ i ].Value <<= maFilterDataSequence;
return maMediaDescriptor;
}
@@ -178,8 +178,8 @@ sal_Int16 SvFilterOptionsDialog::execute()
{
sal_Int16 nRet = ui::dialogs::ExecutableDialogResults::CANCEL;
- String aFilterNameStr( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
- String aInternalFilterName;
+ OUString aFilterNameStr( "FilterName" );
+ OUString aInternalFilterName;
sal_Int32 j, nCount = maMediaDescriptor.getLength();
for ( j = 0; j < nCount; j++ )
{
@@ -188,12 +188,12 @@ sal_Int16 SvFilterOptionsDialog::execute()
OUString aStr;
maMediaDescriptor[ j ].Value >>= aStr;
aInternalFilterName = aStr;
- aInternalFilterName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "draw_" ) ), String(), 0 );
- aInternalFilterName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "impress_" ) ), String(), 0 );
+ aInternalFilterName = aInternalFilterName.replaceAll( "draw_", "" );
+ aInternalFilterName = aInternalFilterName.replaceAll( "impress_", "" );
break;
}
}
- if ( aInternalFilterName.Len() )
+ if ( !aInternalFilterName.isEmpty() )
{
GraphicFilter aGraphicFilter( sal_True );
@@ -234,24 +234,24 @@ void SvFilterOptionsDialog::setSourceDocument( const uno::Reference< lang::XComp
mxSourceDocument = xDoc;
// try to set the corresponding metric unit
- String aConfigPath;
+ OUString aConfigPath;
uno::Reference< lang::XServiceInfo > xServiceInfo
( xDoc, uno::UNO_QUERY );
if ( xServiceInfo.is() )
{
if ( xServiceInfo->supportsService("com.sun.star.presentation.PresentationDocument") )
- aConfigPath = String( RTL_CONSTASCII_USTRINGPARAM( "Office.Impress/Layout/Other/MeasureUnit" ) );
+ aConfigPath = "Office.Impress/Layout/Other/MeasureUnit";
else if ( xServiceInfo->supportsService("com.sun.star.drawing.DrawingDocument") )
- aConfigPath = String( RTL_CONSTASCII_USTRINGPARAM( "Office.Draw/Layout/Other/MeasureUnit" ) );
- if ( aConfigPath.Len() )
+ aConfigPath = "Office.Draw/Layout/Other/MeasureUnit";
+ if ( !aConfigPath.isEmpty() )
{
FilterConfigItem aConfigItem( aConfigPath );
- String aPropertyName;
+ OUString aPropertyName;
SvtSysLocale aSysLocale;
if ( aSysLocale.GetLocaleDataPtr()->getMeasurementSystemEnum() == MEASURE_METRIC )
- aPropertyName = String( RTL_CONSTASCII_USTRINGPARAM( "Metric" ) );
+ aPropertyName = "Metric";
else
- aPropertyName = String( RTL_CONSTASCII_USTRINGPARAM( "NonMetric" ) );
+ aPropertyName = "NonMetric";
meFieldUnit = (FieldUnit)aConfigItem.ReadInt32( aPropertyName, FUNIT_CM );
}
}
commit 563e228fd3ae975a1c4e8e2279daa18a260df3c3
Author: Noel Grandin <noel at peralex.com>
Date: Tue Aug 20 16:13:00 2013 +0200
convert svtools/source/graphic/* from String to OUString
Change-Id: Ic56bc8c61aa85c4a9d2f5a7355aeed31a20d6138
diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx
index e6c22c2..1f6515a 100644
--- a/svtools/source/graphic/descriptor.cxx
+++ b/svtools/source/graphic/descriptor.cxx
@@ -160,7 +160,7 @@ void GraphicDescriptor::implCreate( SvStream& rIStm, const OUString* pURL )
if( graphic::GraphicType::EMPTY != cType )
{
meType = ( ( graphic::GraphicType::PIXEL == cType ) ? GRAPHIC_BITMAP : GRAPHIC_GDIMETAFILE );
- maMimeType = String( pMimeType, RTL_TEXTENCODING_ASCII_US );
+ maMimeType = OUString( pMimeType, strlen(pMimeType), RTL_TEXTENCODING_ASCII_US );
maSizePixel = aDescriptor.GetSizePixel();
maSize100thMM = aDescriptor.GetSize_100TH_MM();
mnBitsPerPixel = aDescriptor.GetBitsPerPixel();
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index f0d4629..f91b0fd 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -264,7 +264,7 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute )
const Size aPrefSize( rSubstitute.GetPrefSize() );
const MapMode aPrefMapMode( rSubstitute.GetPrefMapMode() );
const Link aAnimationNotifyHdl( rSubstitute.GetAnimationNotifyHdl() );
- const String aDocFileName( rSubstitute.GetDocFileName() );
+ const OUString aDocFileName( rSubstitute.GetDocFileName() );
const sal_uLong nDocFilePos = rSubstitute.GetDocFilePos();
const GraphicType eOldType = rSubstitute.GetType();
const bool bDefaultType = ( rSubstitute.GetType() == GRAPHIC_DEFAULT );
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 18d1090..85f0d0b 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -1129,8 +1129,8 @@ SvStream& operator<<( SvStream& rOStm, const GraphicObject& rGraphicObj )
GraphicObject GraphicObject::CreateGraphicObjectFromURL( const OUString &rURL )
{
- const String aURL( rURL ), aPrefix( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX) );
- if( aURL.Search( aPrefix ) == 0 )
+ const OUString aURL( rURL ), aPrefix( UNO_NAME_GRAPHOBJ_URLPREFIX );
+ if( aURL.indexOf( aPrefix ) == 0 )
{
// graphic manager url
OString aUniqueID(OUStringToOString(rURL.copy(sizeof(UNO_NAME_GRAPHOBJ_URLPREFIX) - 1), RTL_TEXTENCODING_UTF8));
@@ -1139,7 +1139,7 @@ GraphicObject GraphicObject::CreateGraphicObjectFromURL( const OUString &rURL )
else
{
Graphic aGraphic;
- if ( aURL.Len() )
+ if ( !aURL.isEmpty() )
{
SvStream* pStream = utl::UcbStreamHelper::CreateStream( aURL, STREAM_READ );
if( pStream )
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index 9bc54b9..9a5fa4e 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -151,7 +151,7 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadGraphicObject( co
if( rResourceURL.startsWith( UNO_NAME_GRAPHOBJ_URLPREFIX ) )
{
// graphic manager url
- String aTmpStr( rResourceURL.copy( sizeof( UNO_NAME_GRAPHOBJ_URLPREFIX ) - 1 ) );
+ OUString aTmpStr( rResourceURL.copy( sizeof( UNO_NAME_GRAPHOBJ_URLPREFIX ) - 1 ) );
OString aUniqueID(OUStringToOString(aTmpStr,
RTL_TEXTENCODING_UTF8));
GraphicObject aGrafObj(aUniqueID);
@@ -194,7 +194,7 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadRepositoryImage(
if( ( 0 == rResourceURL.getToken( 0, '/', nIndex ).compareToAscii( "private:graphicrepository" ) ) )
{
- String sPathName( rResourceURL.copy( nIndex ) );
+ OUString sPathName( rResourceURL.copy( nIndex ) );
BitmapEx aBitmap;
if ( ::vcl::ImageRepository::loadImage( sPathName, aBitmap, false ) )
{
@@ -427,7 +427,7 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co
throw ( io::IOException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
uno::Reference< ::graphic::XGraphic > xRet;
- String aPath;
+ OUString aPath;
SvStream* pIStm = NULL;
uno::Reference< io::XInputStream > xIStm;
@@ -487,7 +487,7 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co
{
pIStm = ::utl::UcbStreamHelper::CreateStream( xIStm );
}
- else if( aPath.Len() )
+ else if( !aPath.isEmpty() )
{
xRet = implLoadMemory( aPath );
@@ -770,7 +770,7 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG
throw ( io::IOException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
SvStream* pOStm = NULL;
- String aPath;
+ OUString aPath;
sal_Int32 i;
for( i = 0; ( i < rMediaProperties.getLength() ) && !pOStm; ++i )
commit be8d43651ee2356de8074b026e48ceb2a83b8ea3
Author: Noel Grandin <noel at peralex.com>
Date: Tue Aug 20 16:09:10 2013 +0200
convert svtools/source/misc/* from String to OUString
Change-Id: I32592a9fb2110ccc3ac7424a18e43238722849ca
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index 470e18e..59470e9 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -81,12 +81,12 @@ static sal_uInt16 aWndFunc(
break;
}
- String aErr(SvtResId(STR_ERR_HDLMESS).toString());
- String aAction(rAction);
- if ( aAction.Len() )
- aAction += OUString(":\n");
- aErr.SearchAndReplace(OUString("$(ACTION)"), aAction);
- aErr.SearchAndReplace(OUString("$(ERROR)"), rErr);
+ OUString aErr(SvtResId(STR_ERR_HDLMESS).toString());
+ OUString aAction(rAction);
+ if ( !aAction.isEmpty() )
+ aAction += ":\n";
+ aErr = aErr.replaceAll("$(ACTION)", aAction);
+ aErr = aErr.replaceAll("$(ERROR)", rErr);
MessBox* pBox;
switch ( nFlags & 0xf000 )
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 651a27e..fb5f3f2 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -531,7 +531,7 @@ void EmbeddedObjectRef::SetGraphicStream( const uno::Reference< io::XInputStream
if ( pGraphicStream )
{
GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
- rGF.ImportGraphic( *mpImpl->pGraphic, String(), *pGraphicStream, GRFILTER_FORMAT_DONTKNOW );
+ rGF.ImportGraphic( *mpImpl->pGraphic, "", *pGraphicStream, GRFILTER_FORMAT_DONTKNOW );
mpImpl->mnGraphicVersion++;
if ( mpImpl->pContainer )
diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx
index 3c87d03..7ccbfe5 100644
--- a/svtools/source/misc/embedtransfer.cxx
+++ b/svtools/source/misc/embedtransfer.cxx
@@ -240,7 +240,7 @@ void SvEmbedTransferHelper::FillTransferableObjectDescriptor( TransferableObject
rDesc.maSize = OutputDevice::LogicToLogic( aSize, aMapMode, MapMode( MAP_100TH_MM ) );
rDesc.maDragStartPos = Point();
- rDesc.maDisplayName = String();
+ rDesc.maDisplayName = "";
rDesc.mbCanLink = sal_False;
}
diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx
index 0eea288..57ec736 100644
--- a/svtools/source/misc/imagemgr.cxx
+++ b/svtools/source/misc/imagemgr.cxx
@@ -194,18 +194,18 @@ static SvtFactory2ExtensionMapping_Impl const Fac2ExtMap_Impl[] =
//****************************************************************************
-static String GetImageExtensionByFactory_Impl( const String& rURL )
+static OUString GetImageExtensionByFactory_Impl( const OUString& rURL )
{
INetURLObject aObj( rURL );
- String aPath = aObj.GetURLPath( INetURLObject::NO_DECODE );
- String aExtension;
+ OUString aPath = aObj.GetURLPath( INetURLObject::NO_DECODE );
+ OUString aExtension;
- if ( aPath.Len() )
+ if ( !aPath.isEmpty() )
{
sal_uInt16 nIndex = 0;
while ( Fac2ExtMap_Impl[ nIndex ]._pFactory )
{
- if ( aPath.EqualsAscii( Fac2ExtMap_Impl[ nIndex ]._pFactory ) )
+ if ( aPath.equalsAscii( Fac2ExtMap_Impl[ nIndex ]._pFactory ) )
{
// extension found
aExtension = OUString::createFromAscii(Fac2ExtMap_Impl[ nIndex ]._pExtension);
@@ -242,7 +242,7 @@ static String GetImageExtensionByFactory_Impl( const String& rURL )
if ( ( rProp.Value >>= aExtensions ) && aExtensions.getLength() > 0 )
{
const OUString* pExtensions = aExtensions.getConstArray();
- aExtension = String( pExtensions[0] );
+ aExtension = OUString( pExtensions[0] );
break;
}
}
@@ -261,17 +261,16 @@ static String GetImageExtensionByFactory_Impl( const String& rURL )
return aExtension;
}
-static sal_uInt16 GetIndexOfExtension_Impl( const String& rExtension )
+static sal_uInt16 GetIndexOfExtension_Impl( const OUString& rExtension )
{
sal_uInt16 nRet = NO_INDEX;
- if ( rExtension.Len() )
+ if ( !rExtension.isEmpty() )
{
sal_uInt16 nIndex = 0;
- String aExt = rExtension;
- aExt.ToLowerAscii();
+ OUString aExt = rExtension.toAsciiLowerCase();
while ( ExtensionMap_Impl[ nIndex ]._pExt )
{
- if ( aExt.EqualsAscii( ExtensionMap_Impl[ nIndex ]._pExt ) )
+ if ( aExt.equalsAscii( ExtensionMap_Impl[ nIndex ]._pExt ) )
{
nRet = nIndex;
break;
@@ -283,10 +282,10 @@ static sal_uInt16 GetIndexOfExtension_Impl( const String& rExtension )
return nRet;
}
-static sal_uInt16 GetImageId_Impl( const String& rExtension )
+static sal_uInt16 GetImageId_Impl( const OUString& rExtension )
{
sal_uInt16 nImage = IMG_FILE;
- if ( rExtension.Len() != NO_INDEX )
+ if ( rExtension.getLength() != NO_INDEX )
{
sal_uInt16 nIndex = GetIndexOfExtension_Impl( rExtension );
if ( nIndex != NO_INDEX )
@@ -324,7 +323,7 @@ static sal_Bool GetVolumeProperties_Impl( ::ucbhelper::Content& rContent, svtool
return bRet;
}
-static sal_uInt16 GetFolderImageId_Impl( const String& rURL )
+static sal_uInt16 GetFolderImageId_Impl( const OUString& rURL )
{
sal_uInt16 nRet = IMG_FOLDER;
::svtools::VolumeInfo aVolumeInfo;
@@ -356,28 +355,28 @@ static sal_uInt16 GetFolderImageId_Impl( const String& rURL )
static sal_uInt16 GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFolder )
{
- String aExt, sURL = rObject.GetMainURL( INetURLObject::NO_DECODE );
+ OUString aExt, sURL = rObject.GetMainURL( INetURLObject::NO_DECODE );
sal_uInt16 nImage = IMG_FILE;
if ( rObject.GetProtocol() == INET_PROT_PRIVATE )
{
- String aURLPath = sURL.Copy( URL_PREFIX_PRIV_SOFFICE_LEN );
- String aType = aURLPath.GetToken( 0, INET_PATH_TOKEN );
- if ( aType == String( RTL_CONSTASCII_USTRINGPARAM("factory") ) )
+ OUString aURLPath = sURL.copy( URL_PREFIX_PRIV_SOFFICE_LEN );
+ OUString aType = aURLPath.getToken( 0, INET_PATH_TOKEN );
+ if ( aType == "factory" )
{
// detect an image id for our "private:factory" urls
aExt = GetImageExtensionByFactory_Impl( sURL );
- if ( aExt.Len() > 0 )
+ if ( !aExt.isEmpty() )
nImage = GetImageId_Impl( aExt );
return nImage;
}
- else if ( aType == String( RTL_CONSTASCII_USTRINGPARAM("image") ) )
- nImage = (sal_uInt16)aURLPath.GetToken( 1, INET_PATH_TOKEN ).ToInt32();
+ else if ( aType == "image" )
+ nImage = (sal_uInt16)aURLPath.getToken( 1, INET_PATH_TOKEN ).toInt32();
}
else
{
aExt = rObject.getExtension();
- if ( aExt.EqualsAscii( "vor" ) )
+ if ( aExt == "vor" )
{
SotStorageRef aStorage = new SotStorage( sURL, STREAM_STD_READ );
sal_uInt16 nId = IMG_WRITERTEMPLATE;
@@ -399,21 +398,21 @@ static sal_uInt16 GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetec
}
}
- if ( nImage == IMG_FILE && sURL.Len() )
+ if ( nImage == IMG_FILE && !sURL.isEmpty() )
{
if ( bDetectFolder && CONTENT_HELPER::IsFolder( sURL ) )
nImage = GetFolderImageId_Impl( sURL );
- else if ( aExt.Len() > 0 )
+ else if ( !aExt.isEmpty() )
nImage = GetImageId_Impl( aExt );
}
return nImage;
}
-static sal_uInt16 GetDescriptionId_Impl( const String& rExtension, sal_Bool& rbShowExt )
+static sal_uInt16 GetDescriptionId_Impl( const OUString& rExtension, sal_Bool& rbShowExt )
{
sal_uInt16 nId = 0;
- if ( rExtension.Len() != NO_INDEX )
+ if ( rExtension.getLength() != NO_INDEX )
{
sal_uInt16 nIndex = GetIndexOfExtension_Impl( rExtension );
if ( nIndex != NO_INDEX )
@@ -426,24 +425,24 @@ static sal_uInt16 GetDescriptionId_Impl( const String& rExtension, sal_Bool& rbS
return nId;
}
-static String GetDescriptionByFactory_Impl( const String& rFactory )
+static OUString GetDescriptionByFactory_Impl( const OUString& rFactory )
{
sal_uInt16 nResId = 0;
- if ( rFactory.EqualsIgnoreCaseAscii( "swriter", 0, 7 ) )
+ if ( rFactory.startsWithIgnoreAsciiCase( "swriter" ) )
nResId = STR_DESCRIPTION_FACTORY_WRITER;
- else if ( rFactory.EqualsIgnoreCaseAscii( "scalc", 0, 5 ) )
+ else if ( rFactory.startsWithIgnoreAsciiCase( "scalc" ) )
nResId = STR_DESCRIPTION_FACTORY_CALC;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list