[Libreoffice-commits] .: 3 commits - editeng/source sd/util
Ivan Timofeev
ivantimofeev at kemper.freedesktop.org
Fri Mar 2 06:49:33 PST 2012
editeng/source/editeng/editdoc.hxx | 14 --------------
editeng/source/editeng/impedit4.cxx | 15 ++++++++++++++-
sd/util/sd.flt | 1 -
3 files changed, 14 insertions(+), 16 deletions(-)
New commits:
commit c1cf8dac6d54f3d0876803ca9dffce23df7241da
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Fri Mar 2 18:44:42 2012 +0400
there was the object comparison, not the pointer comparison
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index d28d664..fd4fa31 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -814,7 +814,16 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput,
case EE_CHAR_FONTINFO_CJK:
case EE_CHAR_FONTINFO_CTL:
{
- sal_uInt32 n = std::find(rFontTable.begin(), rFontTable.end(), (SvxFontItem*)&rItem ) - rFontTable.begin();
+ sal_uInt32 n = 0;
+ for (size_t i = 0; i < rFontTable.size(); ++i)
+ {
+ if (*rFontTable[i] == rItem)
+ {
+ n = i;
+ break;
+ }
+ }
+
rOutput << OOO_STRING_SVTOOLS_RTF_F;
rOutput.WriteNumber( n );
}
commit 0ecb2bd92a9dadb2e01ee5b960a48ed0552e7c06
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Fri Mar 2 10:25:47 2012 +0400
remove traces of SvxFontTable
diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx
index 32bfb24..e9b196c 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -139,20 +139,6 @@ typedef ContentAttribsInfo* ContentAttribsInfoPtr;
SV_DECL_PTRARR( ContentInfoArray, ContentAttribsInfoPtr, 1 )
// ----------------------------------------------------------------------
-// class SvxFontTable
-// ----------------------------------------------------------------------
-DECLARE_TABLE( DummyFontTable, SvxFontItem* )
-
-class SvxFontTable : public DummyFontTable
-{
-public:
- SvxFontTable();
- ~SvxFontTable();
-
- sal_uLong GetId( const SvxFontItem& rFont );
-};
-
-// ----------------------------------------------------------------------
// class SvxColorList
// ----------------------------------------------------------------------
typedef ContentNode* ContentNodePtr;
diff --git a/sd/util/sd.flt b/sd/util/sd.flt
index 83c7634..215ef8e 100644
--- a/sd/util/sd.flt
+++ b/sd/util/sd.flt
@@ -46,7 +46,6 @@ SelRange
SortedPositions_SAR
SvxACorrChars
SvxColorList
-SvxFontTable
SvxRTFStyleType
SvxTabStopArr_SAR
TextPortionList
commit 9e137b29e1cca1d460017f2a1b276be969002d80
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Fri Mar 2 10:24:17 2012 +0400
fix memory leak
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 07d8074..d28d664 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -688,6 +688,10 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel )
rOutput << "}}"; // 1xparentheses paragraphs, 1xparentheses RTF document
rOutput.Flush();
+ std::vector<SvxFontItem*>::iterator it;
+ for (it = aFontTable.begin(); it != aFontTable.end(); ++it)
+ delete *it;
+
#if (OSL_DEBUG_LEVEL > 2) && !defined( UNX )
{
SvFileStream aStream( String( RTL_CONSTASCII_USTRINGPARAM ( "d:\\rtf_out.rtf" ) ), STREAM_WRITE|STREAM_TRUNC );
More information about the Libreoffice-commits
mailing list