[Libreoffice-commits] .: 7 commits - sc/source svtools/source sw/source unusedcode.easy vcl/inc vcl/source

Caolán McNamara caolan at kemper.freedesktop.org
Mon Nov 7 15:10:36 PST 2011


 sc/source/core/data/document.cxx                |    2 -
 svtools/source/contnr/fileview.cxx              |   20 +++++-----
 svtools/source/control/ctrlbox.cxx              |   16 ++++----
 svtools/source/control/ctrltool.cxx             |    5 +-
 svtools/source/edit/syntaxhighlight.cxx         |    8 ++--
 svtools/source/edit/texteng.cxx                 |    5 +-
 svtools/source/filter/SvFilterOptionsDialog.cxx |    3 -
 svtools/source/filter/exportdialog.cxx          |   37 +++++++++----------
 svtools/source/filter/filter.cxx                |   12 ++----
 svtools/source/filter/wmf/winmtf.cxx            |   16 ++++----
 svtools/source/graphic/graphicunofactory.cxx    |    2 -
 svtools/source/graphic/grfmgr.cxx               |    4 +-
 svtools/source/graphic/provider.cxx             |   10 +++--
 svtools/source/misc/imap.cxx                    |   17 ++++----
 svtools/source/svhtml/htmlout.cxx               |    4 +-
 svtools/source/svhtml/parhtml.cxx               |    7 ++-
 svtools/source/urlobj/inetimg.cxx               |    7 ++-
 sw/source/ui/dialog/wordcountdialog.cxx         |   41 ++++++++-------------
 sw/source/ui/dialog/wordcountdialog.src         |    6 ---
 sw/source/ui/inc/wordcountdialog.hxx            |    2 -
 unusedcode.easy                                 |    2 -
 vcl/inc/vcl/graph.hxx                           |    3 -
 vcl/source/gdi/graph.cxx                        |   46 ------------------------
 23 files changed, 108 insertions(+), 167 deletions(-)

New commits:
commit f6b9a2f4d4d89f798b890d0324fdb520bcbcde0f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Nov 7 23:08:45 2011 +0000

    unit test crash: this must be the intended code

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 78cd569..117c615 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -1147,7 +1147,7 @@ bool ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab,
 
         //  UpdateRef for drawing layer must be after inserting,
         //  when the new row heights are known.
