[Libreoffice-commits] core.git: include/sfx2 sc/source sd/source sfx2/source sw/inc sw/source

Ivan Timofeev timofeev.i.s at gmail.com
Wed Aug 14 07:46:02 PDT 2013


 include/sfx2/viewsh.hxx                |    4 -
 sc/source/ui/inc/prevwsh.hxx           |    4 -
 sc/source/ui/inc/tabvwsh.hxx           |    4 -
 sc/source/ui/inc/viewdata.hxx          |    4 -
 sc/source/ui/view/prevwsh.cxx          |   13 +--
 sc/source/ui/view/tabvwsh4.cxx         |    4 -
 sc/source/ui/view/viewdata.cxx         |   62 ++++++++----------
 sd/source/ui/inc/ViewShell.hxx         |    4 -
 sd/source/ui/inc/ViewShellBase.hxx     |    4 -
 sd/source/ui/view/ViewShellBase.cxx    |    4 -
 sd/source/ui/view/viewshe2.cxx         |    4 -
 sfx2/source/view/sfxbasecontroller.cxx |    5 -
 sfx2/source/view/viewsh.cxx            |    4 -
 sw/inc/shellio.hxx                     |    4 -
 sw/source/filter/basflt/fltini.cxx     |  111 ++++++++++++++++-----------------
 sw/source/ui/dbui/mmoutputpage.cxx     |    4 -
 sw/source/ui/dialog/ascfldlg.cxx       |    4 -
 sw/source/ui/inc/pview.hxx             |    6 -
 sw/source/ui/inc/view.hxx              |    4 -
 sw/source/ui/uiview/pview.cxx          |    2 
 sw/source/ui/uiview/view.cxx           |   42 ++++++------
 sw/source/ui/uiview/view1.cxx          |    2 
 sw/source/ui/uno/SwXFilterOptions.cxx  |    4 -
 23 files changed, 148 insertions(+), 155 deletions(-)

New commits:
commit dde3a753cead04915259d3fde0e913096f1a3922
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Wed Aug 14 18:41:28 2013 +0400

    convert Read/WriteUserData methods to OUString and bool
    
    Change-Id: I06a8158b7f503976b19383014a7c8a867c0184ea

diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index b09708e..9b5f0bc 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -219,8 +219,8 @@ public:
     Printer*                    GetActivePrinter() const;
 
     // Working set
-    virtual void                WriteUserData( String&, sal_Bool bBrowse = sal_False );
-    virtual void                ReadUserData( const String&, sal_Bool bBrowse = sal_False );
+    virtual void                WriteUserData( OUString&, bool bBrowse = false );
+    virtual void                ReadUserData( const OUString&, bool bBrowse = false );
     virtual void                WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
     virtual void                ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
     virtual void                QueryObjAreaPixel( Rectangle& rRect ) const;
diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx
index 8a49100..c358280 100644
--- a/sc/source/ui/inc/prevwsh.hxx
+++ b/sc/source/ui/inc/prevwsh.hxx
@@ -73,8 +73,8 @@ protected:
 
     virtual String  GetDescription() const;
 
-    virtual void    WriteUserData(String &, sal_Bool bBrowse = false);
-    virtual void    ReadUserData(const String &, sal_Bool bBrowse = false);
+    virtual void    WriteUserData(OUString &, bool bBrowse = false);
+    virtual void    ReadUserData(const OUString &, bool bBrowse = false);
 
     virtual void    WriteUserDataSequence (::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = false );
     virtual void    ReadUserDataSequence (const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = false );
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index a5da444..9ca90c8 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -217,8 +217,8 @@ protected:
     virtual sal_Bool    HasSelection( sal_Bool bText ) const;
     virtual String  GetDescription() const;
 
-    virtual void    WriteUserData(String &, sal_Bool bBrowse = false);
-    virtual void    ReadUserData(const String &, sal_Bool bBrowse = false);
+    virtual void    WriteUserData(OUString &, bool bBrowse = false);
+    virtual void    ReadUserData(const OUString &, bool bBrowse = false);
     virtual void    WriteUserDataSequence (::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = false );
     virtual void    ReadUserDataSequence (const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = false );
 
diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 2ea9689..ca90f3e 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -252,8 +252,8 @@ public:
 
     void            UpdateInputHandler( sal_Bool bForce = false, sal_Bool bStopEditing = sal_True );
 
