Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3464

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/64/3464/1

Some clean up related to copy&paste function

Including SvStream file format version, SvStream character encoding,
numbering rule level depth and font conversion.

Change-Id: I3d781468b1878d7c6589ef4a313c66bf00e4d75b
---
M editeng/inc/editeng/numitem.hxx
M editeng/source/editeng/editobj.cxx
M editeng/source/items/numitem.cxx
3 files changed, 11 insertions(+), 23 deletions(-)



diff --git a/editeng/inc/editeng/numitem.hxx b/editeng/inc/editeng/numitem.hxx
index f17e9cf..546f82d 100644
--- a/editeng/inc/editeng/numitem.hxx
+++ b/editeng/inc/editeng/numitem.hxx
@@ -161,7 +161,7 @@
 
     virtual ~SvxNumberFormat();
 
-    SvStream&       Store(SvStream &rStream, FontToSubsFontConverter pConverter);
+    SvStream&       Store(SvStream &rStream);
     SvxNumberFormat* Create(SvStream& rStream );
 
     SvxNumberFormat& operator=( const SvxNumberFormat&  );
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index 8231396..8ef79a1 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -890,7 +890,7 @@
 
 void EditTextObjectImpl::StoreData( SvStream& rOStream ) const
 {
-    sal_uInt16 nVer = 602;
+    sal_uInt16 nVer = SOFFICE_FILEFORMAT_CURRENT;
     rOStream << nVer;
 
     rOStream << static_cast<sal_Bool>(bOwnerOfPool);
@@ -1059,6 +1059,7 @@
 void EditTextObjectImpl::CreateData( SvStream& rIStream )
 {
     rIStream >> nVersion;
+    rIStream.SetVersion( nVersion );
 
     // The text object was first created with the current setting of
     // pTextObjectPool.
@@ -1087,6 +1088,7 @@
     rIStream >> nCharSet;
 
     rtl_TextEncoding eSrcEncoding = GetSOLoadTextEncoding( (rtl_TextEncoding)nCharSet );
+    rIStream.SetStreamCharSet( eSrcEncoding );
 
     // The number of paragraphs ...
     sal_uInt16 nParagraphs;
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 7ef42e0..aaf313c 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -237,15 +237,8 @@
     delete pBulletFont;
 }
 
-SvStream&   SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pConverter)
+SvStream&   SvxNumberFormat::Store(SvStream &rStream)
 {
-    if(pConverter && pBulletFont)
-    {
-        cBullet = ConvertFontToSubsFontChar(pConverter, cBullet);
-        String sFontName = GetFontToSubsFontName(pConverter);
-        pBulletFont->SetName(sFontName);
-    }
-
     rStream << (sal_uInt16)NUMITEM_VERSION_04;
 
     rStream << (sal_uInt16)GetNumberingType();
@@ -691,7 +684,9 @@
     rStream >> nTmp16; bContinuousNumbering = nTmp16;
     rStream >> nTmp16; eNumberingType = ( SvxNumRuleType )nTmp16;
 
-    for (sal_uInt16 i = 0; i < SVX_MAX_NUM; i++)
+    sal_uInt16 nLevels = SVX_MAX_NUM;
+    rStream >> nLevels;
+    for (sal_uInt16 i = 0; i < nLevels; i++)
     {
         rStream >> nTmp16;
         sal_Bool hasNumberingFormat = nTmp16;
@@ -723,29 +718,20 @@
     rStream<<(sal_uInt16)bContinuousNumbering;
     rStream<<(sal_uInt16)eNumberingType;
 
-    FontToSubsFontConverter pConverter = 0;
-    sal_Bool bConvertBulletFont = ( rStream.GetVersion() <= SOFFICE_FILEFORMAT_50 ) && ( 
rStream.GetVersion() );
+    //number of levels
+    rStream<<(sal_uInt16)SVX_MAX_NUM;
     for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++)
     {
         if(aFmts[i])
         {
             rStream << sal_uInt16(1);
-            if(bConvertBulletFont && aFmts[i]->GetBulletFont())
-            {
-                if(!pConverter)
-                    pConverter =
-                        CreateFontToSubsFontConverter(aFmts[i]->GetBulletFont()->GetName(),
-                                    FONTTOSUBSFONT_EXPORT|FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS);
-            }
-            aFmts[i]->Store(rStream, pConverter);
+            aFmts[i]->Store(rStream);
         }
         else
             rStream << sal_uInt16(0);
     }
     //second save of nFeatureFlags for new versions
     rStream<<(sal_uInt16)nFeatureFlags;
-    if(pConverter)
-        DestroyFontToSubsFontConverter(pConverter);
 
     return rStream;
 }

-- 
To view, visit https://gerrit.libreoffice.org/3464
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d781468b1878d7c6589ef4a313c66bf00e4d75b
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Cao Cuong Ngo <cao.cuong.ngo@gmail.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.