-        for (i=nStartTab; i<=nEndTab && static_cast<SCTAB>(maTabs.size()); i++)
+        for (i=nStartTab; i<=nEndTab && i < static_cast<SCTAB>(maTabs.size()); i++)
             if (maTabs[i] && (!pTabMark || pTabMark->GetTableSelect(i)))
                 maTabs[i]->UpdateDrawRef( URM_INSDEL,
                             nStartCol, nStartRow, nStartTab, nEndCol, MAXROW, nEndTab,
commit 8ed5e3bdabb3d9682316c7093d30e1152b41dbcf
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Nov 7 22:27:51 2011 +0000

    callcatcher: remove some unused Graphic methods

diff --git a/unusedcode.easy b/unusedcode.easy
index de04ee9..f3513fe 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -154,9 +154,7 @@ GalleryExplorer::DrawCentered(OutputDevice*, FmFormModel const&)
 GalleryExplorer::GetObjCount(unsigned long)
 GraphCtrl::GraphCtrl(Window*, long)
 Graphic::Draw(OutputDevice*, String const&, Font&, Bitmap const&, Point const&, Size const&)
-Graphic::GetGraphicsCompressMode(SvStream&)
 Graphic::StartAnimation(OutputDevice*, Point const&, long, OutputDevice*)
-Graphic::WriteEmbedded(SvStream&)
 GraphicReader::IsPreviewModeEnabled() const
 GroupTable::SkipCurrentGroup()
 GtkSalFrame::popIgnoreDamage()
diff --git a/vcl/inc/vcl/graph.hxx b/vcl/inc/vcl/graph.hxx
index acb7271..d34a213 100644
--- a/vcl/inc/vcl/graph.hxx
+++ b/vcl/inc/vcl/graph.hxx
@@ -188,14 +188,11 @@ public:
 
 public:
 
-    static sal_uInt16       GetGraphicsCompressMode( SvStream& rIStm );
-
     void                SetDocFileName( const String& rName, sal_uLong nFilePos );
     const String&       GetDocFileName() const;
     sal_uLong               GetDocFilePos() const;
 
     sal_Bool                ReadEmbedded( SvStream& rIStream, sal_Bool bSwap = sal_False );
-    sal_Bool                WriteEmbedded( SvStream& rOStream );
 
     sal_Bool                SwapOut();
     sal_Bool                SwapOut( SvStream* pOStm );
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 8205a6b..ece06ca 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -680,44 +680,6 @@ void Graphic::SetContext( GraphicReader* pReader )
 
 // ------------------------------------------------------------------------
 
-sal_uInt16 Graphic::GetGraphicsCompressMode( SvStream& rIStm )
-{
-    const sal_uLong     nPos = rIStm.Tell();
-    const sal_uInt16    nOldFormat = rIStm.GetNumberFormatInt();
-    sal_uInt32          nTmp32;
-    sal_uInt16          nTmp16;
-    sal_uInt16          nCompressMode = COMPRESSMODE_NONE;
-
-    rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
-
-    rIStm >> nTmp32;
-
-    // is it a swapped graphic with a bitmap?
-    rIStm.SeekRel( (nTmp32 == (sal_uInt32) GRAPHIC_BITMAP ) ? 40 : -4 );
-
-    // try to read bitmap id
-    rIStm >> nTmp16;
-
-    // check id of BitmapFileHeader
-    if( 0x4D42 == nTmp16 )
-    {
-        // seek to compress field of BitmapInfoHeader
-        rIStm.SeekRel( 28 );
-        rIStm >> nTmp32;
-
-        // Compare with our own compressmode
-        if( ZCOMPRESS == nTmp32 )
-            nCompressMode = COMPRESSMODE_ZBITMAP;
-    }
-
-    rIStm.SetNumberFormatInt( nOldFormat );
-    rIStm.Seek( nPos );
-
-    return nCompressMode;
-}
-
-// ------------------------------------------------------------------------
-
 void Graphic::SetDocFileName( const String& rName, sal_uLong nFilePos )
 {
     mpImpGraphic->ImplSetDocFileName( rName, nFilePos );
@@ -747,14 +709,6 @@ sal_Bool Graphic::ReadEmbedded( SvStream& rIStream, sal_Bool bSwap )
 
 // ------------------------------------------------------------------------
 
-sal_Bool Graphic::WriteEmbedded( SvStream& rOStream )
-{
-    ImplTestRefCount();
-    return mpImpGraphic->ImplWriteEmbedded( rOStream );
-}
-
-// ------------------------------------------------------------------------
-
 sal_Bool Graphic::SwapOut()
 {
     ImplTestRefCount();
commit 3b5ec68b846eb2f1eb289cc95047864e51941cf0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Nov 7 22:24:39 2011 +0000

    ByteString->rtl::OString

diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 21f306b..6e7370b 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -366,8 +366,8 @@ class NameTranslationEntry : public HashedEntry
 protected:
     OUString                maTranslatedName;
 public:
-    inline                  NameTranslationEntry( const OUString& rOriginalName, const OUString& rTranslatedName );
-    inline                  NameTranslationEntry( const ByteString& rOriginalName, const ByteString& rTranslatedName );
+    inline                  NameTranslationEntry( const rtl::OUString& rOriginalName, const rtl::OUString& rTranslatedName );
+    inline                  NameTranslationEntry( const rtl::OString& rOriginalName, const rtl::OString& rTranslatedName );
 
     inline const OUString&  GetTranslation() const;
 };
@@ -378,9 +378,9 @@ inline NameTranslationEntry::NameTranslationEntry( const OUString& rOrg, const O
 {
 }
 
-inline NameTranslationEntry::NameTranslationEntry( const ByteString& rOrg, const ByteString& rTrans ):
-    HashedEntry( OUString( rOrg.GetBuffer(), rOrg.Len(), RTL_TEXTENCODING_ASCII_US ) ),
-    maTranslatedName( OUString( rTrans.GetBuffer(), rTrans.Len(), RTL_TEXTENCODING_UTF8 ) )
+inline NameTranslationEntry::NameTranslationEntry( const rtl::OString& rOrg, const rtl::OString& rTrans )
+    : HashedEntry(rtl::OStringToOUString(rOrg, RTL_TEXTENCODING_ASCII_US))
+    , maTranslatedName(rtl::OStringToOUString(rTrans, RTL_TEXTENCODING_UTF8))
 {
 }
 
@@ -438,12 +438,12 @@ void NameTranslationList::Init()
         ::ucbhelper::Content aTestContent( maTransFile.GetMainURL( INetURLObject::NO_DECODE ), Reference< XCommandEnvironment >() );
 
         if( aTestContent.isDocument() )
-        {// ... also tests the existence of maTransFile by throwing an Exception
-            const sal_Char*     pSection = "TRANSLATIONNAMES";
+        {
+            // ... also tests the existence of maTransFile by throwing an Exception
             String          aFsysName( maTransFile.getFSysPath( INetURLObject::FSYS_DETECT ) );
             Config          aConfig( aFsysName );
 
-            aConfig.SetGroup( ByteString( pSection ) );
+            aConfig.SetGroup( rtl::OString(RTL_CONSTASCII_STRINGPARAM("TRANSLATIONNAMES")) );
 
             sal_uInt16          nKeyCnt = aConfig.GetKeyCount();
 
@@ -969,7 +969,7 @@ void ViewTabListBox_Impl::DeleteEntries()
     SvLBoxEntry* pEntry = FirstSelected();
     String aURL;
 
-    ByteString sDialogPosition;
+    rtl::OString sDialogPosition;
     while ( pEntry && ( eResult != svtools::QUERYDELETE_CANCEL ) )
     {
         SvLBoxEntry *pCurEntry = pEntry;
@@ -1005,7 +1005,7 @@ void ViewTabListBox_Impl::DeleteEntries()
         {
             INetURLObject aObj( aURL );
             svtools::QueryDeleteDlg_Impl aDlg( NULL, aObj.GetName( INetURLObject::DECODE_WITH_CHARSET ) );
-            if ( sDialogPosition.Len() )
+            if ( sDialogPosition.getLength() )
                 aDlg.SetWindowState( sDialogPosition );
 
             if ( GetSelectionCount() > 1 )
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 4387aee..5baa658 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -1057,9 +1057,10 @@ void FontNameBox::DataChanged( const DataChangedEvent& rDCEvt )
 
 void FontNameBox::SaveMRUEntries( const String& aFontMRUEntriesFile, xub_Unicode cSep ) const
 {
-    ByteString aEntries =  ByteString( GetMRUEntries( cSep ), RTL_TEXTENCODING_UTF8 );
+    rtl::OString aEntries(rtl::OUStringToOString(GetMRUEntries(cSep),
+        RTL_TEXTENCODING_UTF8));
 
-    if( ! aEntries.Len() || ! aFontMRUEntriesFile.Len() )
+    if (!aEntries.getLength() || !aFontMRUEntriesFile.Len())
         return;
 
     SvFileStream aStream;
@@ -1067,14 +1068,14 @@ void FontNameBox::SaveMRUEntries( const String& aFontMRUEntriesFile, xub_Unicode
     if( ! (aStream.IsOpen() && aStream.IsWritable()) )
     {
 #if OSL_DEBUG_LEVEL > 1
-        fprintf( stderr, "FontNameBox::SaveMRUEntries: opening mru entries file %s failed\n", ByteString(aFontMRUEntriesFile , RTL_TEXTENCODING_UTF8 ).GetBuffer() );
+        fprintf( stderr, "FontNameBox::SaveMRUEntries: opening mru entries file %s failed\n", rtl::OUStringToOString(aFontMRUEntriesFile, RTL_TEXTENCODING_UTF8 ).getStr() );
 #endif
         return;
     }
 
     aStream.SetLineDelimiter( LINEEND_LF );
     aStream.WriteLine( aEntries );
-    aStream.WriteLine( ByteString() );
+    aStream.WriteLine( rtl::OString() );
 }
 
 // -------------------------------------------------------------------
@@ -1088,14 +1089,15 @@ void FontNameBox::LoadMRUEntries( const String& aFontMRUEntriesFile, xub_Unicode
     if( ! aStream.IsOpen() )
     {
 #if OSL_DEBUG_LEVEL > 1
-        fprintf( stderr, "FontNameBox::LoadMRUEntries: opening mru entries file %s failed\n", ByteString( aFontMRUEntriesFile, RTL_TEXTENCODING_UTF8 ).GetBuffer() );
+        fprintf( stderr, "FontNameBox::LoadMRUEntries: opening mru entries file %s failed\n", rtl::OUStringToOString(aFontMRUEntriesFile, RTL_TEXTENCODING_UTF8).getStr() );
 #endif
         return;
     }
 
-    ByteString aLine;
+    rtl::OString aLine;
     aStream.ReadLine( aLine );
-    XubString aEntries = XubString( aLine, RTL_TEXTENCODING_UTF8 );
+    rtl::OUString aEntries = rtl::OStringToOUString(aLine,
+        RTL_TEXTENCODING_UTF8);
     SetMRUEntries( aEntries, cSep );
 }
 
diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx
index 83f6244..dc73648 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -917,11 +917,12 @@ long FontSizeNames::Name2Size( const String& rName ) const
 {
     if ( mnElem )
     {
-        ByteString aName( rName, RTL_TEXTENCODING_UTF8 );
+        rtl::OString aName(rtl::OUStringToOString(rName,
+            RTL_TEXTENCODING_UTF8));
 
         // linear search is sufficient for this rare case
         for( long i = mnElem; --i >= 0; )
-            if ( aName == mpArray[i].mszUtf8Name )
+            if ( aName.equals(mpArray[i].mszUtf8Name) )
                 return mpArray[i].mnSize;
     }
 
diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx
index dc4e9a3..31712f1 100644
--- a/svtools/source/edit/syntaxhighlight.cxx
+++ b/svtools/source/edit/syntaxhighlight.cxx
@@ -434,14 +434,14 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
             if( bCanBeKeyword )
             {
                 String aKWString(rpStartPos, sal::static_int_cast< xub_StrLen >(nCount) );
-                ByteString aByteStr( aKWString, RTL_TEXTENCODING_ASCII_US );
-                aByteStr.ToLowerAscii();
-                if ( bsearch( aByteStr.GetBuffer(), ppListKeyWords, nKeyWordCount, sizeof( char* ),
+                rtl::OString aByteStr = rtl::OUStringToOString(aKWString,
+                    RTL_TEXTENCODING_ASCII_US).toAsciiLowerCase();
+                if ( bsearch( aByteStr.getStr(), ppListKeyWords, nKeyWordCount, sizeof( char* ),
                                                                         compare_strings ) )
                 {
                     reType = TT_KEYWORDS;
 
-                    if ( aByteStr.Equals( "rem" ) )
+                    if (aByteStr.equalsL(RTL_CONSTASCII_STRINGPARAM("rem")))
                     {
                         // Alle Zeichen bis Zeilen-Ende oder EOF entfernen
                         sal_Unicode cPeek = peekChar();
diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx
index b44243e..1d595c8 100644
--- a/svtools/source/edit/texteng.cxx
+++ b/svtools/source/edit/texteng.cxx
@@ -2586,7 +2586,7 @@ sal_Bool TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
     if ( aSel.HasRange() )
         aSel = ImpDeleteText( aSel );
 
-    ByteString aLine;
+    rtl::OString aLine;
     sal_Bool bDone = rInput.ReadLine( aLine );
     String aTmpStr( aLine, rInput.GetStreamCharSet() ), aStr;
     while ( bDone )
@@ -2687,7 +2687,8 @@ sal_Bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, sal_Bo
 
             aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "</P>" ) );
         }
-        rOutput.WriteLine( ByteString( aText, rOutput.GetStreamCharSet() ) );
+        rOutput.WriteLine(rtl::OUStringToOString(aText,
+            rOutput.GetStreamCharSet()));
     }
 
     if ( bHTML )
diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx
index 47a7a69..4495302 100644
--- a/svtools/source/filter/exportdialog.cxx
+++ b/svtools/source/filter/exportdialog.cxx
@@ -87,43 +87,42 @@
 
 using namespace ::com::sun::star;
 
-static sal_Int16 GetFilterFormat( String& rExt )
+static sal_Int16 GetFilterFormat(const rtl::OUString& rExt)
 {
     sal_Int16 nFormat = FORMAT_UNKNOWN;
-    ByteString aExt( rExt, RTL_TEXTENCODING_UTF8 );
-    if ( aExt.Equals( "JPG" ) )
+    if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("JPG")))
         nFormat = FORMAT_JPG;
-    else if ( aExt.Equals( "PNG" ) )
+    else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PNG")))
         nFormat = FORMAT_PNG;
-    else if ( aExt.Equals( "BMP" ) )
+    else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("BMP")))
         nFormat = FORMAT_BMP;
-    else if ( aExt.Equals( "GIF" ) )
+    else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("GIF")))
         nFormat = FORMAT_GIF;
-    else if ( aExt.Equals( "PBM" ) )
+    else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PBM")))
         nFormat = FORMAT_PBM;
-    else if ( aExt.Equals( "PGM" ) )
+    else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PGM")))
         nFormat = FORMAT_PGM;
-    else if ( aExt.Equals( "PPM" ) )
+    else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PPM")))
         nFormat = FORMAT_PPM;
-    else if ( aExt.Equals( "PCT" ) )
+    else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PCT")))
         nFormat = FORMAT_PCT;
-    else if ( aExt.Equals( "RAS" ) )
+    else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("RAS")))
         nFormat = FORMAT_RAS;
-    else if ( aExt.Equals( "TIF" ) )
+    else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("TIF")))
         nFormat = FORMAT_TIF;
-    else if ( aExt.Equals( "XPM" ) )
+    else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("XPM")))
         nFormat = FORMAT_XPM;
