[Libreoffice-commits] .: 6 commits - cui/source editeng/source filter/source oox/inc oox/source sc/source sd/CppunitTest_sd_filters_test.mk sd/prj sd/qa sd/RdbTarget_sd_filters_test.mk svx/inc svx/source unusedcode.easy vcl/inc vcl/source xmloff/source
Caolán McNamara
caolan at kemper.freedesktop.org
Fri Nov 11 03:55:49 PST 2011
cui/source/dialogs/iconcdlg.cxx | 74 -----------------------
cui/source/inc/iconcdlg.hxx | 2
editeng/source/editeng/editdoc.hxx | 3
editeng/source/editeng/editdoc2.cxx | 11 ---
filter/source/msfilter/svdfppt.cxx | 16 +++-
oox/inc/oox/ppt/slidepersist.hxx | 2
oox/source/drawingml/textparagraphproperties.cxx | 4 -
oox/source/ppt/slidepersist.cxx | 3
sc/source/filter/excel/excrecds.cxx | 10 +--
sc/source/filter/excel/xecontent.cxx | 7 +-
sc/source/filter/excel/xeescher.cxx | 8 +-
sc/source/filter/excel/xestream.cxx | 6 -
sc/source/filter/html/htmlexp2.cxx | 6 -
sc/source/filter/inc/excrecds.hxx | 2
sc/source/filter/inc/htmlexp.hxx | 2
sc/source/filter/inc/xeescher.hxx | 2
sc/source/filter/inc/xestream.hxx | 5 -
sc/source/filter/inc/xistream.hxx | 1
sc/source/filter/lotus/expop.cxx | 6 -
sc/source/filter/xml/xmlwrap.cxx | 40 +++++++-----
sc/source/ui/docshell/docsh3.cxx | 16 ++--
sc/source/ui/docshell/docsh4.cxx | 13 ++--
sc/source/ui/docshell/impex.cxx | 16 ++--
sc/source/ui/docshell/servobj.cxx | 6 -
sc/source/ui/inc/impex.hxx | 2
sd/CppunitTest_sd_filters_test.mk | 4 +
sd/RdbTarget_sd_filters_test.mk | 1
sd/prj/build.lst | 2
sd/qa/unit/data/ppt/pass/CVE-2006-3656.ppt |binary
sd/qa/unit/filters-test.cxx | 30 ++++++++-
svx/inc/svx/gallery.hxx | 3
svx/source/gallery2/galexpl.cxx | 15 ----
svx/source/xml/xmlxtimp.cxx | 30 +++++----
unusedcode.easy | 7 --
vcl/inc/vcl/outdev.hxx | 4 -
vcl/source/gdi/outdev3.cxx | 12 ---
xmloff/source/text/XMLAutoTextEventExport.cxx | 15 ----
xmloff/source/text/XMLAutoTextEventExport.hxx | 18 -----
38 files changed, 152 insertions(+), 252 deletions(-)
New commits:
commit c5e0be4f86bffeafd6642e6eb2c6758f4b27beaa
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 11 11:54:19 2011 +0000
add an initial ppt cve test
diff --git a/sd/CppunitTest_sd_filters_test.mk b/sd/CppunitTest_sd_filters_test.mk
index b708aa9..8e2f505 100644
--- a/sd/CppunitTest_sd_filters_test.mk
+++ b/sd/CppunitTest_sd_filters_test.mk
@@ -128,4 +128,8 @@ $(eval $(call gb_CppunitTest_set_args,sd_filters_test,\
))
# .../spool is required for the (somewhat strange) filter configuration
+# we need to explicitly depend on library sdfilt because it is not implied
+# by a link relation
+$(call gb_CppunitTest_get_target,sd_filters_test) : $(call gb_Library_get_target,sdfilt)
+
# vim: set noet sw=4 ts=4:
diff --git a/sd/RdbTarget_sd_filters_test.mk b/sd/RdbTarget_sd_filters_test.mk
index d3a15d8..5ca0907 100644
--- a/sd/RdbTarget_sd_filters_test.mk
+++ b/sd/RdbTarget_sd_filters_test.mk
@@ -57,6 +57,7 @@ $(eval $(call gb_RdbTarget_add_components,sd_filters_test,\
))
$(eval $(call gb_RdbTarget_add_old_components,sd_filters_test,\
+ embobj \
configmgr \
ucb1 \
ucpfile1 \
diff --git a/sd/prj/build.lst b/sd/prj/build.lst
index e1dc016..91456d3 100644
--- a/sd/prj/build.lst
+++ b/sd/prj/build.lst
@@ -1,3 +1,3 @@
-sd sd : filter TRANSLATIONS:translations animations svx sfx2 stoc canvas LIBXSLT:libxslt oox ure test xmloff NULL
+sd sd : filter TRANSLATIONS:translations animations svx sfx2 stoc canvas embeddedobj LIBXSLT:libxslt oox ure test xmloff NULL
sd sd usr1 - all sd_mkout NULL
sd sd\prj nmake - all sd_prj NULL
diff --git a/sd/qa/unit/data/ppt/fail/.gitignore b/sd/qa/unit/data/ppt/fail/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/sd/qa/unit/data/ppt/indeterminate/.gitignore b/sd/qa/unit/data/ppt/indeterminate/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/sd/qa/unit/data/ppt/pass/.gitignore b/sd/qa/unit/data/ppt/pass/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/sd/qa/unit/data/ppt/pass/CVE-2006-3656.ppt b/sd/qa/unit/data/ppt/pass/CVE-2006-3656.ppt
new file mode 100644
index 0000000..a1fd65a
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/CVE-2006-3656.ppt differ
diff --git a/sd/qa/unit/filters-test.cxx b/sd/qa/unit/filters-test.cxx
index 1ae13d6..c014143 100644
--- a/sd/qa/unit/filters-test.cxx
+++ b/sd/qa/unit/filters-test.cxx
@@ -62,15 +62,18 @@ public:
SdFiltersTest();
::sd::DrawDocShellRef loadURL( const rtl::OUString &rURL );
- virtual bool load(const rtl::OUString &, const rtl::OUString &, const rtl::OUString &) { return false; }
+ virtual bool load( const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData);
+
virtual void setUp();
virtual void tearDown();
- // FIXME: we should add some CVE tests ...
void test();
+ // Ensure CVEs remain unbroken
+ void testCVEs();
CPPUNIT_TEST_SUITE(SdFiltersTest);
CPPUNIT_TEST(test);
+ CPPUNIT_TEST(testCVEs);
CPPUNIT_TEST_SUITE_END();
private:
@@ -155,6 +158,29 @@ void SdFiltersTest::test()
xDocShRef->DoClose();
}
+bool SdFiltersTest::load(const rtl::OUString &rFilter, const rtl::OUString &rURL,
+ const rtl::OUString &rUserData)
+{
+ SfxFilter aFilter(
+ rFilter,
+ rtl::OUString(), 0, 0, rtl::OUString(), 0, rtl::OUString(),
+ rUserData, rtl::OUString() );
+
+ ::sd::DrawDocShellRef xDocShRef = new ::sd::DrawDocShell();
+ SfxMedium* pSrcMed = new SfxMedium(rURL, STREAM_STD_READ, true);
+ pSrcMed->SetFilter(&aFilter);
+ bool bLoaded = xDocShRef->DoLoad(pSrcMed);
+ xDocShRef->DoClose();
+ return bLoaded;
+}
+
+void SdFiltersTest::testCVEs()
+{
+ testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS PowerPoint 97")),
+ getURLFromSrc("/sd/qa/unit/data/ppt/"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdfilt")));
+}
+
SdFiltersTest::SdFiltersTest()
{
}
commit 5aea780bfd46a369ed6c8ef3505dcaeb6f44323d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 11 11:44:24 2011 +0000
This global Reference is problematic, especially for unit tests
The global reference will be torn down after the typelib
infrastructure is gone away. Hopefully a WeakReference is
sufficient for the original requirements
diff --git a/oox/inc/oox/ppt/slidepersist.hxx b/oox/inc/oox/ppt/slidepersist.hxx
index 4faf1aa..1cf9cf7 100644
--- a/oox/inc/oox/ppt/slidepersist.hxx
+++ b/oox/inc/oox/ppt/slidepersist.hxx
@@ -72,7 +72,7 @@ public:
com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > getPage() const { return mxPage; };
#if OSL_DEBUG_LEVEL > 0
- static com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > mxDebugPage;
+ static com::sun::star::uno::WeakReference< com::sun::star::drawing::XDrawPage > mxDebugPage;
#endif
void setMasterPersist( SlidePersistPtr pMasterPersistPtr ){ mpMasterPagePtr = pMasterPersistPtr; }
diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx
index b6c9178..eeb8409 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -475,7 +475,9 @@ void TextParagraphProperties::dump() const
Reference< ::com::sun::star::drawing::XShape > xShape( oox::ppt::PowerPointImport::mpDebugFilterBase->getModelFactory()->createInstance( CREATE_OUSTRING( "com.sun.star.presentation.TitleTextShape" ) ), UNO_QUERY );
Reference< ::com::sun::star::text::XText > xText( xShape, UNO_QUERY );
- ppt::SlidePersist::mxDebugPage->add( xShape );
+ Reference< com::sun::star::drawing::XDrawPage > xDebugPage(ppt::SlidePersist::mxDebugPage.get(), UNO_QUERY);
+ if (xDebugPage.is())
+ xDebugPage->add( xShape );
PropertyMap emptyMap;
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index b93ea3c..91f7734 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -80,12 +80,11 @@ SlidePersist::SlidePersist( XmlFilterBase& rFilter, sal_Bool bMaster, sal_Bool b
}
#if OSL_DEBUG_LEVEL > 0
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SlidePersist::mxDebugPage;
+::com::sun::star::uno::WeakReference< ::com::sun::star::drawing::XDrawPage > SlidePersist::mxDebugPage;
#endif
SlidePersist::~SlidePersist()
{
-
}
sal_Int16 SlidePersist::getLayoutFromValueToken()
commit 2bb0386ecbb6aeebbe7a9390df94ce73457e2fe3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 11 10:27:13 2011 +0000
valgrind: ensure these are initialized
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index fc987b8..2f0cf77 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -4437,12 +4437,15 @@ void PPTCharPropSet::SetColor( sal_uInt32 nColor )
pCharSet->mnAttrSet |= 1 << PPT_CharAttr_FontColor;
}
-PPTRuler::PPTRuler() :
- nRefCount ( 1 ),
- nFlags ( 0 ),
- pTab ( NULL ),
- nTabCount ( 0 )
+PPTRuler::PPTRuler()
+ : nRefCount(1)
+ , nFlags(0)
+ , nDefaultTab(0x240)
+ , pTab(NULL)
+ , nTabCount(0)
{
+ memset(nTextOfs, 0, sizeof(nTextOfs));
+ memset(nBulletOfs, 0, sizeof(nBulletOfs));
}
PPTRuler::~PPTRuler()
@@ -4511,7 +4514,8 @@ PPTTextRulerInterpreter::PPTTextRulerInterpreter( sal_uInt32 nFileOfs, SdrPowerP
rIn >> mpImplRuler->nTextOfs[ i ];
if ( mpImplRuler->nFlags & ( 256 << i ) )
rIn >> mpImplRuler->nBulletOfs[ i ];
- if( mpImplRuler->nBulletOfs[ i ] > 0x7fff) {
+ if( mpImplRuler->nBulletOfs[ i ] > 0x7fff)
+ {
// workaround
// when bullet offset is > 0x7fff, the paragraph should look like
// * first line text
commit e3457b637a9796740e29a31bb0cdabc062b04bbf
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 11 09:12:59 2011 +0000
catch by const ref
diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx
index ca3df70..b61096b 100644
--- a/svx/source/xml/xmlxtimp.cxx
+++ b/svx/source/xml/xmlxtimp.cxx
@@ -218,7 +218,7 @@ SvXMLImportContext *SvxXMLTableImportContext::CreateChildContext( sal_uInt16 nPr
}
}
}
- catch( uno::Exception& )
+ catch (const uno::Exception&)
{
}
}
@@ -266,7 +266,7 @@ void SvxXMLTableImportContext::importMarker( sal_uInt16 nPrfx, const OUString& r
XMLMarkerStyleImport aMarkerStyle( GetImport() );
aMarkerStyle.importXML( xAttrList, rAny, rName );
}
- catch( Exception& )
+ catch (const Exception&)
{
OSL_FAIL("SvxXMLTableImportContext::importMarker(), exception caught!");
}
@@ -282,7 +282,7 @@ void SvxXMLTableImportContext::importDash( sal_uInt16 nPrfx, const OUString& rLo
XMLDashStyleImport aDashStyle( GetImport() );
aDashStyle.importXML( xAttrList, rAny, rName );
}
- catch( Exception& )
+ catch (const Exception&)
{
OSL_FAIL("SvxXMLTableImportContext::importDash(), exception caught!");
}
@@ -298,7 +298,7 @@ void SvxXMLTableImportContext::importHatch( sal_uInt16 nPrfx, const OUString& rL
XMLHatchStyleImport aHatchStyle( GetImport() );
aHatchStyle.importXML( xAttrList, rAny, rName );
}
- catch( Exception& )
+ catch (const Exception&)
{
OSL_FAIL("SvxXMLTableImportContext::importHatch(), exception caught!");
}
@@ -314,7 +314,7 @@ void SvxXMLTableImportContext::importGradient( sal_uInt16 nPrfx, const OUString&
XMLGradientStyleImport aGradientStyle( GetImport() );
aGradientStyle.importXML( xAttrList, rAny, rName );
}
- catch( Exception& )
+ catch (const Exception&)
{
OSL_FAIL("SvxXMLTableImportContext::importGradient(), exception caught!");
}
@@ -330,7 +330,7 @@ void SvxXMLTableImportContext::importBitmap( sal_uInt16 nPrfx, const OUString& r
XMLImageStyle aImageStyle;
aImageStyle.importXML( xAttrList, rAny, rName, GetImport() );
}
- catch( Exception& )
+ catch (const Exception&)
{
OSL_FAIL("SvxXMLTableImportContext::importBitmap(), exception caught!");
}
@@ -423,10 +423,13 @@ bool SvxXMLXTableImport::load( const rtl::OUString &rPath,
else // relative URL into a storage
{
uno::Reference< embed::XStorage > xSubStorage;
- try {
+ try
+ {
xSubStorage = comphelper::OStorageHelper::GetStorageAtPath(
xStorage, rPath, embed::ElementModes::READ, aNasty );
- } catch (uno::Exception &) {
+ }
+ catch (const uno::Exception&)
+ {
}
if( xSubStorage.is() )
openStorageStream( &aParserInput, &pGraphicHelper, xSubStorage );
@@ -447,10 +450,14 @@ bool SvxXMLXTableImport::load( const rtl::OUString &rPath,
if (pGraphicHelper)
xGrfResolver = pGraphicHelper;
- try {
+ try
+ {
uno::Reference< io::XSeekable > xSeek( aParserInput.aInputStream, uno::UNO_QUERY_THROW );
xSeek->seek( 0 );
- } catch( uno::Exception &) {}
+ }
+ catch (const uno::Exception&)
+ {
+ }
uno::Reference< XDocumentHandler > xHandler( new SvxXMLXTableImport( xServiceFactory, xTable, xGrfResolver ) );
xParser->setDocumentHandler( xHandler );
@@ -459,9 +466,8 @@ bool SvxXMLXTableImport::load( const rtl::OUString &rPath,
if( pGraphicHelper )
SvXMLGraphicHelper::Destroy( pGraphicHelper );
}
- catch( uno::Exception& e )
+ catch (const uno::Exception&)
{
- (void)e;
// thrown each time you load a document with property tables that are not
// on the current machine. FIXME: would be better to check a file exists
// before importing ...
commit 328e09955a612b8bcd6962f8af1b5dfb7272871a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Nov 10 22:26:44 2011 +0000
callcatcher: remove some unused code
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index 99e0c6d..519f3d1 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -336,72 +336,6 @@ SvxIconChoiceCtrlEntry* IconChoiceDialog::AddTabPage(
/**********************************************************************
|
-| remove page
-|
-\**********************************************************************/
-
-void IconChoiceDialog::RemoveTabPage( sal_uInt16 nId )
-{
- IconChoicePageData* pData = GetPageData ( nId );
-
- // remove page from list
- if ( pData )
- {
- for ( vector< IconChoicePageData* >::iterator i = maPageList.begin(); i < maPageList.end(); ++i )
- {
- if ( *i == pData )
- {
- maPageList.erase( i );
- break;
- }
- }
-
- // save settings
- if ( pData->pPage )
- {
- pData->pPage->FillUserData();
- String aPageData(pData->pPage->GetUserData());
- if ( aPageData.Len() )
- {
- SvtViewOptions aTabPageOpt( E_TABPAGE, String::CreateFromInt32( pData->nId ) );
-
- SetViewOptUserItem( aTabPageOpt, aPageData );
- }
- }
-
- if ( pData->bOnDemand )
- delete ( SfxItemSet * )&( pData->pPage->GetItemSet() );
-
- delete pData->pPage;
- delete pData;
- }
-
- // remove Icon
- bool bFound = false;
- for ( sal_uLong i=0; i<maIconCtrl.GetEntryCount() && !bFound; i++)
- {
- SvxIconChoiceCtrlEntry* pEntry = maIconCtrl.GetEntry ( i );
- sal_uInt16* pUserData = (sal_uInt16*) pEntry->GetUserData();
-
- if ( *pUserData == nId )
- {
- delete pUserData;
- maIconCtrl.RemoveEntry ( pEntry );
- bFound = true;
- }
- }
-
- // was it the current page ?
- if ( nId == mnCurrentPageId )
- {
- mnCurrentPageId = maPageList.front()->nId;
- }
-
- Invalidate ();
-}
-
-/**********************************************************************
-|
| Paint-method
|
\**********************************************************************/
@@ -481,14 +415,6 @@ void IconChoiceDialog::HidePageImpl ( IconChoicePageData* pData )
// -----------------------------------------------------------------------
-void IconChoiceDialog::RemoveResetButton()
-{
- aResetBtn.Hide();
- bHideResetBtn = true;
-}
-
-// -----------------------------------------------------------------------
-
void IconChoiceDialog::ShowPage( sal_uInt16 nId )
{
bool bInvalidate = GetCurPageId() != nId;
diff --git a/cui/source/inc/iconcdlg.hxx b/cui/source/inc/iconcdlg.hxx
index dde82a1..c76a87b 100644
--- a/cui/source/inc/iconcdlg.hxx
+++ b/cui/source/inc/iconcdlg.hxx
@@ -240,8 +240,6 @@ public :
void SetCurPageId( sal_uInt16 nId ) { mnCurrentPageId = nId; FocusOnIcon( nId ); }
sal_uInt16 GetCurPageId() const { return mnCurrentPageId; }
void ShowPage( sal_uInt16 nId );
- void RemoveTabPage( sal_uInt16 nId );
- void RemoveResetButton();
// liefert ggf. per Map konvertierte lokale Slots
const sal_uInt16* GetInputRanges( const SfxItemPool& );
diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx
index a8e29bc..b29c3a0 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -653,9 +653,10 @@ public:
{ return ( nPos < Count() ) ? GetObject( nPos ) : 0; }
sal_uInt16 GetPos( const ParaPortionPtr &rPtr ) const;
-
+#if OSL_DEBUG_LEVEL > 2
// temporary:
void DbgCheck( EditDoc& rDoc );
+#endif
};
// -------------------------------------------------------------------------
diff --git a/editeng/source/editeng/editdoc2.cxx b/editeng/source/editeng/editdoc2.cxx
index abd8388..332f499 100644
--- a/editeng/source/editeng/editdoc2.cxx
+++ b/editeng/source/editeng/editdoc2.cxx
@@ -379,13 +379,9 @@ sal_uInt16 ParaPortionList::FindParagraph( long nYOffset )
return 0xFFFF; // Should be reachable through EE_PARA_NOT_FOUND!
}
-void ParaPortionList::DbgCheck( EditDoc&
-#ifdef DBG_UTIL
- rDoc
-#endif
- )
+#if OSL_DEBUG_LEVEL > 2
+void ParaPortionList::DbgCheck( EditDoc& rDoc)
{
-#ifdef DBG_UTIL
DBG_ASSERT( Count() == rDoc.Count(), "ParaPortionList::DbgCheck() - Count() unequal!" );
for ( sal_uInt16 i = 0; i < Count(); i++ )
{
@@ -393,9 +389,8 @@ void ParaPortionList::DbgCheck( EditDoc&
DBG_ASSERT( GetObject(i)->GetNode(), "ParaPortionList::DbgCheck() - Null-Pointer in List(2)!" );
DBG_ASSERT( GetObject(i)->GetNode() == rDoc.GetObject(i), "ParaPortionList::DbgCheck() - Entries intersect!" );
}
-#endif
}
-
+#endif
ContentAttribsInfo::ContentAttribsInfo( const SfxItemSet& rParaAttribs ) :
aPrevParaAttribs( rParaAttribs)
diff --git a/svx/inc/svx/gallery.hxx b/svx/inc/svx/gallery.hxx
index eb2b604..236216d 100644
--- a/svx/inc/svx/gallery.hxx
+++ b/svx/inc/svx/gallery.hxx
@@ -244,7 +244,6 @@ public:
const sal_uIntPtr nSgaFormat /* = SGA_FORMAT_ALL */ );
static sal_uIntPtr GetObjCount( const String& rThemeName );
- static sal_uIntPtr GetObjCount( sal_uIntPtr nThemeId );
static sal_Bool GetGraphicObj( const String& rThemeName, sal_uIntPtr nPos,
Graphic* pGraphic = NULL, Bitmap* pThumb = NULL,
@@ -266,8 +265,6 @@ public:
static sal_Bool EndLocking( const String& rThemeName );
static sal_Bool EndLocking( sal_uIntPtr nThemeId );
-
- static sal_Bool DrawCentered( OutputDevice* pOut, const FmFormModel& rModel );
};
#endif // _GALLERY_HXX_
diff --git a/svx/source/gallery2/galexpl.cxx b/svx/source/gallery2/galexpl.cxx
index a107ea8..ccf9b00 100644
--- a/svx/source/gallery2/galexpl.cxx
+++ b/svx/source/gallery2/galexpl.cxx
@@ -253,14 +253,6 @@ sal_uIntPtr GalleryExplorer::GetObjCount( const String& rThemeName )
// ------------------------------------------------------------------------
-sal_uIntPtr GalleryExplorer::GetObjCount( sal_uIntPtr nThemeId )
-{
- Gallery* pGal = ImplGetGallery();
- return( pGal ? GetObjCount( pGal->GetThemeName( nThemeId ) ) : sal_False );
-}
-
-// ------------------------------------------------------------------------
-
sal_Bool GalleryExplorer::GetGraphicObj( const String& rThemeName, sal_uIntPtr nPos,
Graphic* pGraphic, Bitmap* pThumb,
sal_Bool bProgress )
@@ -445,11 +437,4 @@ sal_Bool GalleryExplorer::EndLocking( sal_uIntPtr nThemeId )
return( pGal ? EndLocking( pGal->GetThemeName( nThemeId ) ) : sal_False );
}
-// -----------------------------------------------------------------------------
-
-sal_Bool GalleryExplorer::DrawCentered( OutputDevice* pOut, const FmFormModel& rModel )
-{
- return SgaObjectSvDraw::DrawCentered( pOut, rModel );
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unusedcode.easy b/unusedcode.easy
index d2be88e..38bb958 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -145,8 +145,6 @@ GDIMetaFile::SaveStatus()
GDIMetaFile::Wind(unsigned long)
GDIMetaFile::WindEnd()
GDIMetaFile::WindNext()
-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::StartAnimation(OutputDevice*, Point const&, long, OutputDevice*)
@@ -164,8 +162,6 @@ HeaderBar::InsertItem(unsigned short, Image const&, String const&, long, unsigne
HeaderBar::InsertItem(unsigned short, Image const&, long, unsigned short, unsigned short)
HeaderBar::SetHelpId(unsigned short, rtl::OString const&)
HeaderBar::SetHelpText(unsigned short, String const&)
-IconChoiceDialog::RemoveResetButton()
-IconChoiceDialog::RemoveTabPage(unsigned short)
ImageButton::ImageButton(unsigned short)
ImageList::Clear()
ImageList::RemoveImage(rtl::OUString const&)
@@ -272,7 +268,6 @@ Octree::AddColor(BitmapColor const&)
Octree::Octree(unsigned long)
OdtGeneratorPrivate::_writeBegin()
OutputDevice::DrawNativeControlText(unsigned int, unsigned int, Rectangle const&, unsigned int, ImplControlValue const&, rtl::OUString)
-OutputDevice::GetFontSubstitute(unsigned short, String&, String&, unsigned short&)
OutputDevice::GetMinKashida(Font const&) const
OutputDevice::GetPixel(Polygon const&) const
OutputDevice::ImplFloatDevicePixelToLogicHeight(float) const
@@ -291,7 +286,6 @@ OutputDevice::PixelToLogic(basegfx::B2DPolyPolygon const&) const
OutputDevice::PixelToLogic(basegfx::B2DPolygon const&) const
PageSpan::getMarginLeft() const
PageSpan::getMarginRight() const
-ParaPortionList::DbgCheck(EditDoc&)
ParagraphObj::ParagraphObj(ParagraphObj&)
ParagraphStyleManager::get(WPXString const&) const
PathDialog::SetPath(Edit const&)
@@ -1207,7 +1201,6 @@ WrongRanges::_ForEach(unsigned short, unsigned short, unsigned char (*)(WrongRan
X11SalGraphics::SetMask(int&, int&, unsigned int&, unsigned int&, int&, int&, unsigned long)
X509Certificate_NssImpl::getImplementation(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>)
XFillExchangeData::RegisterClipboardFormatName()
-XMLAutoTextEventExport::XMLAutoTextEventExport(com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::xml::sax::XDocumentHandler> const&, com::sun::star::uno::Reference<com::sun::star::frame::XModel> const&, com::sun::star::uno::Reference<com::sun::star::container::XNameAccess> const&, unsigned short)
XMLElement::Equals(rtl::OUString)
XMLEmbeddedObjectExportFilter::XMLEmbeddedObjectExportFilter()
XMLErrors::AddRecord(int, com::sun::star::uno::Sequence<rtl::OUString> const&)
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index 6aacf92..17b94db 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -1157,10 +1157,6 @@ public:
sal_uInt16 nFlags = 0 );
static void RemoveFontSubstitute( sal_uInt16 n );
static sal_uInt16 GetFontSubstituteCount();
- static void GetFontSubstitute( sal_uInt16 n,
- XubString& rFontName,
- XubString& rReplaceFontName,
- sal_uInt16& rFlags );
static Font GetDefaultFont( sal_uInt16 nType,
LanguageType eLang,
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 6cd8e34..7c41755 100755
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -418,18 +418,6 @@ sal_uInt16 OutputDevice::GetFontSubstituteCount()
// -----------------------------------------------------------------------
-void OutputDevice::GetFontSubstitute( sal_uInt16 n,
- XubString& rFontName,
- XubString& rReplaceFontName,
- sal_uInt16& rFlags )
-{
- const ImplDirectFontSubstitution* pSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
- if( pSubst )
- pSubst->GetFontSubstitute( n, rFontName, rReplaceFontName, rFlags );
-}
-
-// -----------------------------------------------------------------------
-
bool ImplDirectFontSubstitution::GetFontSubstitute( int nIndex,
String& rFontName, String& rSubstFontName, sal_uInt16& rFlags ) const
{
diff --git a/xmloff/source/text/XMLAutoTextEventExport.cxx b/xmloff/source/text/XMLAutoTextEventExport.cxx
index f83570e..690f4dc 100644
--- a/xmloff/source/text/XMLAutoTextEventExport.cxx
+++ b/xmloff/source/text/XMLAutoTextEventExport.cxx
@@ -84,25 +84,10 @@ XMLAutoTextEventExport::XMLAutoTextEventExport(
{
}
-XMLAutoTextEventExport::XMLAutoTextEventExport(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- const OUString& rFileName,
- const Reference<XDocumentHandler> & rHandler,
- const Reference<XModel> & rModel,
- const Reference<XNameAccess> & rEvents,
- sal_uInt16 /*nFlags*/ )
-: SvXMLExport( xServiceFactory, rFileName, rHandler, rModel, FUNIT_INCH),
- xEvents(rEvents),
- sEventType(RTL_CONSTASCII_USTRINGPARAM("EventType")),
- sNone(RTL_CONSTASCII_USTRINGPARAM("None"))
-{
-}
-
XMLAutoTextEventExport::~XMLAutoTextEventExport()
{
}
-
void XMLAutoTextEventExport::initialize(
const Sequence<Any> & rArguments )
throw(uno::Exception, uno::RuntimeException)
diff --git a/xmloff/source/text/XMLAutoTextEventExport.hxx b/xmloff/source/text/XMLAutoTextEventExport.hxx
index 28cb956..f77e892 100644
--- a/xmloff/source/text/XMLAutoTextEventExport.hxx
+++ b/xmloff/source/text/XMLAutoTextEventExport.hxx
@@ -65,28 +65,10 @@ class XMLAutoTextEventExport : public SvXMLExport
public:
- // #110680#
- //XMLAutoTextEventExport();
XMLAutoTextEventExport(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, sal_uInt16 nFlags
);
- // #110680#
- //XMLAutoTextEventExport(
- // const ::rtl::OUString& rFileName,
- // const ::com::sun::star::uno::Reference<
- // ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
- // const ::com::sun::star::uno::Reference<
- // ::com::sun::star::frame::XModel > & rModel,
- // const ::com::sun::star::uno::Reference<
- // ::com::sun::star::container::XNameAccess > & rEvents);
- XMLAutoTextEventExport(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- const ::rtl::OUString& rFileName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & rModel,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & rEvents, sal_uInt16 nFlags);
-
~XMLAutoTextEventExport();
// XInitialization
commit 6ddb02bad568be58c8728a40c43b81232c1ca4a0
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Nov 10 22:11:00 2011 +0000
ByteString->rtl::OString
diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx
index 9e39fad..71a1939 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -410,9 +410,9 @@ sal_uInt16 ExcBundlesheetBase::GetNum( void ) const
ExcBundlesheet::ExcBundlesheet( RootData& rRootData, SCTAB _nTab ) :
ExcBundlesheetBase( rRootData, _nTab )
{
- String sTabName = rRootData.pER->GetTabInfo().GetScTabName( _nTab );
- OSL_ENSURE( sTabName.Len() < 256, "ExcBundlesheet::ExcBundlesheet - table name too long" );
- aName = ByteString( sTabName, rRootData.pER->GetTextEncoding() );
+ rtl::OUString sTabName = rRootData.pER->GetTabInfo().GetScTabName( _nTab );
+ OSL_ENSURE( sTabName.getLength() < 256, "ExcBundlesheet::ExcBundlesheet - table name too long" );
+ aName = rtl::OUStringToOString(sTabName, rRootData.pER->GetTextEncoding());
}
@@ -421,13 +421,13 @@ void ExcBundlesheet::SaveCont( XclExpStream& rStrm )
nOwnPos = rStrm.GetSvStreamPos();
rStrm << (sal_uInt32) 0x00000000 // dummy (stream position of the sheet)
<< nGrbit;
- rStrm.WriteByteString( aName ); // 8 bit length, max 255 chars
+ rStrm.WriteByteString(aName); // 8 bit length, max 255 chars
}
sal_Size ExcBundlesheet::GetLen() const
{
- return 7 + Min( aName.Len(), (xub_StrLen) 255 );
+ return 7 + Min( aName.getLength(), (sal_Int32) 255 );
}
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index bcfd95a..1d87945 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -384,12 +384,13 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rU
mnFlags |= EXC_HLINK_ABS;
mnFlags |= EXC_HLINK_BODY;
- ByteString aAsciiLink( aFileName, rRoot.GetTextEncoding() );
+ rtl::OString aAsciiLink(rtl::OUStringToOString(aFileName,
+ rRoot.GetTextEncoding()));
XclExpString aLink( aFileName, EXC_STR_FORCEUNICODE, 255 );
aXclStrm << XclTools::maGuidFileMoniker
<< nLevel
- << sal_uInt32( aAsciiLink.Len() + 1 ); // string length + 1 trailing zero byte
- aXclStrm.Write( aAsciiLink.GetBuffer(), aAsciiLink.Len() );
+ << sal_uInt32( aAsciiLink.getLength() + 1 ); // string length + 1 trailing zero byte
+ aXclStrm.Write( aAsciiLink.getStr(), aAsciiLink.getLength() );
aXclStrm << sal_uInt8( 0 )
<< sal_uInt32( 0xDEADFFFF );
aXclStrm.WriteZeroBytes( 20 );
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 2a290c3..3d1e3d7 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1234,7 +1234,7 @@ XclExpNote::XclExpNote( const XclExpRoot& rRoot, const ScAddress& rScPos,
switch( rRoot.GetBiff() )
{
case EXC_BIFF5:
- maNoteText = ByteString( aNoteText, rRoot.GetTextEncoding() );
+ maNoteText = rtl::OUStringToOString(aNoteText, rRoot.GetTextEncoding());
break;
case EXC_BIFF8:
@@ -1276,15 +1276,15 @@ void XclExpNote::Save( XclExpStream& rStrm )
case EXC_BIFF5:
{
// write the NOTE record directly, there may be the need to create more than one
- const sal_Char* pcBuffer = maNoteText.GetBuffer();
- sal_uInt16 nCharsLeft = static_cast< sal_uInt16 >( maNoteText.Len() );
+ const sal_Char* pcBuffer = maNoteText.getStr();
+ sal_uInt16 nCharsLeft = static_cast< sal_uInt16 >( maNoteText.getLength() );
while( nCharsLeft )
{
sal_uInt16 nWriteChars = ::std::min( nCharsLeft, EXC_NOTE5_MAXLEN );
rStrm.StartRecord( EXC_ID_NOTE, 6 + nWriteChars );
- if( pcBuffer == maNoteText.GetBuffer() )
+ if( pcBuffer == maNoteText.getStr() )
{
// first record: row, col, length of complete text
rStrm << static_cast< sal_uInt16 >( maScPos.Row() )
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 8d71190..3cd38c7 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -348,10 +348,10 @@ void XclExpStream::WriteUnicodeBuffer( const ScfUInt16Vec& rBuffer, sal_uInt8 nF
// Xcl has an obscure sense of whether starting a new record or not,
// and crashes if it encounters the string header at the very end of a record.
// Thus we add 1 to give some room, seems like they do it that way but with another count (10?)
-void XclExpStream::WriteByteString( const ByteString& rString, sal_uInt16 nMaxLen, bool b16BitCount )
+void XclExpStream::WriteByteString( const rtl::OString& rString, sal_uInt16 nMaxLen, bool b16BitCount )
{
SetSliceSize( 0 );
- sal_Size nLen = ::std::min< sal_Size >( rString.Len(), nMaxLen );
+ sal_Size nLen = ::std::min< sal_Size >( rString.getLength(), nMaxLen );
if( !b16BitCount )
nLen = ::std::min< sal_Size >( nLen, 0xFF );
@@ -364,7 +364,7 @@ void XclExpStream::WriteByteString( const ByteString& rString, sal_uInt16 nMaxLe
operator<<( static_cast< sal_uInt16 >( nLen ) );
else
operator<<( static_cast< sal_uInt8 >( nLen ) );
- Write( rString.GetBuffer(), nLen );
+ Write( rString.getStr(), nLen );
}
void XclExpStream::WriteCharBuffer( const ScfUInt8Vec& rBuffer )
diff --git a/sc/source/filter/html/htmlexp2.cxx b/sc/source/filter/html/htmlexp2.cxx
index 607caed..bfeeb1b 100644
--- a/sc/source/filter/html/htmlexp2.cxx
+++ b/sc/source/filter/html/htmlexp2.cxx
@@ -198,7 +198,7 @@ void ScHTMLExport::WriteGraphEntry( ScHTMLGraphEntry* pE )
void ScHTMLExport::WriteImage( String& rLinkName, const Graphic& rGrf,
- const ByteString& rImgOptions, sal_uLong nXOutFlags )
+ const rtl::OString& rImgOptions, sal_uLong nXOutFlags )
{
// embeddete Grafik -> via WriteGraphic schreiben
if( !rLinkName.Len() )
@@ -241,8 +241,8 @@ void ScHTMLExport::WriteImage( String& rLinkName, const Graphic& rGrf,
HTMLOutFuncs::Out_String( rStrm, URIHelper::simpleNormalizedMakeRelative(
aBaseURL,
rLinkName ), eDestEnc ) << '\"';
- if ( rImgOptions.Len() )
- rStrm << rImgOptions.GetBuffer();
+ if ( rImgOptions.getLength() )
+ rStrm << rImgOptions.getStr();
rStrm << '>' << sNewLine << GetIndentStr();
}
}
diff --git a/sc/source/filter/inc/excrecds.hxx b/sc/source/filter/inc/excrecds.hxx
index 747ca08..2d15ba4 100644
--- a/sc/source/filter/inc/excrecds.hxx
+++ b/sc/source/filter/inc/excrecds.hxx
@@ -295,7 +295,7 @@ public:
class ExcBundlesheet : public ExcBundlesheetBase
{
private:
- ByteString aName;
+ rtl::OString aName;
virtual void SaveCont( XclExpStream& rStrm );
diff --git a/sc/source/filter/inc/htmlexp.hxx b/sc/source/filter/inc/htmlexp.hxx
index ecf90b4..3fd3ad6 100644
--- a/sc/source/filter/inc/htmlexp.hxx
+++ b/sc/source/filter/inc/htmlexp.hxx
@@ -132,7 +132,7 @@ class ScHTMLExport : public ScExportBase
void WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab );
void WriteGraphEntry( ScHTMLGraphEntry* );
void WriteImage( String& rLinkName,
- const Graphic&, const ByteString& rImgOptions,
+ const Graphic&, const rtl::OString& rImgOptions,
sal_uLong nXOutFlags = 0 );
// nXOutFlags fuer XOutBitmap::WriteGraphic
diff --git a/sc/source/filter/inc/xeescher.hxx b/sc/source/filter/inc/xeescher.hxx
index 34c80c4..7f2cc1f 100644
--- a/sc/source/filter/inc/xeescher.hxx
+++ b/sc/source/filter/inc/xeescher.hxx
@@ -376,7 +376,7 @@ private:
private:
XclExpString maAuthor; /// Name of the author.
String maOrigNoteText; /// Original main text of the note.
- ByteString maNoteText; /// Main text of the note (<=BIFF7).
+ rtl::OString maNoteText; /// Main text of the note (<=BIFF7).
XclExpStringRef mpNoteContents; /// Text and formatting data (OOXML)
ScAddress maScPos; /// Calc cell address of the note.
sal_uInt16 mnObjId; /// Escher object ID (BIFF8).
diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx
index 1af271b..7d4abbe 100644
--- a/sc/source/filter/inc/xestream.hxx
+++ b/sc/source/filter/inc/xestream.hxx
@@ -50,7 +50,6 @@
/* ============================================================================
Output stream class for Excel export
- CONTINUE record handling
-- ByteString and UniString support
============================================================================ */
class XclExpRoot;
@@ -143,9 +142,9 @@ public:
// *** write 8-bit-strings ***
// (slice length setting has no effect here -> disabled automatically)
- /** Writes string length field and ByteString buffer. */
+ /** Writes string length field and rtl::OString buffer. */
void WriteByteString(
- const ByteString& rString,
+ const rtl::OString& rString,
sal_uInt16 nMaxLen = 0x00FF,
bool b16BitCount = false );
diff --git a/sc/source/filter/inc/xistream.hxx b/sc/source/filter/inc/xistream.hxx
index 238997e..ac5a84a 100644
--- a/sc/source/filter/inc/xistream.hxx
+++ b/sc/source/filter/inc/xistream.hxx
@@ -40,7 +40,6 @@ class XclImpRoot;
/* ============================================================================
Input stream class for Excel import
- CONTINUE record handling
-- ByteString and UniString support
- Decryption
============================================================================ */
diff --git a/sc/source/filter/lotus/expop.cxx b/sc/source/filter/lotus/expop.cxx
index c1b0ae2..3c80c0b 100644
--- a/sc/source/filter/lotus/expop.cxx
+++ b/sc/source/filter/lotus/expop.cxx
@@ -164,11 +164,11 @@ void ExportWK1::Label( const sal_uInt16 nCol, const sal_uInt16 nRow, const Strin
OSL_ENSURE( nCol <= WK1MAXCOL, "ExportWK1::Label(): Col > WK1MAXCOL" );
OSL_ENSURE( nRow <= WK1MAXROW, "ExportWK1::Label(): Row > WK1MAXROW" );
- ByteString aStr( rStr, eZielChar );
+ rtl::OString aStr(rtl::OUStringToOString(rStr, eZielChar));
sal_uInt16 nLaenge = 7; // Anzahl Bytes vor String+Nullbyte am Ende + Alignment-Char
- xub_StrLen nAnz = aStr.Len();
+ sal_Int32 nAnz = aStr.getLength();
if( nAnz > 240 ) // max. 240 Zeichen im String
@@ -179,7 +179,7 @@ void ExportWK1::Label( const sal_uInt16 nCol, const sal_uInt16 nRow, const Strin
aOut << ( sal_uInt16 ) 0x0F << nLaenge << GenFormByte( aAttr ) << nCol << nRow << ( sal_Char ) '\'';
// ACHTUNG: ZUNAECHST NUR LEFT ALIGNMENT
- aOut.Write( aStr.GetBuffer(), nAnz );
+ aOut.Write( aStr.getStr(), nAnz );
aOut << ( sal_uInt8 ) 0x00; // ...und Nullterminator anhaengen
}
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index ba9d4fc..a86d9ed 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -66,6 +66,7 @@
#include <svx/xmleohlp.hxx>
#include <rtl/logfile.hxx>
+#include <rtl/strbuf.hxx>
#include <unotools/saveopt.hxx>
#include "document.hxx"
@@ -220,9 +221,10 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe
{
#if OSL_DEBUG_LEVEL > 0
- ByteString aError( "SAX parse exception catched while importing:\n" );
- aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US );
- OSL_FAIL( aError.GetBuffer() );
+ rtl::OStringBuffer aError(RTL_CONSTASCII_STRINGPARAM(
+ "SAX parse exception catched while importing:\n"));
+ aError.append(rtl::OUStringToOString(r.Message, RTL_TEXTENCODING_ASCII_US));
+ OSL_FAIL(aError.getStr());
#endif
String sErr( String::CreateFromInt32( r.LineNumber ));
@@ -256,9 +258,11 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe
{
#if OSL_DEBUG_LEVEL > 0
- ByteString aError( "SAX exception catched while importing:\n" );
- aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US );
- OSL_FAIL( aError.GetBuffer() );
+ rtl::OStringBuffer aError(RTL_CONSTASCII_STRINGPARAM(
+ "SAX exception catched while importing:\n"));
+ aError.append(rtl::OUStringToOString(r.Message,
+ RTL_TEXTENCODING_ASCII_US));
+ OSL_FAIL(aError.getStr());
#endif
(void)r; // avoid warning in product version
@@ -268,9 +272,11 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe
catch( const packages::zip::ZipIOException& r )
{
#if OSL_DEBUG_LEVEL > 0
- ByteString aError( "Zip exception catched while importing:\n" );
- aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US );
- OSL_FAIL( aError.GetBuffer() );
+ rtl::OStringBuffer aError(RTL_CONSTASCII_STRINGPARAM(
+ "Zip exception catched while importing:\n"));
+ aError.append(rtl::OUStringToOString(r.Message,
+ RTL_TEXTENCODING_ASCII_US));
+ OSL_FAIL( aError.getStr() );
#endif
(void)r; // avoid warning in product version
@@ -279,9 +285,11 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe
catch( const io::IOException& r )
{
#if OSL_DEBUG_LEVEL > 0
- ByteString aError( "IO exception catched while importing:\n" );
- aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US );
- OSL_FAIL( aError.GetBuffer() );
+ rtl::OStringBuffer aError(RTL_CONSTASCII_STRINGPARAM(
+ "IO exception catched while importing:\n"));
+ aError.append(rtl::OUStringToOString(r.Message,
+ RTL_TEXTENCODING_ASCII_US));
+ OSL_FAIL(aError.getStr());
#endif
(void)r; // avoid warning in product version
@@ -290,9 +298,11 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe
catch( const uno::Exception& r )
{
#if OSL_DEBUG_LEVEL > 0
- ByteString aError( "uno exception catched while importing:\n" );
- aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US );
- OSL_FAIL( aError.GetBuffer() );
+ rtl::OStringBuffer aError(RTL_CONSTASCII_STRINGPARAM(
+ "uno exception catched while importing:\n"));
+ aError.append(rtl::OUStringToOString(r.Message,
+ RTL_TEXTENCODING_ASCII_US));
+ OSL_FAIL(aError.getStr());
#endif
(void)r; // avoid warning in product version
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 2335566..b392c2d 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -39,20 +39,21 @@
#include "scitems.hxx"
#include "rangelst.hxx"
#include <editeng/flstitem.hxx>
-#include <svx/pageitem.hxx>
#include <editeng/paperinf.hxx>
-#include <svx/postattr.hxx>
#include <editeng/sizeitem.hxx>
-#include <unotools/misccfg.hxx>
+#include <rtl/strbuf.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/app.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/printer.hxx>
#include <svtools/ctrltool.hxx>
+#include <svx/pageitem.hxx>
+#include <svx/postattr.hxx>
+#include <unotools/localedatawrapper.hxx>
+#include <unotools/misccfg.hxx>
#include <vcl/virdev.hxx>
#include <vcl/svapp.hxx>
#include <vcl/msgbox.hxx>
-#include <unotools/localedatawrapper.hxx>
#include "docsh.hxx"
#include "docshimp.hxx"
@@ -963,9 +964,10 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
String aValue;
if ( eSourceType == SC_CAT_CONTENT )
((const ScChangeActionContent*)pSourceAction)->GetNewString( aValue );
- ByteString aError( aValue, gsl_getSystemTextEncoding() );
- aError += " weggelassen";
- OSL_FAIL( aError.GetBuffer() );
+ rtl::OStringBuffer aError(rtl::OUStringToOString(aValue,
+ osl_getThreadTextEncoding()));
+ aError.append(RTL_CONSTASCII_STRINGPARAM(" weggelassen"));
+ OSL_FAIL( aError.getStr() );
#endif
}
else
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 858809b..cb30e00 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -2018,10 +2018,11 @@ long ScDocShell::DdeGetData( const String& rItem,
{
if( rItem.EqualsIgnoreCaseAscii( "Format" ) )
{
- ByteString aFmtByte( aDdeTextFmt, gsl_getSystemTextEncoding() );
+ rtl::OString aFmtByte(rtl::OUStringToOString(aDdeTextFmt,
+ osl_getThreadTextEncoding()));
rValue <<= ::com::sun::star::uno::Sequence< sal_Int8 >(
- (sal_Int8*)aFmtByte.GetBuffer(),
- aFmtByte.Len() + 1 );
+ (const sal_Int8*)aFmtByte.getStr(),
+ aFmtByte.getLength() + 1 );
return 1;
}
ScImportExport aObj( &aDocument, rItem );
@@ -2033,13 +2034,13 @@ long ScDocShell::DdeGetData( const String& rItem,
if( aDdeTextFmt.EqualsAscii( "SYLK" ) ||
aDdeTextFmt.EqualsAscii( "FSYLK" ) )
{
- ByteString aData;
+ rtl::OString aData;
if( aObj.ExportByteString( aData, gsl_getSystemTextEncoding(),
SOT_FORMATSTR_ID_SYLK ) )
{
rValue <<= ::com::sun::star::uno::Sequence< sal_Int8 >(
- (sal_Int8*)aData.GetBuffer(),
- aData.Len() + 1 );
+ (const sal_Int8*)aData.getStr(),
+ aData.getLength() + 1 );
return 1;
}
else
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index f8b0a9c..146ff58 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -342,9 +342,9 @@ sal_Bool ScImportExport::ExportString( ::rtl::OUString& rText, sal_uLong nFmt )
if ( nFmt != FORMAT_STRING )
{
rtl_TextEncoding eEnc = gsl_getSystemTextEncoding();
- ByteString aTmp;
+ rtl::OString aTmp;
sal_Bool bOk = ExportByteString( aTmp, eEnc, nFmt );
- rText = UniString( aTmp, eEnc );
+ rText = rtl::OStringToOUString( aTmp, eEnc );
return bOk;
}
// nSizeLimit not needed for OUString
@@ -368,7 +368,7 @@ sal_Bool ScImportExport::ExportString( ::rtl::OUString& rText, sal_uLong nFmt )
}
-sal_Bool ScImportExport::ExportByteString( ByteString& rText, rtl_TextEncoding eEnc, sal_uLong nFmt )
+sal_Bool ScImportExport::ExportByteString( rtl::OString& rText, rtl_TextEncoding eEnc, sal_uLong nFmt )
{
OSL_ENSURE( eEnc != RTL_TEXTENCODING_UNICODE, "ScImportExport::ExportByteString: Unicode not supported" );
if ( eEnc == RTL_TEXTENCODING_UNICODE )
@@ -392,7 +392,7 @@ sal_Bool ScImportExport::ExportByteString( ByteString& rText, rtl_TextEncoding e
return sal_True;
}
}
- rText.Erase();
+ rText = rtl::OString();
return false;
}
@@ -534,8 +534,8 @@ void ScImportExport::WriteUnicodeOrByteString( SvStream& rStrm, const String& rS
}
else
{
- ByteString aByteStr( rString, eEnc );
- rStrm << aByteStr.GetBuffer();
+ rtl::OString aByteStr(rtl::OUStringToOString(rString, eEnc));
+ rStrm << aByteStr.getStr();
if ( bZero )
rStrm << sal_Char(0);
}
@@ -1560,7 +1560,7 @@ sal_Bool ScImportExport::Sylk2Doc( SvStream& rStrm )
{
String aLine;
String aText;
- ByteString aByteLine;
+ rtl::OString aByteLine;
SCCOL nCol = nStartCol;
SCROW nRow = nStartRow;
SCCOL nRefCol = 1;
@@ -1570,7 +1570,7 @@ sal_Bool ScImportExport::Sylk2Doc( SvStream& rStrm )
{
//! allow unicode
rStrm.ReadLine( aByteLine );
- aLine = String( aByteLine, rStrm.GetStreamCharSet() );
+ aLine = rtl::OStringToOUString(aByteLine, rStrm.GetStreamCharSet());
if( rStrm.IsEof() )
break;
const sal_Unicode* p = aLine.GetBuffer();
diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx
index 6bd9f6d..d542254 100644
--- a/sc/source/ui/docshell/servobj.cxx
+++ b/sc/source/ui/docshell/servobj.cxx
@@ -188,12 +188,12 @@ sal_Bool ScServerObject::GetData(
if( aDdeTextFmt.EqualsAscii( "SYLK" ) ||
aDdeTextFmt.EqualsAscii( "FSYLK" ) )
{
- ByteString aByteData;
+ rtl::OString aByteData;
if( aObj.ExportByteString( aByteData, gsl_getSystemTextEncoding(), SOT_FORMATSTR_ID_SYLK ) )
{
rData <<= ::com::sun::star::uno::Sequence< sal_Int8 >(
- (sal_Int8*)aByteData.GetBuffer(),
- aByteData.Len() + 1 );
+ (const sal_Int8*)aByteData.getStr(),
+ aByteData.getLength() + 1 );
return 1;
}
return 0;
diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx
index a4c28b1..302cf4e 100644
--- a/sc/source/ui/inc/impex.hxx
+++ b/sc/source/ui/inc/impex.hxx
@@ -136,7 +136,7 @@ public:
sal_Bool ImportString( const ::rtl::OUString&, sal_uLong=FORMAT_STRING );
sal_Bool ExportString( ::rtl::OUString&, sal_uLong=FORMAT_STRING );
- sal_Bool ExportByteString( ByteString&, rtl_TextEncoding, sal_uLong=FORMAT_STRING );
+ sal_Bool ExportByteString( ::rtl::OString&, rtl_TextEncoding, sal_uLong=FORMAT_STRING );
sal_Bool ImportStream( SvStream&, const String& rBaseURL, sal_uLong=FORMAT_STRING );
sal_Bool ExportStream( SvStream&, const String& rBaseURL, sal_uLong=FORMAT_STRING );
More information about the Libreoffice-commits
mailing list