summaryrefslogtreecommitdiffstats
path: root/sd/source/filter/eppt
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-09-08 22:47:12 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-09-09 09:23:09 +0100
commit4388c7cab48d3b8ac40e33223e1b5155316f669a (patch)
treeca8e24212c53fe70c555043180b61963444a959e /sd/source/filter/eppt
parentAdd cppunit test for SwScanner that would have caught fdo#40449 (diff)
downloadcore-4388c7cab48d3b8ac40e33223e1b5155316f669a.tar.gz
core-4388c7cab48d3b8ac40e33223e1b5155316f669a.zip
convert the last of sd's ByteStrings to rtl::OString[Buffer]
fix potential bug in "3D" search while I'm at it I guess
Diffstat (limited to 'sd/source/filter/eppt')
-rw-r--r--sd/source/filter/eppt/epptbase.hxx2
-rw-r--r--sd/source/filter/eppt/epptso.cxx2
-rw-r--r--sd/source/filter/eppt/pptx-epptbase.cxx14
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx2
4 files changed, 13 insertions, 7 deletions
diff --git a/sd/source/filter/eppt/epptbase.hxx b/sd/source/filter/eppt/epptbase.hxx
index ae4433d3e3a6..1aef0aa89059 100644
--- a/sd/source/filter/eppt/epptbase.hxx
+++ b/sd/source/filter/eppt/epptbase.hxx
@@ -352,7 +352,7 @@ protected:
::com::sun::star::awt::Size maSize;
::com::sun::star::awt::Point maPosition;
Rectangle maRect;
- ByteString mType;
+ rtl::OString mType;
sal_Bool mbPresObj;
sal_Bool mbEmptyPresObj;
sal_Int32 mnAngle;
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 8e3a424e99d4..62967ac171e1 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -3148,7 +3148,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
}
}
- else if ( ( (sal_Char)'3' == mType.GetChar( 8 ) ) && ( (char)'D' == mType.GetChar( 9 ) ) ) // drawing.3D
+ else if ( (mType.getLength() > 9) && (mType[8] == '3') && (mType[9] == 'D') ) // drawing.3D
{
// SceneObject, CubeObject, SphereObject, LatheObject, ExtrudeObject, PolygonObject
if ( !ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "Bitmap" ) ) ) )
diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx b/sd/source/filter/eppt/pptx-epptbase.cxx
index 25adbbfeb25f..c310a5a34566 100644
--- a/sd/source/filter/eppt/pptx-epptbase.cxx
+++ b/sd/source/filter/eppt/pptx-epptbase.cxx
@@ -43,6 +43,7 @@
#include <vcl/gradient.hxx>
#include <vcl/virdev.hxx>
#include <rtl/ustring.hxx>
+#include <rtl/strbuf.hxx>
#include <svtools/fltcall.hxx>
#include <svtools/wmf.hxx>
#include <sfx2/docfile.hxx>
@@ -765,10 +766,15 @@ sal_Bool PPTWriterBase::GetShapeByIndex( sal_uInt32 nIndex, sal_Bool bGroup )
maPosition = MapPoint( mXShape->getPosition() );
maSize = MapSize( mXShape->getSize() );
maRect = Rectangle( Point( maPosition.X, maPosition.Y ), Size( maSize.Width, maSize.Height ) );
- mType = ByteString( String( mXShape->getShapeType() ), RTL_TEXTENCODING_UTF8 );
- mType.Erase( 0, 13 ); // "com.sun.star." entfernen
- sal_uInt16 nPos = mType.Search( (const char*)"Shape" );
- mType.Erase( nPos, 5 );
+
+ rtl::OStringBuffer aTypeBuffer(rtl::OUStringToOString(
+ mXShape->getShapeType(), RTL_TEXTENCODING_UTF8));
+ // "com.sun.star." entfernen
+ aTypeBuffer.remove(0, RTL_CONSTASCII_LENGTH("com.sun.star."));
+
+ sal_Int32 nPos = aTypeBuffer.toString().indexOf("Shape");
+ aTypeBuffer.remove(nPos, RTL_CONSTASCII_LENGTH("Shape"));
+ mType = aTypeBuffer.makeStringAndClear();
mbPresObj = mbEmptyPresObj = sal_False;
if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsPresentationObject" ) ) ) )
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 6cf83a76c072..b88fcc9f7b3a 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1765,7 +1765,7 @@ void PowerPointExport::WriteShapeTree( FSHelperPtr pFS, PageType ePageType, sal_
}
if ( GetShapeByIndex( GetCurrentGroupIndex(), sal_True ) ) {
- DBG(printf( "mType: \"%s\"\n", mType.GetBuffer() ));
+ DBG(printf( "mType: \"%s\"\n", mType.getStr() ));
aDML.WriteShape( mXShape );
}
}