-    else if ( aExt.Equals( "WMF" ) )
+    else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("WMF")))
         nFormat = FORMAT_WMF;
-    else if ( aExt.Equals( "EMF" ) )
+    else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EMF")))
         nFormat = FORMAT_EMF;
-    else if ( aExt.Equals( "EPS" ) )
+    else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EPS")))
         nFormat = FORMAT_EPS;
-    else if ( aExt.Equals( "MET" ) )
+    else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MET")))
         nFormat = FORMAT_MET;
-    else if ( aExt.Equals( "SVG" ) )
+    else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SVG")))
         nFormat = FORMAT_SVG;
-    else if ( aExt.Equals( "SVM" ) )
+    else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SVM")))
         nFormat = FORMAT_SVM;
     return nFormat;
 }
diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx
index 9bd0821..a6385a9 100644
--- a/svtools/source/filter/filter.cxx
+++ b/svtools/source/filter/filter.cxx
@@ -2180,7 +2180,7 @@ IMPL_LINK( GraphicFilter, FilterCallback, ConvertData*, pData )
     if( pData )
     {
         sal_uInt16      nFormat = GRFILTER_FORMAT_DONTKNOW;
-        ByteString  aShortName;
+        rtl::OString aShortName;
         switch( pData->mnFormat )
         {
             case( CVT_BMP ): aShortName = BMP_SHORTNAME; break;
@@ -2201,13 +2201,13 @@ IMPL_LINK( GraphicFilter, FilterCallback, ConvertData*, pData )
         if( GRAPHIC_NONE == pData->maGraphic.GetType() || pData->maGraphic.GetContext() ) // Import
         {
             // Import
-            nFormat = GetImportFormatNumberForShortName( String( aShortName.GetBuffer(), RTL_TEXTENCODING_UTF8 ) );
+            nFormat = GetImportFormatNumberForShortName( rtl::OStringToOUString( aShortName, RTL_TEXTENCODING_UTF8) );
             nRet = ImportGraphic( pData->maGraphic, String(), pData->mrStm, nFormat ) == 0;
         }
-        else if( aShortName.Len() )
+        else if( aShortName.getLength() )
         {
             // Export
-            nFormat = GetExportFormatNumberForShortName( String( aShortName.GetBuffer(), RTL_TEXTENCODING_UTF8 ) );
+            nFormat = GetExportFormatNumberForShortName( rtl::OStringToOUString(aShortName, RTL_TEXTENCODING_UTF8) );
             nRet = ExportGraphic( pData->maGraphic, String(), pData->mrStm, nFormat ) == 0;
         }
     }
diff --git a/svtools/source/filter/wmf/winmtf.cxx b/svtools/source/filter/wmf/winmtf.cxx
index c830afd..ff928ee 100644
--- a/svtools/source/filter/wmf/winmtf.cxx
+++ b/svtools/source/filter/wmf/winmtf.cxx
@@ -38,6 +38,7 @@
 #include <vcl/canvastools.hxx>
 #include <vcl/metric.hxx>
 #include <vcl/svapp.hxx>
+#include <rtl/strbuf.hxx>
 #include <rtl/tencinfo.h>
 
 // ------------------------------------------------------------------------
@@ -289,14 +290,13 @@ void WinMtfAssertHandler( const sal_Char* pAction, sal_uInt32 nFlags )
     {
         if ( ( nAssertCount == 0 ) || ( bOnlyOnce == sal_False ) )
         {
-            ByteString aText( "WMF/EMF Import: " );
-            if ( pAction )
-            {
-                ByteString aAction( pAction );
-                aText.Append( aAction );
-            }
-            aText.Append( " needs to be implemented (SJ)" );
-            DBG_ASSERT( 0, aText.GetBuffer() );
+            rtl::OStringBuffer aText(RTL_CONSTASCII_STRINGPARAM(
+                "WMF/EMF Import: "));
+            if (pAction)
+                aText.append(pAction);
+            aText.append(RTL_CONSTASCII_STRINGPARAM(
+                " needs to be implemented"));
+            DBG_ASSERT( 0, aText.getStr() );
         }
         nAssertCount++;
     }
diff --git a/svtools/source/graphic/graphicunofactory.cxx b/svtools/source/graphic/graphicunofactory.cxx
index bfa77d1..25b8fe8 100644
--- a/svtools/source/graphic/graphicunofactory.cxx
+++ b/svtools/source/graphic/graphicunofactory.cxx
@@ -63,7 +63,7 @@ GObjectImpl::GObjectImpl( uno::Sequence< uno::Any > const & args, uno::Reference
         rtl::OUString sId;
         if ( !( args[ 0 ] >>= sId ) || sId.getLength() == 0 )
             throw lang::IllegalArgumentException();
-        ByteString bsId( sId.getStr(), RTL_TEXTENCODING_UTF8 );
+        rtl::OString bsId(rtl::OUStringToOString(sId, RTL_TEXTENCODING_UTF8));
         mpGObject.reset( new GraphicObject( bsId ) );
     }
     else
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 52621ac..613fd3d 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -1161,7 +1161,7 @@ SvStream& operator<<( SvStream& rOStm, const GraphicObject& rGraphicObj )
     rOStm << rGraphicObj.GetGraphic() << rGraphicObj.GetAttr() << bLink;
 
     if( bLink )
-        rOStm << ByteString( rGraphicObj.GetLink(), RTL_TEXTENCODING_UTF8 );
+        rOStm << rtl::OUStringToOString(rGraphicObj.GetLink(), RTL_TEXTENCODING_UTF8);
 
     return rOStm;
 }