-    void            WriteUserData(String& rData);
-    void            ReadUserData(const String& rData);
+    void            WriteUserData(OUString& rData);
+    void            ReadUserData(const OUString& rData);
     void            WriteExtOptions( ScExtDocOptions& rOpt ) const;
     void            ReadExtOptions( const ScExtDocOptions& rOpt );
     void            WriteUserDataSequence(com::sun::star::uno::Sequence <com::sun::star::beans::PropertyValue>& rSettings) const;
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 710fe9f..cc672da 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -922,24 +922,23 @@ void ScPreviewShell::FillFieldData( ScHeaderFieldData& rData )
     //  the dialog knows eNumType
 }
 
-void ScPreviewShell::WriteUserData(String& rData, sal_Bool /* bBrowse */)
+void ScPreviewShell::WriteUserData(OUString& rData, bool /* bBrowse */)
 {
     //  nZoom
     //  nPageNo
 
     rData =  OUString::number(pPreview->GetZoom());
-    rData += (sal_Unicode) SC_USERDATA_SEP;
+    rData += OUString(SC_USERDATA_SEP);
     rData += OUString::number(pPreview->GetPageNo());
 }
 
-void ScPreviewShell::ReadUserData(const String& rData, sal_Bool /* bBrowse */)
+void ScPreviewShell::ReadUserData(const OUString& rData, bool /* bBrowse */)
 {
-    xub_StrLen nCount = comphelper::string::getTokenCount(rData, ';');
-    if (nCount)
+    if (!rData.isEmpty())
     {
         sal_Int32 nIndex = 0;
-        pPreview->SetZoom((sal_uInt16)rData.GetToken( 0, SC_USERDATA_SEP, nIndex ).ToInt32());
-        pPreview->SetPageNo(rData.GetToken( 0, SC_USERDATA_SEP, nIndex ).ToInt32());
+        pPreview->SetZoom((sal_uInt16)rData.getToken(0, SC_USERDATA_SEP, nIndex).toInt32());
+        pPreview->SetPageNo(rData.getToken(0, SC_USERDATA_SEP, nIndex).toInt32());
         eZoom = SVX_ZOOM_PERCENT;
     }
 }
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index b1d5589..33478ae 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -477,7 +477,7 @@ void ScTabViewShell::ShowCursor(bool /* bOn */)
 
 //------------------------------------------------------------------
 
-void ScTabViewShell::WriteUserData(String& rData, sal_Bool /* bBrowse */)
+void ScTabViewShell::WriteUserData(OUString& rData, bool /* bBrowse */)
 {
     GetViewData()->WriteUserData(rData);
 }
@@ -487,7 +487,7 @@ void ScTabViewShell::WriteUserDataSequence (uno::Sequence < beans::PropertyValue
     GetViewData()->WriteUserDataSequence (rSettings);
 }
 
