[Libreoffice-commits] .: sd/inc sd/source svtools/inc svtools/source svx/inc svx/source vcl/inc vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Sep 11 02:55:18 PDT 2012
sd/inc/sdpage.hxx | 6 +--
sd/source/core/drawdoc3.cxx | 10 ++---
sd/source/core/sdpage.cxx | 18 ++++-----
sd/source/core/sdpage2.cxx | 8 ++--
sd/source/core/stlfamily.cxx | 2 -
sd/source/ui/toolpanel/controls/DocumentHelper.cxx | 5 +-
sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx | 5 +-
sd/source/ui/view/drviews1.cxx | 17 +++++---
sd/source/ui/view/drviewsb.cxx | 2 -
svtools/inc/svtools/tabbar.hxx | 6 +--
svtools/source/brwbox/datwin.cxx | 2 -
svtools/source/control/tabbar.cxx | 32 +++++++---------
svx/inc/svx/svdpage.hxx | 2 -
svx/source/svdraw/svdpage.cxx | 4 +-
vcl/inc/vcl/outdev.hxx | 2 -
vcl/source/gdi/outdev3.cxx | 2 -
16 files changed, 60 insertions(+), 63 deletions(-)
New commits:
commit 3e635c3368c23608bac471970f18d1d64684a147
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Sep 10 23:42:29 2012 +0100
XubString->rtl::OUString
Change-Id: If7e5d015c95f8f173750ca32e061d69f56e2d93e
diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx
index 9b1236a..8089e9a 100644
--- a/sd/inc/sdpage.hxx
+++ b/sd/inc/sdpage.hxx
@@ -127,7 +127,7 @@ protected:
sal_uInt32 mnTime; ///< Display time in seconds
sal_Bool mbSoundOn; ///< with / without sound.
sal_Bool mbExcluded; ///< will (not) be displayed during show.
- String maLayoutName; ///< Name of the layout
+ OUString maLayoutName; ///< Name of the layout
String maSoundFile; ///< Path to sound file (MSDOS notation).
bool mbLoopSound;
bool mbStopSound;
@@ -273,8 +273,8 @@ public:
virtual void Changed(const SdrObject& rObj, SdrUserCallType eType,
const Rectangle& rOldBoundRect);
- void SetLayoutName(String aName);
- virtual String GetLayoutName() const { return maLayoutName; }
+ void SetLayoutName(OUString aName);
+ virtual OUString GetLayoutName() const { return maLayoutName; }
void SetFileName(const String& aName) { maFileName = aName; }
virtual String GetFileName() const { return maFileName; }
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 27e9197..ab8b0e5 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1258,7 +1258,7 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, sal_Bool
{
// Do not delete master pages that have their precious flag set.
sal_Bool bDeleteMaster = !pMaster->IsPrecious();
- String aLayoutName = pMaster->GetLayoutName();
+ OUString aLayoutName = pMaster->GetLayoutName();
if(bOnlyDuplicatePages )
{
@@ -1419,11 +1419,11 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
}
else
{
- String aSearchFor(rLayoutName);
- aSearchFor.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR ));
- aSearchFor.Append( String(SdResId(STR_LAYOUT_OUTLINE))) ;
+ OUStringBuffer aBuf(rLayoutName);
+ aBuf.append(SD_LT_SEPARATOR).append(SdResId(STR_LAYOUT_OUTLINE).toString());
+ OUString aSearchFor(aBuf.makeStringAndClear());
- for (sal_uInt16 nMP = 0; nMP < pSourceDoc->GetMasterPageCount(); nMP++)
+ for (sal_uInt16 nMP = 0; nMP < pSourceDoc->GetMasterPageCount(); ++nMP)
{
SdPage* pMP = (SdPage*) pSourceDoc->GetMasterPage(nMP);
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 0432f54..0d44e14 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -118,9 +118,9 @@ SdPage::SdPage(SdDrawDocument& rNewDoc, StarBASIC* pBasic, sal_Bool bMasterPage)
// Der Layoutname der Seite wird von SVDRAW benutzt, um die Praesentations-
// vorlagen der Gliederungsobjekte zu ermitteln. Darum enthaelt er bereits
// den Bezeichner fuer die Gliederung (STR_LAYOUT_OUTLINE).
- maLayoutName = String(SdResId(STR_LAYOUT_DEFAULT_NAME));
- maLayoutName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR ));
- maLayoutName += String(SdResId(STR_LAYOUT_OUTLINE));
+ OUStringBuffer aBuf(SdResId(STR_LAYOUT_DEFAULT_NAME).toString());
+ aBuf.append(SD_LT_SEPARATOR).append(SdResId(STR_LAYOUT_OUTLINE).toString());
+ maLayoutName = aBuf.makeStringAndClear();
Size aPageSize(GetSize());
@@ -2494,18 +2494,16 @@ void SdPage::SetLinkData(const String&, const String& )
|* Layoutname setzen
|*
\************************************************************************/
-void SdPage::SetLayoutName(String aName)
+void SdPage::SetLayoutName(OUString aName)
{
maLayoutName = aName;
if( mbMaster )
{
- String aSep( RTL_CONSTASCII_USTRINGPARAM(SD_LT_SEPARATOR) );
- sal_uInt16 nPos = maLayoutName.Search( aSep );
- if ( nPos != STRING_NOTFOUND )
- {
- FmFormPage::SetName(maLayoutName.Copy(0, nPos));
- }
+ OUString aSep(SD_LT_SEPARATOR);
+ sal_Int32 nPos = maLayoutName.indexOf(aSep);
+ if (nPos != -1)
+ FmFormPage::SetName(maLayoutName.copy(0, nPos));
}
}
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx
index d8ec4ec..f44cbce 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -90,10 +90,10 @@ void SdPage::SetPresentationLayout(const String& rLayoutName,
/*********************************************************************
|* Layoutname der Seite
\********************************************************************/
- String aOldLayoutName(maLayoutName); // merken
- maLayoutName = rLayoutName;
- maLayoutName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR ));
- maLayoutName += String(SdResId(STR_LAYOUT_OUTLINE));
+ OUString aOldLayoutName(maLayoutName); // merken
+ OUStringBuffer aBuf(rLayoutName);
+ aBuf.append(SD_LT_SEPARATOR).append(SdResId(STR_LAYOUT_OUTLINE).toString());
+ maLayoutName = aBuf.makeStringAndClear();
/*********************************************************************
|* ggf. Masterpage suchen und setzen
diff --git a/sd/source/core/stlfamily.cxx b/sd/source/core/stlfamily.cxx
index 7b32a4b..5024a81 100644
--- a/sd/source/core/stlfamily.cxx
+++ b/sd/source/core/stlfamily.cxx
@@ -62,7 +62,7 @@ typedef std::map< rtl::OUString, rtl::Reference< SdStyleSheet > > PresStyleMap;
struct SdStyleFamilyImpl
{
SdrPageWeakRef mxMasterPage;
- String maLayoutName;
+ OUString maLayoutName;
PresStyleMap& getStyleSheets();
rtl::Reference< SfxStyleSheetPool > mxPool;
diff --git a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
index 65ac625..10eec04 100644
--- a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
+++ b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
@@ -315,7 +315,7 @@ void DocumentHelper::AssignMasterPageToPageList (
// Make the layout name by stripping ouf the layout postfix from the
// layout name of the given master page.
- String sFullLayoutName (pMasterPage->GetLayoutName());
+ OUString sFullLayoutName(pMasterPage->GetLayoutName());
String sBaseLayoutName (sFullLayoutName);
sBaseLayoutName.Erase (sBaseLayoutName.SearchAscii (SD_LT_SEPARATOR));
@@ -329,8 +329,7 @@ void DocumentHelper::AssignMasterPageToPageList (
for (iPage=rpPageList->begin(); iPage!=rpPageList->end(); ++iPage)
{
OSL_ASSERT(*iPage!=NULL && (*iPage)->GetModel() == &rTargetDocument);
- if (*iPage != NULL
- && (*iPage)->GetLayoutName().CompareTo(sFullLayoutName)!=0)
+ if (*iPage != NULL && (*iPage)->GetLayoutName() != sFullLayoutName)
{
aCleanedList.push_back(*iPage);
}
diff --git a/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx b/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx
index 117bc36..5a00b6f 100644
--- a/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx
+++ b/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx
@@ -351,14 +351,13 @@ void MasterPagesSelector::AssignMasterPageToAllSlides (SdPage* pMasterPage)
// Get a list of all pages. As a little optimization we only
// include pages that do not already have the given master page
// assigned.
- String sFullLayoutName (pMasterPage->GetLayoutName());
+ OUString sFullLayoutName(pMasterPage->GetLayoutName());
::sd::slidesorter::SharedPageSelection pPageList (
new ::sd::slidesorter::SlideSorterViewShell::PageSelection());
for (sal_uInt16 nPageIndex=0; nPageIndex<nPageCount; nPageIndex++)
{
SdPage* pPage = mrDocument.GetSdPage (nPageIndex, PK_STANDARD);
- if (pPage != NULL
- && pPage->GetLayoutName().CompareTo(sFullLayoutName)!=0)
+ if (pPage != NULL && pPage->GetLayoutName() != sFullLayoutName)
{
pPageList->push_back (pPage);
}
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 54874de..183779a 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -891,9 +891,10 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
if( pNewPage )
{
SdrPageView* pPV = mpDrawView->GetSdrPageView();
-
- String sPageText (pNewPage->GetLayoutName());
- sPageText.Erase(sPageText.SearchAscii(SD_LT_SEPARATOR));
+ OUString sPageText(pNewPage->GetLayoutName());
+ sal_Int32 nPos = sPageText.indexOf(SD_LT_SEPARATOR);
+ if (nPos != -1)
+ sPageText = sPageText.copy(0, nPos);
if (pPV
&& pNewPage == dynamic_cast< SdPage* >( pPV->GetPage() )
&& sPageText == maTabControl.GetPageText(nSelectedPage+1))
@@ -918,7 +919,7 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
SdPage* pCurrentPage = dynamic_cast< SdPage* >( pPV->GetPage());
if (pPV
&& pNewPage == pCurrentPage
- && pNewPage->GetName() == maTabControl.GetPageText(nSelectedPage+1))
+ && maTabControl.GetPageText(nSelectedPage+1).equals(pNewPage->GetName()))
{
// this slide is already visible
return sal_True;
@@ -1049,7 +1050,7 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
}
maTabControl.SetCurPageId(nSelectedPage+1);
- String aPageName = mpActualPage->GetName();
+ OUString aPageName = mpActualPage->GetName();
if (maTabControl.GetPageText(nSelectedPage+1) != aPageName)
{
@@ -1117,8 +1118,10 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
}
}
- String aLayoutName(pMaster->GetLayoutName());
- aLayoutName.Erase(aLayoutName.SearchAscii(SD_LT_SEPARATOR));
+ OUString aLayoutName(pMaster->GetLayoutName());
+ sal_Int32 nPos = aLayoutName.indexOf(SD_LT_SEPARATOR);
+ if (nPos != -1)
+ aLayoutName = aLayoutName.copy(0, nPos);
maTabControl.SetCurPageId(nSelectedPage+1);
diff --git a/sd/source/ui/view/drviewsb.cxx b/sd/source/ui/view/drviewsb.cxx
index 0628fe7..a426419 100644
--- a/sd/source/ui/view/drviewsb.cxx
+++ b/sd/source/ui/view/drviewsb.cxx
@@ -825,7 +825,7 @@ void DrawViewShell::ModifyLayer (
for( nPos = 0; nPos < nPageCount; nPos++ )
{
sal_uInt16 nId = GetLayerTabControl()->GetPageId( nPos );
- if( pLayer->GetName() == GetLayerTabControl()->GetPageText( nId ) )
+ if (GetLayerTabControl()->GetPageText(nId).equals(pLayer->GetName()))
{
nCurPage = nId;
break;
diff --git a/svtools/inc/svtools/tabbar.hxx b/svtools/inc/svtools/tabbar.hxx
index 7a71ef4..1f30796 100644
--- a/svtools/inc/svtools/tabbar.hxx
+++ b/svtools/inc/svtools/tabbar.hxx
@@ -438,7 +438,7 @@ public:
virtual void EndRenaming();
virtual void Mirror();
- void InsertPage( sal_uInt16 nPageId, const XubString& rText,
+ void InsertPage( sal_uInt16 nPageId, const OUString& rText,
TabBarPageBits nBits = 0,
sal_uInt16 nPos = TabBar::APPEND );
void RemovePage( sal_uInt16 nPageId );
@@ -519,8 +519,8 @@ public:
const Color& GetSelectTextColor() const { return maSelTextColor; }
sal_Bool IsSelectTextColor() const { return mbSelTextColor; }
- void SetPageText( sal_uInt16 nPageId, const XubString& rText );
- XubString GetPageText( sal_uInt16 nPageId ) const;
+ void SetPageText( sal_uInt16 nPageId, const OUString& rText );
+ OUString GetPageText( sal_uInt16 nPageId ) const;
XubString GetHelpText( sal_uInt16 nPageId ) const;
rtl::OString GetHelpId( sal_uInt16 nPageId ) const;
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index 4aab204..2f9529a 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -69,7 +69,7 @@ void ButtonFrame::Draw( OutputDevice& rDev )
if ( aText.Len() )
{
- String aVal = rDev.GetEllipsisString(aText,aInnerRect.GetWidth() - 2*MIN_COLUMNWIDTH);
+ OUString aVal = rDev.GetEllipsisString(aText,aInnerRect.GetWidth() - 2*MIN_COLUMNWIDTH);
Font aFont( rDev.GetFont() );
sal_Bool bOldTransp = aFont.IsTransparent();
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index e844ef7..c096563 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -56,10 +56,10 @@ const sal_uInt16 ADDNEWPAGE_AREAWIDTH = 10;
struct ImplTabBarItem
{
- sal_uInt16 mnId;
+ sal_uInt16 mnId;
TabBarPageBits mnBits;
- XubString maText;
- XubString maHelpText;
+ OUString maText;
+ OUString maHelpText;
Rectangle maRect;
long mnWidth;
rtl::OString maHelpId;
@@ -69,7 +69,7 @@ struct ImplTabBarItem
Color maTabBgColor;
Color maTabTextColor;
- ImplTabBarItem( sal_uInt16 nItemId, const XubString& rText,
+ ImplTabBarItem( sal_uInt16 nItemId, const OUString& rText,
TabBarPageBits nPageBits ) :
maText( rText )
{
@@ -1392,7 +1392,7 @@ void TabBar::Paint( const Rectangle& rect )
bool bCustomBgColor = !pItem->IsDefaultTabBgColor() && !rStyleSettings.GetHighContrastMode();
bool bSpecialTab = (pItem->mnBits & TPB_SPECIAL);
bool bEnabled = pItem->mbEnable;
- String aText = pItem->mbShort ?
+ OUString aText = pItem->mbShort ?
GetEllipsisString(pItem->maText, mnCurMaxWidth, TEXT_DRAW_ENDELLIPSIS) : pItem->maText;
aDrawer.setRect(aRect);
@@ -1535,8 +1535,8 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt )
{
if ( rHEvt.GetMode() & HELPMODE_BALLOON )
{
- XubString aStr = GetHelpText( nItemId );
- if ( aStr.Len() )
+ OUString aStr = GetHelpText( nItemId );
+ if (!aStr.isEmpty())
{
Rectangle aItemRect = GetPageRect( nItemId );
Point aPt = OutputToScreenPixel( aItemRect.TopLeft() );
@@ -1578,8 +1578,8 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt )
aPt = OutputToScreenPixel( aItemRect.BottomRight() );
aItemRect.Right() = aPt.X();
aItemRect.Bottom() = aPt.Y();
- XubString aStr = (*mpItemList)[ nPos ]->maText;
- if ( aStr.Len() )
+ OUString aStr = (*mpItemList)[ nPos ]->maText;
+ if (!aStr.isEmpty())
{
if ( rHEvt.GetMode() & HELPMODE_BALLOON )
Help::ShowBalloon( this, aItemRect.Center(), aItemRect, aStr );
@@ -1823,7 +1823,7 @@ void TabBar::Mirror()
// -----------------------------------------------------------------------
-void TabBar::InsertPage( sal_uInt16 nPageId, const XubString& rText,
+void TabBar::InsertPage( sal_uInt16 nPageId, const OUString& rText,
TabBarPageBits nBits, sal_uInt16 nPos )
{
DBG_ASSERT( nPageId, "TabBar::InsertPage(): PageId == 0" );
@@ -2456,7 +2456,7 @@ void TabBar::SetMaxPageWidth( long nMaxWidth )
// -----------------------------------------------------------------------
-void TabBar::SetPageText( sal_uInt16 nPageId, const XubString& rText )
+void TabBar::SetPageText( sal_uInt16 nPageId, const OUString& rText )
{
sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
@@ -2474,13 +2474,12 @@ void TabBar::SetPageText( sal_uInt16 nPageId, const XubString& rText )
// -----------------------------------------------------------------------
-XubString TabBar::GetPageText( sal_uInt16 nPageId ) const
+OUString TabBar::GetPageText( sal_uInt16 nPageId ) const
{
sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
return (*mpItemList)[ nPos ]->maText;
- else
- return XubString();
+ return OUString();
}
// -----------------------------------------------------------------------
@@ -2491,7 +2490,7 @@ XubString TabBar::GetHelpText( sal_uInt16 nPageId ) const
if ( nPos != PAGE_NOT_FOUND )
{
ImplTabBarItem* pItem = (*mpItemList)[ nPos ];
- if ( !pItem->maHelpText.Len() && !pItem->maHelpId.isEmpty() )
+ if (pItem->maHelpText.isEmpty() && !pItem->maHelpId.isEmpty())
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
@@ -2500,8 +2499,7 @@ XubString TabBar::GetHelpText( sal_uInt16 nPageId ) const
return pItem->maHelpText;
}
- else
- return XubString();
+ return OUString();
}
// -----------------------------------------------------------------------
diff --git a/svx/inc/svx/svdpage.hxx b/svx/inc/svx/svdpage.hxx
index cc1761d..616f99b 100644
--- a/svx/inc/svx/svdpage.hxx
+++ b/svx/inc/svx/svdpage.hxx
@@ -546,7 +546,7 @@ public:
const SdrLayerAdmin& GetLayerAdmin() const { return *pLayerAdmin; }
SdrLayerAdmin& GetLayerAdmin() { return *pLayerAdmin; }
- virtual String GetLayoutName() const;
+ virtual OUString GetLayoutName() const;
// fuer's Raster im Writer, auch fuer AlignObjects wenn 1 Objekt markiert ist
// wenn pRect!=NULL, dann die Seiten, die von diesem Rect intersected werden
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 05434c4..5f69bbd 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -1759,9 +1759,9 @@ const SdrPageGridFrameList* SdrPage::GetGridFrameList(const SdrPageView* /*pPV*/
return NULL;
}
-XubString SdrPage::GetLayoutName() const
+OUString SdrPage::GetLayoutName() const
{
- return String();
+ return OUString();
}
void SdrPage::SetInserted( bool bIns )
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index b65c75a..e1721e9 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -638,7 +638,7 @@ public:
const XubString& rStr, sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK,
TextRectInfo* pInfo = NULL,
const ::vcl::ITextLayout* _pTextLayout = NULL ) const;
- XubString GetEllipsisString( const XubString& rStr, long nMaxWidth,
+ OUString GetEllipsisString( const XubString& rStr, long nMaxWidth,
sal_uInt16 nStyle = TEXT_DRAW_ENDELLIPSIS ) const;
void DrawCtrlText( const Point& rPos, const XubString& rStr,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 049b13e..d0428a7 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -6966,7 +6966,7 @@ static sal_Bool ImplIsCharIn( xub_Unicode c, const sal_Char* pStr )
// -----------------------------------------------------------------------
-String OutputDevice::GetEllipsisString( const String& rOrigStr, long nMaxWidth,
+OUString OutputDevice::GetEllipsisString( const String& rOrigStr, long nMaxWidth,
sal_uInt16 nStyle ) const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
More information about the Libreoffice-commits
mailing list