@@ -1174,7 +1174,7 @@ GraphicObject GraphicObject::CreateGraphicObjectFromURL( const ::rtl::OUString &
     if( aURL.Search( aPrefix ) == 0 )
     {
         // graphic manager url
-        ByteString aUniqueID( String(rURL.copy( sizeof( UNO_NAME_GRAPHOBJ_URLPREFIX ) - 1 )), RTL_TEXTENCODING_UTF8 );
+        rtl::OString aUniqueID(rtl::OUStringToOString(rURL.copy(sizeof(UNO_NAME_GRAPHOBJ_URLPREFIX) - 1), RTL_TEXTENCODING_UTF8));
         return GraphicObject( aUniqueID );
     }
     else
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index a8785a5..7807ffe 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -163,8 +163,9 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadGraphicObject( co
     {
         // graphic manager url
         String aTmpStr( rResourceURL.copy( sizeof( UNO_NAME_GRAPHOBJ_URLPREFIX ) - 1 ) );
-        ByteString aUniqueID( aTmpStr, RTL_TEXTENCODING_UTF8 );
-        GraphicObject aGrafObj( aUniqueID );
+        rtl::OString aUniqueID(rtl::OUStringToOString(aTmpStr,
+            RTL_TEXTENCODING_UTF8));
+        GraphicObject aGrafObj(aUniqueID);
         // I don't call aGrafObj.GetXGraphic because it will call us back
         // into implLoadMemory ( with "private:memorygraphic" test )
         ::unographic::Graphic* pUnoGraphic = new ::unographic::Graphic;
@@ -288,9 +289,10 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadResource( const :
 
     if( ( 0 == rResourceURL.getToken( 0, '/', nIndex ).compareToAscii( "private:resource" ) ) )
     {
-        ByteString aResMgrName( String( rResourceURL.getToken( 0, '/', nIndex ) ), RTL_TEXTENCODING_ASCII_US );
+        rtl::OString aResMgrName(rtl::OUStringToOString(
+            rResourceURL.getToken(0, '/', nIndex), RTL_TEXTENCODING_ASCII_US));
 
-        ResMgr* pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
+        ResMgr* pResMgr = ResMgr::CreateResMgr( aResMgrName.getStr(), Application::GetSettings().GetUILocale() );
 
         if( pResMgr )
         {
diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx
index 59d1085..3b99c97 100644
--- a/svtools/source/misc/imap.cxx
+++ b/svtools/source/misc/imap.cxx
@@ -104,17 +104,18 @@ void IMapObject::Write( SvStream& rOStm, const String& rBaseURL ) const
     rOStm << GetVersion();
     rOStm << ( (sal_uInt16) eEncoding );
 
-    const ByteString aRelURL = ByteString( String(URIHelper::simpleNormalizedMakeRelative( rBaseURL, aURL )), eEncoding );
-    rOStm.WriteByteString( aRelURL );
-    rOStm.WriteByteString( ByteString( aAltText, eEncoding ) );
+    const rtl::OString aRelURL = rtl::OUStringToOString(
+        URIHelper::simpleNormalizedMakeRelative(rBaseURL, aURL), eEncoding);
+    rOStm.WriteByteString(aRelURL);
+    rOStm.WriteByteString(rtl::OUStringToOString(aAltText, eEncoding));
     rOStm << bActive;
-    rOStm.WriteByteString( ByteString( aTarget, eEncoding ) );
+    rOStm.WriteByteString(rtl::OUStringToOString(aTarget, eEncoding));
 
     pCompat = new IMapCompat( rOStm, STREAM_WRITE );
 
     WriteIMapObject( rOStm );
     aEventList.Write( rOStm );                                 // V4
-    rOStm.WriteByteString( ByteString( aName, eEncoding ) );   // V5
+    rOStm.WriteByteString(rtl::OUStringToOString(aName, eEncoding));   // V5
 
     delete pCompat;
 }
@@ -1128,10 +1129,10 @@ void ImageMap::Write( SvStream& rOStm, const String& rBaseURL ) const
     // MagicCode schreiben
     rOStm << IMAPMAGIC;
     rOStm << GetVersion();
-    rOStm.WriteByteString( ByteString( aImageName, eEncoding ) );
-    rOStm.WriteByteString( ByteString( aDummy, eEncoding ) );
+    rOStm.WriteByteString(rtl::OUStringToOString(aImageName, eEncoding));
+    rOStm.WriteByteString(rtl::OUStringToOString(aDummy, eEncoding));
     rOStm << nCount;
-    rOStm.WriteByteString( ByteString( aImageName, eEncoding ) );
+    rOStm.WriteByteString(rtl::OUStringToOString(aImageName, eEncoding));
 
     pCompat = new IMapCompat( rOStm, STREAM_WRITE );
 
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
index da7ff07..c30dd84 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -648,7 +648,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
         if( pObj )
         {
             const sal_Char *pShape = 0;
-            ByteString aCoords;
+            rtl::OString aCoords;
             switch( pObj->GetType() )
             {
             case( IMAP_OBJ_RECTANGLE ):
@@ -956,7 +956,7 @@ rtl::OString HTMLOutFuncs::CreateTableDataOptionsValNum(
         // printf / scanf ist zu ungenau
         String aValStr;
         rFormatter.GetInputLineString( fVal, 0, aValStr );
-        ByteString sTmp( aValStr, eDestEnc );
+        rtl::OString sTmp(rtl::OUStringToOString(aValStr, eDestEnc));
         aStrTD.append(' ').
             append(OOO_STRING_SVTOOLS_HTML_O_SDval).
             append(RTL_CONSTASCII_STRINGPARAM("=\"")).
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index 8ec3503..17f092d 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -1927,7 +1927,7 @@ bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
 
             sTmp.append( cUC < 256U ? (sal_Char)cUC : '.' );
         }
-        sCmp = ByteString( sTmp.makeStringAndClear() );
+        sCmp = sTmp.makeStringAndClear();
     }
     else
     {
@@ -2270,9 +2270,10 @@ rtl_TextEncoding HTMLParser::GetEncodingByMIME( const String& rMime )
             = aParameters.find("charset");
         if (pCharset != 0)
         {
-            ByteString sValue( pCharset->m_sValue, RTL_TEXTENCODING_ASCII_US );
+            rtl::OString sValue(rtl::OUStringToOString(pCharset->m_sValue,
+                RTL_TEXTENCODING_ASCII_US));
             return GetExtendedCompatibilityTextEncoding(
-                    rtl_getTextEncodingFromMimeCharset( sValue.GetBuffer() ) );
+                    rtl_getTextEncodingFromMimeCharset( sValue.getStr() ) );
         }
     }
     return RTL_TEXTENCODING_DONTKNOW;
diff --git a/svtools/source/urlobj/inetimg.cxx b/svtools/source/urlobj/inetimg.cxx
index 05159f3..aa8dfb3 100644
--- a/svtools/source/urlobj/inetimg.cxx
+++ b/svtools/source/urlobj/inetimg.cxx
@@ -51,9 +51,11 @@ sal_Bool INetImage::Write( SvStream& rOStm, sal_uLong nFormat ) const
             sString += String::CreateFromInt32( aSizePixel.Width() );
             sString += TOKEN_SEPARATOR;
             sString += String::CreateFromInt32( aSizePixel.Height() );
-            ByteString sOut( sString, RTL_TEXTENCODING_UTF8 );
 
-            rOStm.Write( sOut.GetBuffer(), sOut.Len() );
+            rtl::OString sOut(rtl::OUStringToOString(sString,
+                RTL_TEXTENCODING_UTF8));
+
+            rOStm.Write(sOut.getStr(), sOut.getLength());
             static const sal_Char aEndChar[2] = { 0 };
             rOStm.Write( aEndChar, sizeof( aEndChar ));
             bRet = 0 == rOStm.GetError();
commit 06813401fdb6bcbcaed321ff53c4601af91dbba2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Nov 7 22:21:35 2011 +0000

    this just takes a const char*

diff --git a/svtools/source/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter/SvFilterOptionsDialog.cxx
index 6f78dd1..608e48d 100644
--- a/svtools/source/filter/SvFilterOptionsDialog.cxx
+++ b/svtools/source/filter/SvFilterOptionsDialog.cxx
@@ -219,10 +219,9 @@ sal_Int16 SvFilterOptionsDialog::execute()
             FltCallDialogParameter aFltCallDlgPara( Application::GetDefDialogParent(), NULL, meFieldUnit );
             aFltCallDlgPara.aFilterData = maFilterDataSequence;
 
-            ByteString  aResMgrName( "svt", 3 );
             ResMgr*     pResMgr;
 
-            pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
+            pResMgr = ResMgr::CreateResMgr( "svt", Application::GetSettings().GetUILocale() );
             aFltCallDlgPara.pResMgr = pResMgr;
 
             aFltCallDlgPara.aFilterExt = aGraphicFilter.pConfig->GetExportFormatShortName( nFormat );
commit ce7017ba607d4eb48407af61d5aa5b1ff3dc4b46
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Nov 7 22:10:41 2011 +0000

    this just take a const char*

diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx
index ddab749..9bd0821 100644
--- a/svtools/source/filter/filter.cxx
+++ b/svtools/source/filter/filter.cxx
@@ -790,10 +790,8 @@ sal_uInt16 GraphicFilter::ImpTestOrFindFormat( const String& rPath, SvStream& rS
 static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& rConfigItem )
 {
     Graphic     aGraphic;
-    ByteString  aResMgrName( "svt", 3 );
-    ResMgr*     pResMgr;
 
-    pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
+    ResMgr*     pResMgr = ResMgr::CreateResMgr( "svt", Application::GetSettings().GetUILocale() );
 
     sal_Int32 nLogicalWidth = rConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "LogicalWidth" ) ), 0 );
     sal_Int32 nLogicalHeight = rConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "LogicalHeight" ) ), 0 );