-void ScTabViewShell::ReadUserData(const String& rData, sal_Bool /* bBrowse */)
+void ScTabViewShell::ReadUserData(const OUString& rData, bool /* bBrowse */)
 {
     if ( !GetViewData()->GetDocShell()->IsPreview() )
         DoReadUserData( rData );
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 2bfc181..61be5da 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -2172,7 +2172,7 @@ void ScViewData::CalcPPT()
 #define SC_OLD_TABSEP   '/'
 #define SC_NEW_TABSEP   '+'
 
-void ScViewData::WriteUserData(String& rData)
+void ScViewData::WriteUserData(OUString& rData)
 {
     //  nZoom (bis 364v) oder nZoom/nPageZoom/bPageMode (ab 364w)
     //  nTab
@@ -2187,9 +2187,9 @@ void ScViewData::WriteUserData(String& rData)
     nZoom = (sal_uInt16)((pThisTab->aPageZoomY.GetNumerator() * 100) / pThisTab->aPageZoomY.GetDenominator());
     rData += OUString::number( nZoom ) + "/";
     if (bPagebreak)
-        rData += '1';
+        rData += "1";
     else
-        rData += '0';
+        rData += "0";
 
     rData += ";" + OUString::number( nTabNo ) + ";" + TAG_TABBARWIDTH +
              OUString::number( pView->GetTabBarWidth() );
@@ -2197,7 +2197,7 @@ void ScViewData::WriteUserData(String& rData)
     SCTAB nTabCount = pDoc->GetTableCount();
     for (SCTAB i=0; i<nTabCount; i++)
     {
-        rData += ';';                   // Numerierung darf auf keinen Fall durcheinanderkommen
+        rData += ";";                   // Numerierung darf auf keinen Fall durcheinanderkommen
         if (i < static_cast<SCTAB>(maTabData.size()) && maTabData[i])
         {
             OUString cTabSep = OUString(SC_OLD_TABSEP);                // wie 3.1
@@ -2233,12 +2233,12 @@ void ScViewData::WriteUserData(String& rData)
     }
 }
 
-void ScViewData::ReadUserData(const String& rData)
+void ScViewData::ReadUserData(const OUString& rData)
 {
-    if (!rData.Len())       // Leerer String kommt bei "neu Laden"
+    if (rData.isEmpty())       // Leerer String kommt bei "neu Laden"
         return;             // dann auch ohne Assertion beenden
 
-    xub_StrLen nCount = comphelper::string::getTokenCount(rData, ';');
+    sal_Int32 nCount = comphelper::string::getTokenCount(rData, ';');
     if ( nCount <= 2 )
     {
         //  beim Reload in der Seitenansicht sind evtl. die Preview-UserData
@@ -2247,40 +2247,38 @@ void ScViewData::ReadUserData(const String& rData)
         return;
     }
 
-    String aTabOpt;
-    xub_StrLen nTagLen = RTL_CONSTASCII_LENGTH(TAG_TABBARWIDTH);
-
     // nicht pro Tabelle:
     SCTAB nTabStart = 2;
 
     Fraction aZoomX, aZoomY, aPageZoomX, aPageZoomY;    //! evaluate (all sheets?)
 
-    String aZoomStr = rData.GetToken(0);                        // Zoom/PageZoom/Modus
-    sal_uInt16 nNormZoom = sal::static_int_cast<sal_uInt16>(aZoomStr.GetToken(0,'/').ToInt32());
+    OUString aZoomStr = rData.getToken(0, ';');                 // Zoom/PageZoom/Modus
+    sal_uInt16 nNormZoom = sal::static_int_cast<sal_uInt16>(aZoomStr.getToken(0,'/').toInt32());
     if ( nNormZoom >= MINZOOM && nNormZoom <= MAXZOOM )
         aZoomX = aZoomY = Fraction( nNormZoom, 100 );           //  "normaler" Zoom (immer)
-    sal_uInt16 nPageZoom = sal::static_int_cast<sal_uInt16>(aZoomStr.GetToken(1,'/').ToInt32());
+    sal_uInt16 nPageZoom = sal::static_int_cast<sal_uInt16>(aZoomStr.getToken(1,'/').toInt32());
     if ( nPageZoom >= MINZOOM && nPageZoom <= MAXZOOM )
         aPageZoomX = aPageZoomY = Fraction( nPageZoom, 100 );   // Pagebreak-Zoom, wenn gesetzt
-    sal_Unicode cMode = aZoomStr.GetToken(2,'/').GetChar(0);    // 0 oder "0"/"1"
+    sal_Unicode cMode = aZoomStr.getToken(2,'/')[0];            // 0 oder "0"/"1"
     SetPagebreakMode( cMode == '1' );
     // SetPagebreakMode muss immer gerufen werden wegen CalcPPT / RecalcPixPos()
 
     //
     //  Tabelle kann ungueltig geworden sein (z.B. letzte Version):
     //
-    SCTAB nNewTab = static_cast<SCTAB>(rData.GetToken(1).ToInt32());
+    SCTAB nNewTab = static_cast<SCTAB>(rData.getToken(1, ';').toInt32());
     if (pDoc->HasTable( nNewTab ))
         SetTabNo(nNewTab);
 
     //
     // wenn vorhanden, TabBar-Breite holen:
     //
-    aTabOpt = rData.GetToken(2);
+    OUString aTabOpt = rData.getToken(2, ';');
 
-    if ( nTagLen && aTabOpt.Copy(0,nTagLen).EqualsAscii(TAG_TABBARWIDTH) )
+    if (aTabOpt.startsWith(TAG_TABBARWIDTH))
     {
-        pView->SetTabBarWidth( aTabOpt.Copy(nTagLen).ToInt32() );
+        sal_Int32 nTagLen = RTL_CONSTASCII_LENGTH(TAG_TABBARWIDTH);
+        pView->SetTabBarWidth(aTabOpt.copy(nTagLen).toInt32());
         nTabStart = 3;
     }
 
@@ -2288,7 +2286,7 @@ void ScViewData::ReadUserData(const String& rData)
     SCTAB nPos = 0;
     while ( nCount > nPos+nTabStart )
     {
-        aTabOpt = rData.GetToken(static_cast<xub_StrLen>(nPos+nTabStart));
+        aTabOpt = rData.getToken(static_cast<sal_Int32>(nPos+nTabStart), ';');
         EnsureTabDataSize(nPos + 1);
         if (!maTabData[nPos])
             maTabData[nPos] = new ScViewDataTable;
@@ -2304,32 +2302,32 @@ void ScViewData::ReadUserData(const String& rData)
 
         if (cTabSep)
         {
-            maTabData[nPos]->nCurX = SanitizeCol( static_cast<SCCOL>(aTabOpt.GetToken(0,cTabSep).ToInt32()));
-            maTabData[nPos]->nCurY = SanitizeRow( aTabOpt.GetToken(1,cTabSep).ToInt32());
-            maTabData[nPos]->eHSplitMode = (ScSplitMode) aTabOpt.GetToken(2,cTabSep).ToInt32();
-            maTabData[nPos]->eVSplitMode = (ScSplitMode) aTabOpt.GetToken(3,cTabSep).ToInt32();
+            maTabData[nPos]->nCurX = SanitizeCol( static_cast<SCCOL>(aTabOpt.getToken(0,cTabSep).toInt32()));
+            maTabData[nPos]->nCurY = SanitizeRow( aTabOpt.getToken(1,cTabSep).toInt32());
+            maTabData[nPos]->eHSplitMode = (ScSplitMode) aTabOpt.getToken(2,cTabSep).toInt32();
+            maTabData[nPos]->eVSplitMode = (ScSplitMode) aTabOpt.getToken(3,cTabSep).toInt32();
 
             if ( maTabData[nPos]->eHSplitMode == SC_SPLIT_FIX )
             {
-                maTabData[nPos]->nFixPosX = SanitizeCol( static_cast<SCCOL>(aTabOpt.GetToken(4,cTabSep).ToInt32()));
+                maTabData[nPos]->nFixPosX = SanitizeCol( static_cast<SCCOL>(aTabOpt.getToken(4,cTabSep).toInt32()));
                 UpdateFixX(nPos);
             }
             else
-                maTabData[nPos]->nHSplitPos = aTabOpt.GetToken(4,cTabSep).ToInt32();
+                maTabData[nPos]->nHSplitPos = aTabOpt.getToken(4,cTabSep).toInt32();
 
             if ( maTabData[nPos]->eVSplitMode == SC_SPLIT_FIX )
             {
-                maTabData[nPos]->nFixPosY = SanitizeRow( aTabOpt.GetToken(5,cTabSep).ToInt32());
+                maTabData[nPos]->nFixPosY = SanitizeRow( aTabOpt.getToken(5,cTabSep).toInt32());
                 UpdateFixY(nPos);
             }
             else
-                maTabData[nPos]->nVSplitPos = aTabOpt.GetToken(5,cTabSep).ToInt32();
+                maTabData[nPos]->nVSplitPos = aTabOpt.getToken(5,cTabSep).toInt32();
 
-            maTabData[nPos]->eWhichActive = (ScSplitPos) aTabOpt.GetToken(6,cTabSep).ToInt32();
-            maTabData[nPos]->nPosX[0] = SanitizeCol( static_cast<SCCOL>(aTabOpt.GetToken(7,cTabSep).ToInt32()));
-            maTabData[nPos]->nPosX[1] = SanitizeCol( static_cast<SCCOL>(aTabOpt.GetToken(8,cTabSep).ToInt32()));
-            maTabData[nPos]->nPosY[0] = SanitizeRow( aTabOpt.GetToken(9,cTabSep).ToInt32());
-            maTabData[nPos]->nPosY[1] = SanitizeRow( aTabOpt.GetToken(10,cTabSep).ToInt32());
+            maTabData[nPos]->eWhichActive = (ScSplitPos) aTabOpt.getToken(6,cTabSep).toInt32();
+            maTabData[nPos]->nPosX[0] = SanitizeCol( static_cast<SCCOL>(aTabOpt.getToken(7,cTabSep).toInt32()));
+            maTabData[nPos]->nPosX[1] = SanitizeCol( static_cast<SCCOL>(aTabOpt.getToken(8,cTabSep).toInt32()));
+            maTabData[nPos]->nPosY[0] = SanitizeRow( aTabOpt.getToken(9,cTabSep).toInt32());
+            maTabData[nPos]->nPosY[1] = SanitizeRow( aTabOpt.getToken(10,cTabSep).toInt32());
 
             //  Test, ob der aktive Teil laut SplitMode ueberhaupt existiert
             //  (Bug #44516#)
diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx
index a136480..e44ee40 100644
--- a/sd/source/ui/inc/ViewShell.hxx
+++ b/sd/source/ui/inc/ViewShell.hxx
@@ -233,8 +233,8 @@ public:
     void SetFrameView (FrameView* pFrameView);
     virtual void  ReadFrameViewData(FrameView* pView);
     virtual void  WriteFrameViewData();
-    virtual void  WriteUserData(String& rString);
-    virtual void  ReadUserData(const String& rString);
+    virtual void  WriteUserData(OUString& rString);
+    virtual void  ReadUserData(const OUString& rString);
 
     virtual sal_Bool  ActivateObject(SdrOle2Obj* pObj, long nVerb);
 
diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx
index dc1cc4e..ca59597 100644
--- a/sd/source/ui/inc/ViewShellBase.hxx
+++ b/sd/source/ui/inc/ViewShellBase.hxx
@@ -162,8 +162,8 @@ public:
         const Fraction &rZoomX,
         const Fraction &rZoomY);
     virtual sal_uInt16 PrepareClose (sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False);
-    virtual void WriteUserData (String&, sal_Bool bBrowse = sal_False);
-    virtual void ReadUserData (const String&, sal_Bool bBrowse = sal_False);
+    virtual void WriteUserData (OUString&, bool bBrowse = false);
+    virtual void ReadUserData (const OUString&, bool bBrowse = false);
     virtual SdrView* GetDrawView (void) const;
     virtual void AdjustPosSizePixel (const Point &rOfs, const Size &rSize);
 
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index 4c6817f..7228dd8 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -864,7 +864,7 @@ sal_uInt16 ViewShellBase::PrepareClose (sal_Bool bUI, sal_Bool bForBrowsing)
 
 
 
-void ViewShellBase::WriteUserData (String& rString, sal_Bool bBrowse)
+void ViewShellBase::WriteUserData (OUString& rString, bool bBrowse)
 {
     SfxViewShell::WriteUserData (rString, bBrowse);
 
@@ -877,7 +877,7 @@ void ViewShellBase::WriteUserData (String& rString, sal_Bool bBrowse)
 
 
 
-void ViewShellBase::ReadUserData (const String& rString, sal_Bool bBrowse)
+void ViewShellBase::ReadUserData (const OUString& rString, bool bBrowse)
 {
     SfxViewShell::ReadUserData (rString, bBrowse);
 
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx
index cf055d0..b6d7c5f 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -906,7 +906,7 @@ const Rectangle& ViewShell::GetAllWindowRect()
     return maAllWindowRectangle;
 }
 
-void ViewShell::ReadUserData(const String&)
+void ViewShell::ReadUserData(const OUString&)
 {
     // zoom onto VisArea from FrameView
     GetViewShell()->GetViewFrame()->GetDispatcher()->Execute(SID_SIZE_VISAREA,
@@ -914,7 +914,7 @@ void ViewShell::ReadUserData(const String&)
 }
 
 
-void ViewShell::WriteUserData(String&)
+void ViewShell::WriteUserData(OUString&)
 {
     // writing of our data is always done in WriteFrameViewData()
     WriteFrameViewData();
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 6e22e94..93c217d 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -667,12 +667,11 @@ sal_Bool SAL_CALL SfxBaseController::suspend( sal_Bool bSuspend ) throw( Runtime
 uno::Any SfxBaseController::getViewData() throw( RuntimeException )
 {
     uno::Any         aAny;
-    String      sData1;
+    OUString sData;
     SolarMutexGuard aGuard;
     if ( m_pData->m_pViewShell )
     {
-        m_pData->m_pViewShell->WriteUserData( sData1 ) ;
-        OUString    sData( sData1 );
+        m_pData->m_pViewShell->WriteUserData( sData ) ;
         aAny <<= sData ;
     }
 
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index b4387cb..995a000 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1468,13 +1468,13 @@ void SfxViewShell::PushSubShells_Impl( sal_Bool bPush )
 
 //--------------------------------------------------------------------
 
-void SfxViewShell::WriteUserData( String&, sal_Bool )
+void SfxViewShell::WriteUserData( OUString&, bool )
 {
 }
 
 //--------------------------------------------------------------------
 
-void SfxViewShell::ReadUserData(const String&, sal_Bool )
+void SfxViewShell::ReadUserData(const OUString&, bool )
 {
 }
 
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index fa3f34b..b58dcef 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -90,8 +90,8 @@ public:
         nLanguage = 0;
     }
     // for the automatic conversion (mail/news/...)
-    void ReadUserData( const String& );
-    void WriteUserData( String& );
+    void ReadUserData( const OUString& );
+    void WriteUserData( OUString& );
 
     SwAsciiOptions() { Reset(); }
 };
diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx
index 963156e..f90d0e3 100644
--- a/sw/source/filter/basflt/fltini.cxx
+++ b/sw/source/filter/basflt/fltini.cxx
@@ -598,71 +598,70 @@ String NameFromCharSet(rtl_TextEncoding nChrSet)
 // the delimetercharacter is ","
 //
 
-void SwAsciiOptions::ReadUserData( const String& rStr )
+void SwAsciiOptions::ReadUserData( const OUString& rStr )
 {
-        sal_Int32 nToken = 0;
-        sal_uInt16 nCnt = 0;
-        String sToken;
-        do {
-                if( 0 != (sToken = rStr.GetToken( 0, ',', nToken )).Len() )
-                {
-                        switch( nCnt )
-                        {
-                        case 0:         // CharSet
+    sal_Int32 nToken = 0;
+    sal_uInt16 nCnt = 0;
+    OUString sToken;
+    do {
+        if( !(sToken = rStr.getToken( 0, ',', nToken )).isEmpty() )
+        {
+            switch( nCnt )
+            {
+            case 0:         // CharSet
                 eCharSet = CharSetFromName(sToken);
-                                break;
-                        case 1:         // LineEnd
-                                if( sToken.EqualsIgnoreCaseAscii( "CRLF" ))
-                                        eCRLF_Flag = LINEEND_CRLF;
-                                else if( sToken.EqualsIgnoreCaseAscii( "LF" ))
-                                        eCRLF_Flag = LINEEND_LF;
-                                else
-                                        eCRLF_Flag = LINEEND_CR;
-                                break;
-                        case 2:         // fontname
-                                sFont = sToken;
-                                break;
-                        case 3:         // Language
+                break;
+            case 1:         // LineEnd
+                if( sToken.equalsIgnoreAsciiCase( "CRLF" ))
+                    eCRLF_Flag = LINEEND_CRLF;
+                else if( sToken.equalsIgnoreAsciiCase( "LF" ))
+                    eCRLF_Flag = LINEEND_LF;
+                else
+                    eCRLF_Flag = LINEEND_CR;
+                break;
+            case 2:         // fontname
+                sFont = sToken;
+                break;
+            case 3:         // Language
                 nLanguage = LanguageTag::convertToLanguageType( sToken );
-                                break;
-                        }
-                }
-                ++nCnt;
-        } while( -1 != nToken );
+                break;
+            }
+        }
+        ++nCnt;
+    } while( -1 != nToken );
 }
 
-void SwAsciiOptions::WriteUserData( String& rStr )
+void SwAsciiOptions::WriteUserData(OUString& rStr)
 {
-        // 1. charset
-        rStr = NameFromCharSet(eCharSet);
-        rStr += ',';
+    // 1. charset
+    rStr = NameFromCharSet(eCharSet);
+    rStr += ",";
 
-        // 2. LineEnd
-        switch(eCRLF_Flag)
-        {
-        case LINEEND_CRLF:
-            rStr.AppendAscii( "CRLF" );
-            break;
-        case LINEEND_CR:
-            rStr.AppendAscii(  "CR" );
-            break;
-        case LINEEND_LF:
-            rStr.AppendAscii(  "LF" );
-            break;
-        }
-        rStr += ',';
+    // 2. LineEnd
+    switch(eCRLF_Flag)
+    {
+    case LINEEND_CRLF:
+        rStr += "CRLF";
+        break;
+    case LINEEND_CR:
+        rStr += "CR";
+        break;
+    case LINEEND_LF:
+        rStr += "LF";
+        break;
+    }
+    rStr += ",";
 
-        // 3. Fontname
-        rStr += sFont;
-        rStr += ',';
+    // 3. Fontname
+    rStr += sFont;
+    rStr += ",";
 
-        // 4. Language
-        if (nLanguage)
-        {
-        OUString sTmp = LanguageTag::convertToBcp47( nLanguage );
-        rStr += (String)sTmp;
-        }
-        rStr += ',';
+    // 4. Language
+    if (nLanguage)
+    {
+        rStr += LanguageTag::convertToBcp47(nLanguage);
+    }
+    rStr += ",";
 }
 
 #ifdef DISABLE_DYNLOADING
diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index cf3d9b0..7d239ae 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -1139,7 +1139,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
     if(!sEMailColumn.Len() || !xColAccess.is() || !xColAccess->hasByName(sEMailColumn))
         return 0;
 
-    String sFilterOptions;
+    OUString sFilterOptions;
     if(MM_DOCTYPE_TEXT == nDocType)
     {
         SwAsciiOptions aOpt;
@@ -1212,7 +1212,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
             if(MM_DOCTYPE_TEXT == nDocType)
             {
                 pFilterValues[1].Name = "FilterOptions";
-                pFilterValues[1].Value <<= OUString(sFilterOptions);
+                pFilterValues[1].Value <<= sFilterOptions;
             }
 
             uno::Reference< frame::XStorable > xTempStore( pTempView->GetDocShell()->GetModel(), uno::UNO_QUERY);
diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx
index b808142..bad86da 100644
--- a/sw/source/ui/dialog/ascfldlg.cxx
+++ b/sw/source/ui/dialog/ascfldlg.cxx
@@ -259,9 +259,9 @@ void SwAsciiFilterDlg::FillOptions( SwAsciiOptions& rOptions )
     rOptions.SetParaFlags( GetCRLF() );
 
     // save the user settings
-    String sData;
+    OUString sData;
     rOptions.WriteUserData( sData );
-    if( sData.Len() )
+    if (!sData.isEmpty())
     {
         const OUString sFindNm = OUString::createFromAscii(
                                     m_pFontLB->IsVisible() ? sDialogImpExtraData
diff --git a/sw/source/ui/inc/pview.hxx b/sw/source/ui/inc/pview.hxx
index fbb8a72..3ca1ebc 100644
--- a/sw/source/ui/inc/pview.hxx
+++ b/sw/source/ui/inc/pview.hxx
@@ -151,9 +151,9 @@ class SW_DLLPUBLIC SwPagePreView: public SfxViewShell
     // current dispatcher shell
     SwPagePreViewWin        aViewWin;
     //viewdata of the previous SwView and the new crsrposition
-    String                  sSwViewData,
+    OUString                sSwViewData;
     //and the new cursor position if the user double click in the PagePreView
-                            sNewCrsrPos;
+    String                  sNewCrsrPos;
     // to support keyboard the number of the page to go to can be set too
     sal_uInt16                  nNewPage;
     // visible range
@@ -246,7 +246,7 @@ public:
 
     sal_Bool            HandleWheelCommands( const CommandEvent& );
 
-    const String&   GetPrevSwViewData() const       { return sSwViewData; }
+    OUString        GetPrevSwViewData() const       { return sSwViewData; }
     void            SetNewCrsrPos( const String& rStr ) { sNewCrsrPos = rStr; }
     const String&   GetNewCrsrPos() const           { return sNewCrsrPos; }
 
diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
index d7f538d..cd7a323 100644
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -598,8 +598,8 @@ public:
     // so that in the SubShells' DTors m_pShell can be reset if applicable
     void ResetSubShell()    { m_pShell = 0; }
 
-    virtual void    WriteUserData(String &, sal_Bool bBrowse = sal_False );
-    virtual void    ReadUserData(const String &, sal_Bool bBrowse = sal_False );
+    virtual void    WriteUserData(OUString &, bool bBrowse = false);
+    virtual void    ReadUserData(const OUString &, bool bBrowse = false);
     virtual void    ReadUserDataSequence ( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse );
     virtual void    WriteUserDataSequence ( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse );
 
diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx
index 838462d..ca2c767 100644
--- a/sw/source/ui/uiview/pview.cxx
+++ b/sw/source/ui/uiview/pview.cxx
@@ -1185,7 +1185,7 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
         {
             pVS = ((SwView*)pOldSh)->GetWrtShellPtr();
             // save the current ViewData of the previous SwView
-            pOldSh->WriteUserData( sSwViewData, sal_False );
+            pOldSh->WriteUserData( sSwViewData, false );
         }
         else
             pVS = GetDocShell()->GetWrtShell();
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index 94fd75e..129c1d7 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -1086,7 +1086,7 @@ SwDocShell* SwView::GetDocShell()
 
 // Remember CursorPos
 
-void SwView::WriteUserData( String &rUserData, sal_Bool bBrowse )
+void SwView::WriteUserData( OUString &rUserData, bool bBrowse )
 {
     // The browse flag will be passed from Sfx when documents are browsed
     // (not to be confused with the BrowseMode).
@@ -1096,23 +1096,23 @@ void SwView::WriteUserData( String &rUserData, sal_Bool bBrowse )
     const Rectangle& rVis = GetVisArea();
 
     rUserData = OUString::number( rRect.Left() );
-    rUserData += ';';
+    rUserData += ";";
     rUserData += OUString::number( rRect.Top() );
-    rUserData += ';';
+    rUserData += ";";
     rUserData += OUString::number( m_pWrtShell->GetViewOptions()->GetZoom() );
-    rUserData += ';';
+    rUserData += ";";
     rUserData += OUString::number( rVis.Left() );
-    rUserData += ';';
+    rUserData += ";";
     rUserData += OUString::number( rVis.Top() );
-    rUserData += ';';
+    rUserData += ";";
     rUserData += OUString::number( bBrowse ? SAL_MIN_INT32 : rVis.Right());
-    rUserData += ';';
+    rUserData += ";";
     rUserData += OUString::number( bBrowse ? SAL_MIN_INT32 : rVis.Bottom());
-    rUserData += ';';
+    rUserData += ";";
     rUserData += OUString::number(
             (sal_uInt16)m_pWrtShell->GetViewOptions()->GetZoomType());//eZoom;
-    rUserData += ';';
-    rUserData += FRMTYPE_NONE == m_pWrtShell->GetSelFrmType() ? '0' : '1';
+    rUserData += ";";
+    rUserData += FRMTYPE_NONE == m_pWrtShell->GetSelFrmType() ? OUString("0") : OUString("1");
 }
 
 // Set CursorPos
@@ -1131,7 +1131,7 @@ static bool lcl_IsOwnDocument( SwView& rView )
             (!Changed.Len() && Created.Len() && Created == FullName );
 }
 
-void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse )
+void SwView::ReadUserData( const OUString &rUserData, bool bBrowse )
 {
     if ( comphelper::string::getTokenCount(rUserData, ';') > 1 &&
         // For document without layout only in the onlinelayout or
@@ -1146,17 +1146,17 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse )
 
         // No it is *no* good idea to call GetToken within Point-Konstr. immediately,
         // because which parameter is evaluated first?
-        long nX = rUserData.GetToken( 0, ';', nPos ).ToInt32(),
-             nY = rUserData.GetToken( 0, ';', nPos ).ToInt32();
+        long nX = rUserData.getToken( 0, ';', nPos ).toInt32(),
+             nY = rUserData.getToken( 0, ';', nPos ).toInt32();
         Point aCrsrPos( nX, nY );
 
         sal_uInt16 nZoomFactor =
-            static_cast< sal_uInt16 >( rUserData.GetToken(0, ';', nPos ).ToInt32() );
+            static_cast< sal_uInt16 >( rUserData.getToken(0, ';', nPos ).toInt32() );
 
-        long nLeft  = rUserData.GetToken(0, ';', nPos ).ToInt32(),
-             nTop   = rUserData.GetToken(0, ';', nPos ).ToInt32(),
-             nRight = rUserData.GetToken(0, ';', nPos ).ToInt32(),
-             nBottom= rUserData.GetToken(0, ';', nPos ).ToInt32();
+        long nLeft  = rUserData.getToken(0, ';', nPos ).toInt32(),
+             nTop   = rUserData.getToken(0, ';', nPos ).toInt32(),
+             nRight = rUserData.getToken(0, ';', nPos ).toInt32(),
+             nBottom= rUserData.getToken(0, ';', nPos ).toInt32();
 
         const long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
         if ( nBottom <= (m_pWrtShell->GetDocSize().Height()+nAdd) )
@@ -1165,17 +1165,17 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse )
 
             const Rectangle aVis( nLeft, nTop, nRight, nBottom );
 
-            sal_uInt16 nOff = 0;
+            sal_Int32 nOff = 0;
             SvxZoomType eZoom;
             if( !m_pWrtShell->GetViewOptions()->getBrowseMode() )
-                eZoom = (SvxZoomType) (sal_uInt16)rUserData.GetToken(nOff, ';', nPos ).ToInt32();
+                eZoom = (SvxZoomType) (sal_uInt16)rUserData.getToken(nOff, ';', nPos ).toInt32();
             else
             {
                 eZoom = SVX_ZOOM_PERCENT;
                 ++nOff;
             }
 
-            sal_Bool bSelectObj = (0 != rUserData.GetToken( nOff, ';', nPos ).ToInt32())
+            sal_Bool bSelectObj = (0 != rUserData.getToken( nOff, ';', nPos ).toInt32())
                                 && m_pWrtShell->IsObjSelectable( aCrsrPos );
 
             // restore editing position
diff --git a/sw/source/ui/uiview/view1.cxx b/sw/source/ui/uiview/view1.cxx
index c97a4ae..35edaf8 100644
--- a/sw/source/ui/uiview/view1.cxx
+++ b/sw/source/ui/uiview/view1.cxx
@@ -77,7 +77,7 @@ void SwView::Activate(sal_Bool bMDIActivate)
 
         if( m_sSwViewData.Len() )
         {
-            ReadUserData( m_sSwViewData, sal_False );
+            ReadUserData(m_sSwViewData, false);
             m_sSwViewData.Erase();
         }
 
diff --git a/sw/source/ui/uno/SwXFilterOptions.cxx b/sw/source/ui/uno/SwXFilterOptions.cxx
index 7ea106d..8d73f13 100644
--- a/sw/source/ui/uno/SwXFilterOptions.cxx
+++ b/sw/source/ui/uno/SwXFilterOptions.cxx
@@ -126,9 +126,7 @@ sal_Int16 SwXFilterOptions::execute() throw (uno::RuntimeException)
         {
             SwAsciiOptions aOptions;
             pAsciiDlg->FillOptions( aOptions );
-            String sTmp;
-            aOptions.WriteUserData(sTmp);
-            sFilterOptions = sTmp;
+            aOptions.WriteUserData(sFilterOptions);
             nRet = ui::dialogs::ExecutableDialogResults::OK;
         }
         delete pAsciiDlg;


More information about the Libreoffice-commits mailing list