diff options
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/svx/gallery1.hxx | 48 | ||||
-rw-r--r-- | svx/inc/svx/galmisc.hxx | 14 | ||||
-rw-r--r-- | svx/inc/svx/galtheme.hxx | 18 | ||||
-rw-r--r-- | svx/source/gallery2/gallery1.cxx | 51 | ||||
-rw-r--r-- | svx/source/gallery2/galobj.cxx | 36 | ||||
-rw-r--r-- | svx/source/gallery2/galtheme.cxx | 19 |
6 files changed, 108 insertions, 78 deletions
diff --git a/svx/inc/svx/gallery1.hxx b/svx/inc/svx/gallery1.hxx index de6ebc684a32..aa5cc4aa0f8e 100644 --- a/svx/inc/svx/gallery1.hxx +++ b/svx/inc/svx/gallery1.hxx @@ -47,16 +47,16 @@ class GalleryThemeEntry { private: - rtl::OUString aName; + String aName; INetURLObject aThmURL; INetURLObject aSdgURL; INetURLObject aSdvURL; - sal_uInt32 nFileNumber; - sal_uInt32 nId; - sal_Bool bReadOnly; - sal_Bool bImported; - sal_Bool bModified; - sal_Bool bThemeNameFromResource; + sal_uInt32 nFileNumber; + sal_uInt32 nId; + sal_Bool bReadOnly; + sal_Bool bImported; + sal_Bool bModified; + sal_Bool bThemeNameFromResource; GalleryThemeEntry(); INetURLObject ImplGetURLIgnoreCase( const INetURLObject& rURL ) const; @@ -68,26 +68,26 @@ public: sal_Bool bNewFile, sal_uInt32 nId, sal_Bool bThemeNameFromResource ); ~GalleryThemeEntry() {}; - const rtl::OUString& GetThemeName() const { return aName; } - sal_uInt32 GetFileNumber() const { return nFileNumber; } + const String& GetThemeName() const { return aName; } + sal_uInt32 GetFileNumber() const { return nFileNumber; } const INetURLObject& GetThmURL() const { return aThmURL; } const INetURLObject& GetSdgURL() const { return aSdgURL; } const INetURLObject& GetSdvURL() const { return aSdvURL; } - sal_Bool IsImported() const { return bImported; } - sal_Bool IsReadOnly() const { return bReadOnly; } - sal_Bool IsDefault() const; + sal_Bool IsImported() const { return bImported; } + sal_Bool IsReadOnly() const { return bReadOnly; } + sal_Bool IsDefault() const; - sal_Bool IsHidden() const { return aName.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("private://gallery/hidden/")); } + sal_Bool IsHidden() const { return aName.SearchAscii( "private://gallery/hidden/" ) == 0; } - sal_Bool IsModified() const { return bModified; } + sal_Bool IsModified() const { return bModified; } void SetModified( sal_Bool bSet ) { bModified = ( bSet && !IsImported() && !IsReadOnly() ); } - void SetName( const rtl::OUString& rNewName ); - sal_Bool IsNameFromResource() const { return bThemeNameFromResource; } + void SetName( const String& rNewName ); + sal_Bool IsNameFromResource() const { return bThemeNameFromResource; } - sal_uInt32 GetId() const { return nId; } + sal_uInt32 GetId() const { return nId; } void SetId( sal_uInt32 nNewId, sal_Bool bResetThemeName ); }; @@ -99,10 +99,10 @@ typedef ::std::vector< GalleryThemeEntry* > GalleryThemeList; struct GalleryImportThemeEntry { - rtl::OUString aThemeName; - rtl::OUString aUIName; - INetURLObject aURL; - rtl::OUString aImportName; + String aThemeName; + String aUIName; + INetURLObject aURL; + String aImportName; }; typedef ::std::vector< GalleryImportThemeEntry* > GalleryImportThemeList; @@ -144,9 +144,9 @@ private: void ImplLoadImports(); void ImplWriteImportList(); - SVX_DLLPUBLIC GalleryThemeEntry* ImplGetThemeEntry( const rtl::OUString& rThemeName ); + SVX_DLLPUBLIC GalleryThemeEntry* ImplGetThemeEntry( const String& rThemeName ); GalleryThemeEntry* ImplGetThemeEntry( sal_uIntPtr nThemeId ); - GalleryImportThemeEntry* ImplGetImportThemeEntry( const rtl::OUString& rImportName ); + GalleryImportThemeEntry* ImplGetImportThemeEntry( const String& rImportName ); GalleryTheme* ImplGetCachedTheme( const GalleryThemeEntry* pThemeEntry ); void ImplDeleteCachedTheme( GalleryTheme* pTheme ); @@ -164,7 +164,7 @@ public: const GalleryThemeEntry* GetThemeInfo( const String& rThemeName ) { return ImplGetThemeEntry( rThemeName ); } SVX_DLLPUBLIC sal_Bool HasTheme( const String& rThemeName ); - rtl::OUString GetThemeName( sal_uIntPtr nThemeId ) const; + String GetThemeName( sal_uIntPtr nThemeId ) const; SVX_DLLPUBLIC sal_Bool CreateTheme( const String& rThemeName, sal_uInt32 nNumFrom = 0 ); sal_Bool RenameTheme( const String& rOldName, const String& rNewName ); diff --git a/svx/inc/svx/galmisc.hxx b/svx/inc/svx/galmisc.hxx index 7f4563e89f7e..c7ed89c2f953 100644 --- a/svx/inc/svx/galmisc.hxx +++ b/svx/inc/svx/galmisc.hxx @@ -245,8 +245,8 @@ class GalleryHint : public SfxHint private: sal_uIntPtr mnType; - rtl::OUString maThemeName; - rtl::OUString maStringData; + String maThemeName; + String maStringData; sal_uIntPtr mnData1; sal_uIntPtr mnData2; @@ -258,11 +258,11 @@ public: GalleryHint( sal_uIntPtr nType, const String& rThemeName, const String& rStringData, sal_uIntPtr nData1 = 0UL, sal_uIntPtr nData2 = 0UL ) : mnType( nType ), maThemeName( rThemeName ), maStringData( rStringData ), mnData1( nData1 ), mnData2( nData2 ) {} - sal_uIntPtr GetType() const { return mnType; } - const rtl::OUString& GetThemeName() const { return maThemeName; } - const rtl::OUString& GetStringData() const { return maStringData; } - sal_uIntPtr GetData1() const { return mnData1; } - sal_uIntPtr GetData2() const { return mnData2; } + sal_uIntPtr GetType() const { return mnType; } + const String& GetThemeName() const { return maThemeName; } + const String& GetStringData() const { return maStringData; } + sal_uIntPtr GetData1() const { return mnData1; } + sal_uIntPtr GetData2() const { return mnData2; } }; #endif diff --git a/svx/inc/svx/galtheme.hxx b/svx/inc/svx/galtheme.hxx index 766bb449a78f..2bfdddf8ab4f 100644 --- a/svx/inc/svx/galtheme.hxx +++ b/svx/inc/svx/galtheme.hxx @@ -70,10 +70,10 @@ class ListBox; struct GalDragParams { - Region aDragRegion; - sal_uIntPtr nDragObjPos; - rtl::OUString aThemeName; - rtl::OUString aFileName; + Region aDragRegion; + sal_uIntPtr nDragObjPos; + String aThemeName; + String aFileName; SgaObjKind eObjKind; }; @@ -99,7 +99,7 @@ class GalleryTheme : public SfxBroadcaster private: GalleryObjectList aObjectList; - rtl::OUString aImportName; + String aImportName; String m_aDestDir; SotStorageRef aSvDrawStorageRef; Gallery* pParent; @@ -147,10 +147,10 @@ public: SVX_DLLPUBLIC bool RemoveObject( size_t nPos ); bool ChangeObjectPos( size_t nOldPos, size_t nNewPos ); - SVX_DLLPUBLIC const rtl::OUString& GetName() const; - const rtl::OUString& GetRealName() const; - const rtl::OUString& GetImportName() const { return aImportName; } - void SetImportName(const rtl::OUString& rImportName) { aImportName = rImportName; } + SVX_DLLPUBLIC const String& GetName() const; + const String& GetRealName() const; + const String& GetImportName() const { return aImportName; } + void SetImportName(const String& rImportName) { aImportName = rImportName; } const String& GetDestDir() const { return m_aDestDir; } void SetDestDir(const String& rDestDir) { m_aDestDir = rDestDir; } diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx index 9b7cfe2739e6..4c10186cac9b 100644 --- a/svx/source/gallery2/gallery1.cxx +++ b/svx/source/gallery2/gallery1.cxx @@ -78,7 +78,7 @@ GalleryThemeEntry::GalleryThemeEntry( const INetURLObject& rBaseURL, const Strin if( nId && bThemeNameFromResource ) aName = String( GAL_RESID( RID_GALLERYSTR_THEME_START + (sal_uInt16) nId ) ); - if( !aName.getLength() ) + if( !aName.Len() ) aName = rName; } @@ -107,7 +107,7 @@ INetURLObject GalleryThemeEntry::ImplGetURLIgnoreCase( const INetURLObject& rURL // ----------------------------------------------------------------------------- -void GalleryThemeEntry::SetName( const rtl::OUString& rNewName ) +void GalleryThemeEntry::SetName( const String& rNewName ) { if( aName != rNewName ) { @@ -132,12 +132,16 @@ void GalleryThemeEntry::SetId( sal_uInt32 nNewId, sal_Bool bResetThemeName ) SvStream& operator<<( SvStream& rOut, const GalleryImportThemeEntry& rEntry ) { - write_lenPrefixed_uInt8s_FromOUString(rOut, rEntry.aThemeName, RTL_TEXTENCODING_UTF8); - write_lenPrefixed_uInt8s_FromOUString(rOut, rEntry.aUIName, RTL_TEXTENCODING_UTF8); - write_lenPrefixed_uInt8s_FromOUString(rOut, (rEntry.aURL.GetMainURL( INetURLObject::NO_DECODE )), RTL_TEXTENCODING_UTF8); - write_lenPrefixed_uInt8s_FromOUString(rOut, rEntry.aImportName, RTL_TEXTENCODING_UTF8); + rOut.WriteByteString(rtl::OUStringToOString(rEntry.aThemeName, RTL_TEXTENCODING_UTF8)); + + rOut.WriteByteString(rtl::OUStringToOString(rEntry.aUIName, RTL_TEXTENCODING_UTF8)); + + rOut.WriteByteString(rtl::OUStringToOString(String(rEntry.aURL.GetMainURL( INetURLObject::NO_DECODE )), RTL_TEXTENCODING_UTF8)); + + rOut.WriteByteString(rtl::OUStringToOString(rEntry.aImportName, RTL_TEXTENCODING_UTF8)); + + rOut.WriteByteString(rtl::OUString()); - write_lenPrefixed_uInt8s_FromOString(rOut, rtl::OString()); return rOut; } @@ -145,11 +149,22 @@ SvStream& operator<<( SvStream& rOut, const GalleryImportThemeEntry& rEntry ) SvStream& operator>>( SvStream& rIn, GalleryImportThemeEntry& rEntry ) { - rEntry.aThemeName = read_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); - rEntry.aUIName = read_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); - rEntry.aURL = read_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); - rEntry.aImportName = read_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); - read_lenPrefixed_uInt8s_ToOString(rIn); + ByteString aTmpStr; + + rIn.ReadByteString(aTmpStr); + rEntry.aThemeName = String( aTmpStr, RTL_TEXTENCODING_UTF8 ); + + rIn.ReadByteString(aTmpStr); + rEntry.aUIName = String( aTmpStr, RTL_TEXTENCODING_UTF8 ); + + rIn.ReadByteString(aTmpStr); + rEntry.aURL = INetURLObject( String( aTmpStr, RTL_TEXTENCODING_UTF8 ) ); + + rIn.ReadByteString(aTmpStr); + rEntry.aImportName = String( aTmpStr, RTL_TEXTENCODING_UTF8 ); + + rIn.ReadByteString(aTmpStr); + return rIn; } @@ -532,23 +547,21 @@ void Gallery::ImplWriteImportList() // ------------------------------------------------------------------------ -GalleryThemeEntry* Gallery::ImplGetThemeEntry( const rtl::OUString& rThemeName ) +GalleryThemeEntry* Gallery::ImplGetThemeEntry( const String& rThemeName ) { GalleryThemeEntry* pFound = NULL; - if( rThemeName.getLength() ) - { + if( rThemeName.Len() ) for ( size_t i = 0, n = aThemeList.size(); i < n && !pFound; ++i ) if( rThemeName == aThemeList[ i ]->GetThemeName() ) pFound = aThemeList[ i ]; - } return pFound; } // ------------------------------------------------------------------------ -GalleryImportThemeEntry* Gallery::ImplGetImportThemeEntry( const rtl::OUString& rImportName ) +GalleryImportThemeEntry* Gallery::ImplGetImportThemeEntry( const String& rImportName ) { for ( size_t i = 0, n = aImportList.size(); i < n; ++i ) if ( rImportName == aImportList[ i ]->aUIName ) @@ -558,7 +571,7 @@ GalleryImportThemeEntry* Gallery::ImplGetImportThemeEntry( const rtl::OUString& // ------------------------------------------------------------------------ -rtl::OUString Gallery::GetThemeName( sal_uIntPtr nThemeId ) const +String Gallery::GetThemeName( sal_uIntPtr nThemeId ) const { GalleryThemeEntry* pFound = NULL; @@ -593,7 +606,7 @@ rtl::OUString Gallery::GetThemeName( sal_uIntPtr nThemeId ) const pFound = ( (Gallery*) this )->ImplGetThemeEntry( String::CreateFromAscii( aFallback.GetBuffer() ) ); } - return( pFound ? pFound->GetThemeName() : rtl::OUString() ); + return( pFound ? pFound->GetThemeName() : String() ); } // ------------------------------------------------------------------------ diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index ddf56cbd7c01..1f03f1397b43 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -168,7 +168,7 @@ void SgaObject::WriteData( SvStream& rOut, const String& rDestDir ) const String aURLWithoutDestDir = String(aURL.GetMainURL( INetURLObject::NO_DECODE )); aURLWithoutDestDir.SearchAndReplace(rDestDir, String()); - write_lenPrefixed_uInt8s_FromOUString(rOut, aURLWithoutDestDir, RTL_TEXTENCODING_UTF8); + rOut.WriteByteString(rtl::OUStringToOString(aURLWithoutDestDir, RTL_TEXTENCODING_UTF8)); } // ------------------------------------------------------------------------ @@ -185,8 +185,9 @@ void SgaObject::ReadData(SvStream& rIn, sal_uInt16& rReadVersion ) else rIn >> aThumbMtf; - rtl::OUString aTmpStr = read_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); - aURL = INetURLObject(aTmpStr); + ByteString aTmpStr; + rIn.ReadByteString(aTmpStr); + aURL = INetURLObject(rtl::OStringToOUString(aTmpStr,RTL_TEXTENCODING_UTF8)); } // ------------------------------------------------------------------------ @@ -293,8 +294,9 @@ void SgaObjectBmp::WriteData( SvStream& rOut, const String& rDestDir ) const SgaObject::WriteData( rOut, rDestDir ); char aDummy[ 10 ]; rOut.Write( aDummy, 10 ); - write_lenPrefixed_uInt8s_FromOString(rOut, rtl::OString()); //dummy - write_lenPrefixed_uInt8s_FromOUString(rOut, aTitle, RTL_TEXTENCODING_UTF8); + String aDummyStr; + rOut.WriteByteString(rtl::OUStringToOString(aDummyStr, RTL_TEXTENCODING_UTF8)); + rOut.WriteByteString(rtl::OUStringToOString(aTitle, RTL_TEXTENCODING_UTF8)); } // ------------------------------------------------------------------------ @@ -304,10 +306,14 @@ void SgaObjectBmp::ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) SgaObject::ReadData( rIn, rReadVersion ); rIn.SeekRel( 10 ); // 16, 16, 32, 16 - read_lenPrefixed_uInt8s_ToOString(rIn); //dummy + ByteString aTmpStr; + rIn.ReadByteString(aTmpStr); // dummy if( rReadVersion >= 5 ) - aTitle = read_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); + { + rIn.ReadByteString(aTmpStr); + aTitle = rtl::OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8); + } } // ------------------ @@ -374,7 +380,7 @@ void SgaObjectSound::WriteData( SvStream& rOut, const String& rDestDir ) const { SgaObject::WriteData( rOut, rDestDir ); rOut << (sal_uInt16) eSoundType; - write_lenPrefixed_uInt8s_FromOUString(rOut, aTitle, RTL_TEXTENCODING_UTF8); + rOut.WriteByteString(rtl::OUStringToOString(aTitle, RTL_TEXTENCODING_UTF8)); } // ------------------------------------------------------------------------ @@ -390,7 +396,11 @@ void SgaObjectSound::ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) rIn >> nTmp16; eSoundType = (GalSoundType) nTmp16; if( rReadVersion >= 6 ) - aTitle = read_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); + { + ByteString aTmpStr; + rIn.ReadByteString(aTmpStr); + aTitle = rtl::OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8); + } } } @@ -581,7 +591,7 @@ sal_Bool SgaObjectSvDraw::DrawCentered( OutputDevice* pOut, const FmFormModel& r void SgaObjectSvDraw::WriteData( SvStream& rOut, const String& rDestDir ) const { SgaObject::WriteData( rOut, rDestDir ); - write_lenPrefixed_uInt8s_FromOUString(rOut, aTitle, RTL_TEXTENCODING_UTF8); + rOut.WriteByteString(rtl::OUStringToOString(aTitle, RTL_TEXTENCODING_UTF8)); } // ------------------------------------------------------------------------ @@ -591,7 +601,11 @@ void SgaObjectSvDraw::ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) SgaObject::ReadData( rIn, rReadVersion ); if( rReadVersion >= 5 ) - aTitle = read_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); + { + ByteString aTmpStr; + rIn.ReadByteString(aTmpStr); + aTitle = rtl::OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8); + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 4a34a85ee611..12f1e6d257ab 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -733,7 +733,8 @@ GalleryThemeEntry* GalleryTheme::CreateThemeEntry( const INetURLObject& rURL, sa { sal_uInt32 nThemeId = 0; - rtl::OString aTmpStr = read_lenPrefixed_uInt8s_ToOString(*pIStm); + ByteString aTmpStr; + pIStm->ReadByteString(aTmpStr); aThemeName = rtl::OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8); // Charakterkonvertierung durchfuehren @@ -1354,7 +1355,7 @@ SvStream& GalleryTheme::WriteData( SvStream& rOStm ) const sal_Bool bRel; rOStm << (sal_uInt16) 0x0004; - write_lenPrefixed_uInt8s_FromOUString(rOStm, GetRealName(), RTL_TEXTENCODING_UTF8); + rOStm.WriteByteString(rtl::OUStringToOString(GetRealName(), RTL_TEXTENCODING_UTF8)); rOStm << nCount << (sal_uInt16) osl_getThreadTextEncoding(); for( sal_uInt32 i = 0; i < nCount; i++ ) @@ -1394,7 +1395,7 @@ SvStream& GalleryTheme::WriteData( SvStream& rOStm ) const aPath.SearchAndReplace(m_aDestDir, String()); rOStm << bRel; - write_lenPrefixed_uInt8s_FromOUString(rOStm, aPath, RTL_TEXTENCODING_UTF8); + rOStm.WriteByteString(rtl::OUStringToOString(aPath, RTL_TEXTENCODING_UTF8)); rOStm << pObj->nOffset << (sal_uInt16) pObj->eObjKind; } @@ -1432,9 +1433,10 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm ) String aThemeName; rtl_TextEncoding nTextEncoding; - aImportName = rtl::OUString(); + aImportName = String(); rIStm >> nVersion; - rtl::OString aTmpStr = read_lenPrefixed_uInt8s_ToOString(rIStm); + ByteString aTmpStr; + rIStm.ReadByteString(aTmpStr); rIStm >> nCount; if( nVersion >= 0x0004 ) @@ -1469,12 +1471,13 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm ) { pObj = new GalleryObject; + ByteString aTempFileName; String aFileName; String aPath; sal_uInt16 nTemp; rIStm >> bRel; - rtl::OString aTempFileName = read_lenPrefixed_uInt8s_ToOString(rIStm); + rIStm.ReadByteString(aTempFileName); rIStm >> pObj->nOffset; rIStm >> nTemp; pObj->eObjKind = (SgaObjKind) nTemp; @@ -1580,7 +1583,7 @@ SvStream& operator>>( SvStream& rIn, GalleryTheme& rTheme ) void GalleryTheme::ImplSetModified( sal_Bool bModified ) { pThm->SetModified( bModified ); } -const rtl::OUString& GalleryTheme::GetRealName() const { return pThm->GetThemeName(); } +const String& GalleryTheme::GetRealName() const { return pThm->GetThemeName(); } const INetURLObject& GalleryTheme::GetThmURL() const { return pThm->GetThmURL(); } const INetURLObject& GalleryTheme::GetSdgURL() const { return pThm->GetSdgURL(); } const INetURLObject& GalleryTheme::GetSdvURL() const { return pThm->GetSdvURL(); } @@ -1591,7 +1594,7 @@ sal_Bool GalleryTheme::IsImported() const { return pThm->IsImported(); } sal_Bool GalleryTheme::IsReadOnly() const { return pThm->IsReadOnly(); } sal_Bool GalleryTheme::IsDefault() const { return pThm->IsDefault(); } sal_Bool GalleryTheme::IsModified() const { return pThm->IsModified(); } -const rtl::OUString& GalleryTheme::GetName() const { return IsImported() ? aImportName : pThm->GetThemeName(); } +const String& GalleryTheme::GetName() const { return IsImported() ? aImportName : pThm->GetThemeName(); } void GalleryTheme::InsertAllThemes( ListBox& rListBox ) { |