commit 9fa5c77363964aceb2f3aa908f6b2d60f024ab02
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Nov 7 22:05:56 2011 +0000

    unused sData

diff --git a/svtools/source/urlobj/inetimg.cxx b/svtools/source/urlobj/inetimg.cxx
index 4bfa012..05159f3 100644
--- a/svtools/source/urlobj/inetimg.cxx
+++ b/svtools/source/urlobj/inetimg.cxx
@@ -107,7 +107,6 @@ sal_Bool INetImage::Read( SvStream& rIStm, sal_uLong nFormat )
 */
             rtl_TextEncoding eSysCSet = osl_getThreadTextEncoding();
             sal_Int32 nVal, nAnchorOffset, nAltOffset, nFilePos;
-            ByteString sData;
 
             nFilePos = rIStm.Tell();
             // skip over iSize (int), bIsMao ( sal_Bool ) alignment of 4 !!!!
commit b479cdf360d238f745436f5c94b96f0ade74db28
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Nov 7 14:18:07 2011 +0000

    tweak to be a pImpl rather than a full window

diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx
index 2ff37ed..ed34930 100644
--- a/sw/source/ui/dialog/wordcountdialog.cxx
+++ b/sw/source/ui/dialog/wordcountdialog.cxx
@@ -55,37 +55,31 @@
 #endif /* ENABLE_LAYOUT */
 
 SwWordCountDialog::SwWordCountDialog(Window* pParent) :
-    Window(pParent, SW_RES(WINDOW_DLG)),
 #if defined _MSC_VER
 #pragma warning (disable : 4355)
 #endif
-    aCurrentFL( this, SW_RES(              FL_CURRENT            )),
-    aCurrentWordFT( this, SW_RES(          FT_CURRENTWORD        )),
-    aCurrentWordFI( this, SW_RES(          FI_CURRENTWORD        )),
-    aCurrentCharacterFT( this, SW_RES(     FT_CURRENTCHARACTER   )),
-    aCurrentCharacterFI( this, SW_RES(     FI_CURRENTCHARACTER   )),
-    aCurrentCharacterExcludingSpacesFT( this, SW_RES(     FT_CURRENTCHARACTEREXCLUDINGSPACES   )),
-    aCurrentCharacterExcludingSpacesFI( this, SW_RES(     FI_CURRENTCHARACTEREXCLUDINGSPACES   )),
+    aCurrentFL( pParent, SW_RES(              FL_CURRENT            )),
+    aCurrentWordFT( pParent, SW_RES(          FT_CURRENTWORD        )),
+    aCurrentWordFI( pParent, SW_RES(          FI_CURRENTWORD        )),
+    aCurrentCharacterFT( pParent, SW_RES(     FT_CURRENTCHARACTER   )),
+    aCurrentCharacterFI( pParent, SW_RES(     FI_CURRENTCHARACTER   )),
+    aCurrentCharacterExcludingSpacesFT( pParent, SW_RES(     FT_CURRENTCHARACTEREXCLUDINGSPACES   )),
+    aCurrentCharacterExcludingSpacesFI( pParent, SW_RES(     FI_CURRENTCHARACTEREXCLUDINGSPACES   )),
 
-    aDocFL( this, SW_RES(                  FL_DOC                )),
-    aDocWordFT( this, SW_RES(              FT_DOCWORD            )),
-    aDocWordFI( this, SW_RES(              FI_DOCWORD            )),
-    aDocCharacterFT( this, SW_RES(         FT_DOCCHARACTER       )),
-    aDocCharacterFI( this, SW_RES(         FI_DOCCHARACTER       )),
-    aDocCharacterExcludingSpacesFT( this, SW_RES(         FT_DOCCHARACTEREXCLUDINGSPACES       )),
-    aDocCharacterExcludingSpacesFI( this, SW_RES(         FI_DOCCHARACTEREXCLUDINGSPACES       )),
-    aBottomFL(this, SW_RES(                FL_BOTTOM             )),
-    aOK( this, SW_RES(                     PB_OK                 )),
-    aHelp( this, SW_RES(                   PB_HELP               ))
+    aDocFL( pParent, SW_RES(                  FL_DOC                )),
+    aDocWordFT( pParent, SW_RES(              FT_DOCWORD            )),
+    aDocWordFI( pParent, SW_RES(              FI_DOCWORD            )),
+    aDocCharacterFT( pParent, SW_RES(         FT_DOCCHARACTER       )),
+    aDocCharacterFI( pParent, SW_RES(         FI_DOCCHARACTER       )),
+    aDocCharacterExcludingSpacesFT( pParent, SW_RES(         FT_DOCCHARACTEREXCLUDINGSPACES       )),
+    aDocCharacterExcludingSpacesFI( pParent, SW_RES(         FI_DOCCHARACTEREXCLUDINGSPACES       )),
+    aBottomFL(pParent, SW_RES(                FL_BOTTOM             )),
+    aOK( pParent, SW_RES(                     PB_OK                 )),
+    aHelp( pParent, SW_RES(                   PB_HELP               ))
 #if defined _MSC_VER
 #pragma warning (default : 4355)
 #endif
 {
-#if ENABLE_LAYOUT
-    SetHelpId (HID_DLG_WORDCOUNT);
-#endif /* ENABLE_LAYOUT */
-    FreeResource();
-
     aOK.SetClickHdl(LINK(this,SwWordCountDialog,        OkHdl));
 }
 
@@ -129,7 +123,6 @@ SwWordCountFloatDlg::SwWordCountFloatDlg(SfxBindings* _pBindings,
 void SwWordCountFloatDlg::Activate()
 {
     SfxModelessDialog::Activate();
-    aDlg.Activate();
 }
 
 void SwWordCountFloatDlg::UpdateCounts()
diff --git a/sw/source/ui/dialog/wordcountdialog.src b/sw/source/ui/dialog/wordcountdialog.src
index a324c45..7d95371 100644
--- a/sw/source/ui/dialog/wordcountdialog.src
+++ b/sw/source/ui/dialog/wordcountdialog.src
@@ -40,11 +40,6 @@ ModelessDialog DLG_WORDCOUNT
     Sizeable = FALSE ;
     Hide = TRUE ;
 
-  Window WINDOW_DLG
-  {
-    Pos = MAP_APPFONT ( 0 , 0 ) ;
-    Size = MAP_APPFONT ( 170 , 132 ) ;
-
     FixedLine  FL_CURRENT
     {
         Pos = MAP_APPFONT ( 6 , 3 ) ;
@@ -145,5 +140,4 @@ ModelessDialog DLG_WORDCOUNT
         Pos = MAP_APPFONT ( 114 , 112 ) ;
         Size = MAP_APPFONT ( 50 , 14 ) ;
     };
-  };
 };
diff --git a/sw/source/ui/inc/wordcountdialog.hxx b/sw/source/ui/inc/wordcountdialog.hxx
index d4c996c..14b8be8 100644
--- a/sw/source/ui/inc/wordcountdialog.hxx
+++ b/sw/source/ui/inc/wordcountdialog.hxx
@@ -38,7 +38,7 @@ struct SwDocStat;
 
 class SwWrtShell;
 
-class SwWordCountDialog : public Window
+class SwWordCountDialog
 {
     FixedLine       aCurrentFL;
     FixedText       aCurrentWordFT;


More information about the Libreoffice-commits mailing list