From d75a7a13bb67dd6d3c0d014a0d82cef26fd09bce Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Fri, 20 Nov 2009 18:17:23 +0000 Subject: CWS-TOOLING: integrate CWS impress183 2009-11-17 16:13:56 +0100 cl r277539 : #i105710# restored bin stream operators for bullet item, still used by outliner clipboard 2009-11-17 13:26:28 +0100 af r277533 : #i106710# Fixed region band copy constructor so that it copies the points correctly. --- svx/inc/svx/numitem.hxx | 30 +-- svx/source/items/numitem.cxx | 504 ++++++++++++++++++++++--------------------- 2 files changed, 270 insertions(+), 264 deletions(-) diff --git a/svx/inc/svx/numitem.hxx b/svx/inc/svx/numitem.hxx index d3d8b57aa2..c7138df5f2 100644 --- a/svx/inc/svx/numitem.hxx +++ b/svx/inc/svx/numitem.hxx @@ -76,12 +76,6 @@ namespace com{namespace sun{ namespace star{ #define SVX_NO_NUM 200 // Markierung fuer keine Numerierung #define SVX_NO_NUMLEVEL 0x20 -// --> OD 2008-01-10 #newlistlevelattrs# - no longer used -//#define NUMITEM_VERSION_01 0x01 -//#define NUMITEM_VERSION_02 0x02 -//#define NUMITEM_VERSION_03 0x03 -// <-- - #define LINK_TOKEN 0x80 //indicate linked bitmaps - for use in dialog only class SVX_DLLPUBLIC SvxNumberType { @@ -191,14 +185,10 @@ public: SvxNumPositionAndSpaceMode ePositionAndSpaceMode = LABEL_WIDTH_AND_POSITION ); // <-- SvxNumberFormat(const SvxNumberFormat& rFormat); - // --> OD 2008-01-09 #newlistlevelattrs# - no longer used -// SvxNumberFormat(SvStream &rStream); - // <-- + SvxNumberFormat(SvStream &rStream); virtual ~SvxNumberFormat(); - // --> OD 2008-01-09 #newlistlevelattrs# - no longer used -// SvStream& Store(SvStream &rStream, FontToSubsFontConverter pConverter); - // <-- + SvStream& Store(SvStream &rStream, FontToSubsFontConverter pConverter); SvxNumberFormat& operator=( const SvxNumberFormat& ); BOOL operator==( const SvxNumberFormat& ) const; @@ -304,9 +294,7 @@ public: = SvxNumberFormat::LABEL_WIDTH_AND_POSITION ); // <-- SvxNumRule(const SvxNumRule& rCopy); - // --> OD 2008-01-09 #newlistlevelattrs# - no longer used -// SvxNumRule(SvStream &rStream); - // <-- + SvxNumRule(SvStream &rStream); virtual ~SvxNumRule(); int operator==( const SvxNumRule& ) const; @@ -314,9 +302,7 @@ public: SvxNumRule& operator=( const SvxNumRule& ); - // --> OD 2008-01-09 #newlistlevelattrs# - no longer used -// SvStream& Store(SvStream &rStream); - // <-- + SvStream& Store(SvStream &rStream); const SvxNumberFormat* Get(USHORT nLevel)const; const SvxNumberFormat& GetLevel(USHORT nLevel)const; @@ -354,11 +340,9 @@ public: virtual ~SvxNumBulletItem(); virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - // --> OD 2008-01-09 #newlistlevelattrs# - no longer used -// virtual SfxPoolItem* Create(SvStream &, USHORT) const; -// virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; -// virtual USHORT GetVersion( USHORT nFileVersion ) const; - // <-- + virtual SfxPoolItem* Create(SvStream &, USHORT) const; + USHORT GetVersion( USHORT nFileVersion ) const; + virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; virtual int operator==( const SfxPoolItem& ) const; SvxNumRule* GetNumRule() const {return pNumRule;} diff --git a/svx/source/items/numitem.cxx b/svx/source/items/numitem.cxx index 32a493b5bd..a77a49c5ed 100644 --- a/svx/source/items/numitem.cxx +++ b/svx/source/items/numitem.cxx @@ -62,6 +62,11 @@ #define DEF_WRITER_LSPACE 500 //Standardeinrueckung #define DEF_DRAW_LSPACE 800 //Standardeinrueckung +#define NUMITEM_VERSION_01 0x01 +#define NUMITEM_VERSION_02 0x02 +#define NUMITEM_VERSION_03 0x03 +#define NUMITEM_VERSION_04 0x04 + using namespace ::com::sun::star; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; @@ -224,157 +229,184 @@ SvxNumberFormat::~SvxNumberFormat() /* -----------------08.12.98 11:14------------------- * * --------------------------------------------------*/ -//SvxNumberFormat::SvxNumberFormat(SvStream &rStream) -//{ -// USHORT nVersion; -// rStream >> nVersion; - -// USHORT nUSHORT; -// rStream >> nUSHORT; -// SetNumberingType((sal_Int16)nUSHORT); -// rStream >> nUSHORT; -// eNumAdjust = (SvxAdjust)nUSHORT; -// rStream >> nUSHORT; -// nInclUpperLevels = (BYTE)nUSHORT; -// rStream >> nUSHORT; -// nStart = nUSHORT; -// rStream >> nUSHORT; -// cBullet = nUSHORT; - -// short nShort; -// rStream >> nShort; -// nFirstLineOffset = nShort; -// rStream >> nShort; -// nAbsLSpace = nShort; -// rStream >> nShort; -// nLSpace = nShort; - -// rStream >> nShort; -// nCharTextDistance = nShort; -// rtl_TextEncoding eEnc = gsl_getSystemTextEncoding(); -// rStream.ReadByteString(sPrefix, eEnc); -// rStream.ReadByteString(sSuffix, eEnc); -// rStream.ReadByteString(sCharStyleName, eEnc); -// rStream >> nUSHORT; -// if(nUSHORT) -// { -// SvxBrushItem aHelper(0); -// pGraphicBrush = (SvxBrushItem*) aHelper.Create( rStream, BRUSH_GRAPHIC_VERSION ); -// } -// else -// pGraphicBrush = 0; - -// rStream >> nUSHORT; -// eVertOrient = (sal_Int16)nUSHORT; - -// rStream >> nUSHORT; -// if(nUSHORT) -// { -// pBulletFont = new Font; -// rStream >> *pBulletFont; -// if(!pBulletFont->GetCharSet()) -// pBulletFont->SetCharSet(rStream.GetStreamCharSet()); -// } -// else -// pBulletFont = 0; -// rStream >> aGraphicSize; - -// rStream >> nBulletColor; -// rStream >> nUSHORT; -// nBulletRelSize = nUSHORT; -// rStream >> nUSHORT; -// SetShowSymbol((BOOL)nUSHORT); - -// if( nVersion < NUMITEM_VERSION_03 ) -// cBullet = ByteString::ConvertToUnicode( (sal_Char)cBullet, -// (pBulletFont&&pBulletFont->GetCharSet()) ? pBulletFont->GetCharSet() -// : RTL_TEXTENCODING_SYMBOL ); -// if(pBulletFont) -// { -// BOOL bConvertBulletFont = rStream.GetVersion() <= SOFFICE_FILEFORMAT_50; -// if(bConvertBulletFont) -// { - -// FontToSubsFontConverter pConverter = -// CreateFontToSubsFontConverter(pBulletFont->GetName(), -// FONTTOSUBSFONT_IMPORT|FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS); -// if(pConverter) -// { -// cBullet = ConvertFontToSubsFontChar(pConverter, cBullet); -// String sFontName = GetFontToSubsFontName(pConverter); -// pBulletFont->SetName(sFontName); -// DestroyFontToSubsFontConverter(pConverter); -// } -// } -// } -//} +SvxNumberFormat::SvxNumberFormat(SvStream &rStream) +: mePositionAndSpaceMode( LABEL_WIDTH_AND_POSITION ), + meLabelFollowedBy( LISTTAB ), + mnListtabPos( 0 ), + mnFirstLineIndent( 0 ), + mnIndentAt( 0 ) +{ + + USHORT nVersion; + rStream >> nVersion; + + USHORT nUSHORT; + rStream >> nUSHORT; + SetNumberingType((sal_Int16)nUSHORT); + rStream >> nUSHORT; + eNumAdjust = (SvxAdjust)nUSHORT; + rStream >> nUSHORT; + nInclUpperLevels = (BYTE)nUSHORT; + rStream >> nUSHORT; + nStart = nUSHORT; + rStream >> nUSHORT; + cBullet = nUSHORT; + + short nShort; + rStream >> nShort; + nFirstLineOffset = nShort; + rStream >> nShort; + nAbsLSpace = nShort; + rStream >> nShort; + nLSpace = nShort; + + rStream >> nShort; + nCharTextDistance = nShort; + rtl_TextEncoding eEnc = gsl_getSystemTextEncoding(); + rStream.ReadByteString(sPrefix, eEnc); + rStream.ReadByteString(sSuffix, eEnc); + rStream.ReadByteString(sCharStyleName, eEnc); + rStream >> nUSHORT; + if(nUSHORT) + { + SvxBrushItem aHelper(0); + pGraphicBrush = (SvxBrushItem*) aHelper.Create( rStream, BRUSH_GRAPHIC_VERSION ); + } + else + pGraphicBrush = 0; + + rStream >> nUSHORT; + eVertOrient = (sal_Int16)nUSHORT; + + rStream >> nUSHORT; + if(nUSHORT) + { + pBulletFont = new Font; + rStream >> *pBulletFont; + if(!pBulletFont->GetCharSet()) + pBulletFont->SetCharSet(rStream.GetStreamCharSet()); + } + else + pBulletFont = 0; + rStream >> aGraphicSize; + + rStream >> nBulletColor; + rStream >> nUSHORT; + nBulletRelSize = nUSHORT; + rStream >> nUSHORT; + SetShowSymbol((BOOL)nUSHORT); + + if( nVersion < NUMITEM_VERSION_03 ) + cBullet = ByteString::ConvertToUnicode( (sal_Char)cBullet, + (pBulletFont&&pBulletFont->GetCharSet()) ? pBulletFont->GetCharSet() + : RTL_TEXTENCODING_SYMBOL ); + if(pBulletFont) + { + BOOL bConvertBulletFont = rStream.GetVersion() <= SOFFICE_FILEFORMAT_50; + if(bConvertBulletFont) + { + + FontToSubsFontConverter pConverter = + CreateFontToSubsFontConverter(pBulletFont->GetName(), + FONTTOSUBSFONT_IMPORT|FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS); + if(pConverter) + { + cBullet = ConvertFontToSubsFontChar(pConverter, cBullet); + String sFontName = GetFontToSubsFontName(pConverter); + pBulletFont->SetName(sFontName); + DestroyFontToSubsFontConverter(pConverter); + } + } + } + + if( NUMITEM_VERSION_04 <= nVersion ) + { + rStream >> nUSHORT; + mePositionAndSpaceMode = (SvxNumPositionAndSpaceMode) nUSHORT; + rStream >> nUSHORT; + meLabelFollowedBy = ( SvxNumLabelFollowedBy ) nUSHORT; + long nLong; + rStream >> nLong; + mnListtabPos = nLong; + rStream >> nLong; + mnFirstLineIndent = nLong; + rStream >> nLong; + mnIndentAt = nLong; + } +} /* -----------------08.12.98 11:14------------------- * * --------------------------------------------------*/ -// --> OD 2008-01-09 #newlistlevelattrs# - no longer used -//SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pConverter) -//{ -// if(pConverter && pBulletFont) -// { -// cBullet = ConvertFontToSubsFontChar(pConverter, cBullet); -// String sFontName = GetFontToSubsFontName(pConverter); -// pBulletFont->SetName(sFontName); -// } - -// rStream << (USHORT)NUMITEM_VERSION_03; - -// rStream << (USHORT)GetNumberingType(); -// rStream << (USHORT)eNumAdjust; -// rStream << (USHORT)nInclUpperLevels; -// rStream << nStart; -// rStream << (USHORT)cBullet; - -// rStream << nFirstLineOffset; -// rStream << nAbsLSpace; -// rStream << nLSpace; - -// rStream << nCharTextDistance; -// rtl_TextEncoding eEnc = gsl_getSystemTextEncoding(); -// rStream.WriteByteString(sPrefix, eEnc); -// rStream.WriteByteString(sSuffix, eEnc); -// rStream.WriteByteString(sCharStyleName, eEnc); -// if(pGraphicBrush) -// { -// rStream << (USHORT)1; - -// // #75113# in SD or SI force bullet itself to be stored, -// // for that purpose throw away link when link and graphic -// // are present, so Brush save is forced -// if(pGraphicBrush->GetGraphicLink() && pGraphicBrush->GetGraphic()) -// { -// String aEmpty; -// pGraphicBrush->SetGraphicLink(aEmpty); -// } - -// pGraphicBrush->Store(rStream, BRUSH_GRAPHIC_VERSION); -// } -// else -// rStream << (USHORT)0; - -// rStream << (USHORT)eVertOrient; -// if(pBulletFont) -// { -// rStream << (USHORT)1; -// rStream << *pBulletFont; -// } -// else -// rStream << (USHORT)0; -// rStream << aGraphicSize; - -// Color nTempColor = nBulletColor; -// if(COL_AUTO == nBulletColor.GetColor()) -// nTempColor = COL_BLACK; -// rStream << nTempColor; -// rStream << nBulletRelSize; -// rStream << (USHORT)IsShowSymbol(); -// return rStream; -//} -// <-- +SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pConverter) +{ + if(pConverter && pBulletFont) + { + cBullet = ConvertFontToSubsFontChar(pConverter, cBullet); + String sFontName = GetFontToSubsFontName(pConverter); + pBulletFont->SetName(sFontName); + } + + rStream << (USHORT)NUMITEM_VERSION_04; + + rStream << (USHORT)GetNumberingType(); + rStream << (USHORT)eNumAdjust; + rStream << (USHORT)nInclUpperLevels; + rStream << nStart; + rStream << (USHORT)cBullet; + + rStream << nFirstLineOffset; + rStream << nAbsLSpace; + rStream << nLSpace; + + rStream << nCharTextDistance; + rtl_TextEncoding eEnc = gsl_getSystemTextEncoding(); + rStream.WriteByteString(sPrefix, eEnc); + rStream.WriteByteString(sSuffix, eEnc); + rStream.WriteByteString(sCharStyleName, eEnc); + if(pGraphicBrush) + { + rStream << (USHORT)1; + + // #75113# in SD or SI force bullet itself to be stored, + // for that purpose throw away link when link and graphic + // are present, so Brush save is forced + if(pGraphicBrush->GetGraphicLink() && pGraphicBrush->GetGraphic()) + { + String aEmpty; + pGraphicBrush->SetGraphicLink(aEmpty); + } + + pGraphicBrush->Store(rStream, BRUSH_GRAPHIC_VERSION); + } + else + rStream << (USHORT)0; + + rStream << (USHORT)eVertOrient; + if(pBulletFont) + { + rStream << (USHORT)1; + rStream << *pBulletFont; + } + else + rStream << (USHORT)0; + rStream << aGraphicSize; + + Color nTempColor = nBulletColor; + if(COL_AUTO == nBulletColor.GetColor()) + nTempColor = COL_BLACK; + rStream << nTempColor; + rStream << nBulletRelSize; + rStream << (USHORT)IsShowSymbol(); + + rStream << ( USHORT ) mePositionAndSpaceMode; + rStream << ( USHORT ) meLabelFollowedBy; + rStream << ( long ) mnListtabPos; + rStream << ( long ) mnFirstLineIndent; + rStream << ( long ) mnIndentAt; + + return rStream; +} + /* -----------------------------23.02.01 11:10-------------------------------- ---------------------------------------------------------------------------*/ @@ -839,80 +871,79 @@ SvxNumRule::SvxNumRule(const SvxNumRule& rCopy) /* -----------------08.12.98 11:07------------------- * * --------------------------------------------------*/ -//SvxNumRule::SvxNumRule(SvStream &rStream) -//{ -// ++nRefCount; -// LanguageType eLang = Application::GetSettings().GetLanguage(); -// aLocale = SvxCreateLocale(eLang); -// USHORT nVersion; -// USHORT nTemp; -// rStream >> nVersion; -// rStream >> nLevelCount; -// rStream >> nTemp; -// nFeatureFlags = nTemp; -// rStream >> nTemp; -// bContinuousNumbering = (BOOL)nTemp; -// rStream >> nTemp; -// eNumberingType = (SvxNumRuleType)nTemp; -// memset( aFmts, 0, sizeof( aFmts )); - -// for(USHORT i = 0; i < SVX_MAX_NUM; i++) -// { -// USHORT nSet; -// rStream >> nSet; -// if(nSet) -// aFmts[i] = new SvxNumberFormat(rStream); -// else -// aFmts[i] = 0; -// aFmtsSet[i] = aFmts[i] ? TRUE : FALSE; -// } -// if(NUMITEM_VERSION_02 <= nVersion) -// { -// USHORT nShort; -// rStream >> nShort; -// nFeatureFlags = nShort; -// } -//} +SvxNumRule::SvxNumRule(SvStream &rStream) +{ + ++nRefCount; + LanguageType eLang = Application::GetSettings().GetLanguage(); + aLocale = SvxCreateLocale(eLang); + USHORT nVersion; + USHORT nTemp; + rStream >> nVersion; + rStream >> nLevelCount; + rStream >> nTemp; + nFeatureFlags = nTemp; + rStream >> nTemp; + bContinuousNumbering = (BOOL)nTemp; + rStream >> nTemp; + eNumberingType = (SvxNumRuleType)nTemp; + memset( aFmts, 0, sizeof( aFmts )); + + for(USHORT i = 0; i < SVX_MAX_NUM; i++) + { + USHORT nSet; + rStream >> nSet; + if(nSet) + aFmts[i] = new SvxNumberFormat(rStream); + else + aFmts[i] = 0; + aFmtsSet[i] = aFmts[i] ? TRUE : FALSE; + } + if(NUMITEM_VERSION_02 <= nVersion) + { + USHORT nShort; + rStream >> nShort; + nFeatureFlags = nShort; + } +} /* -----------------08.12.98 11:07------------------- * * --------------------------------------------------*/ -// --> OD 2008-01-09 #newlistlevelattrs# - no longer used -//SvStream& SvxNumRule::Store(SvStream &rStream) -//{ -// rStream<<(USHORT)NUMITEM_VERSION_03; -// rStream<GetBulletFont()) -// { -// if(!pConverter) -// pConverter = -// CreateFontToSubsFontConverter(aFmts[i]->GetBulletFont()->GetName(), -// FONTTOSUBSFONT_EXPORT|FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS); -// } -// aFmts[i]->Store(rStream, pConverter); -// } -// else -// rStream << USHORT(0); -// } -// //second save of nFeatureFlags for new versions -// rStream<<(USHORT)nFeatureFlags; -// if(pConverter) -// DestroyFontToSubsFontConverter(pConverter); - -// return rStream; -//} +SvStream& SvxNumRule::Store(SvStream &rStream) +{ + rStream<<(USHORT)NUMITEM_VERSION_03; + rStream<GetBulletFont()) + { + if(!pConverter) + pConverter = + CreateFontToSubsFontConverter(aFmts[i]->GetBulletFont()->GetName(), + FONTTOSUBSFONT_EXPORT|FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS); + } + aFmts[i]->Store(rStream, pConverter); + } + else + rStream << USHORT(0); + } + //second save of nFeatureFlags for new versions + rStream<<(USHORT)nFeatureFlags; + if(pConverter) + DestroyFontToSubsFontConverter(pConverter); + + return rStream; +} /* -----------------27.10.98 10:41------------------- * @@ -1179,32 +1210,23 @@ SfxPoolItem* SvxNumBulletItem::Clone( SfxItemPool * ) const /* -----------------08.12.98 10:43------------------- * * --------------------------------------------------*/ -// --> OD 2008-01-09 #newlistlevelattrs# - no longer used -//SfxPoolItem* SvxNumBulletItem::Create(SvStream &rStream, USHORT) const -//{ -// SvxNumRule aRule(rStream); -// return new SvxNumBulletItem(aRule, Which() ); -//} -// <-- -/* -----------------08.12.98 10:43------------------- - * - * --------------------------------------------------*/ -// --> OD 2008-01-09 #newlistlevelattrs# - no longer used -//SvStream& SvxNumBulletItem::Store(SvStream &rStream, USHORT /*nItemVersion*/ )const -//{ -// pNumRule->Store(rStream); -// return rStream; -//} -// <-- +SfxPoolItem* SvxNumBulletItem::Create(SvStream &rStream, USHORT) const +{ + SvxNumRule aRule(rStream); + return new SvxNumBulletItem(aRule, Which() ); +} +USHORT SvxNumBulletItem::GetVersion( USHORT /*nFileVersion*/ ) const +{ + return NUMITEM_VERSION_03; +} /* -----------------08.12.98 10:43------------------- * * --------------------------------------------------*/ -// --> OD 2008-01-10 #newlistlevelattrs# - no longer used -//USHORT SvxNumBulletItem::GetVersion( USHORT /*nFileVersion*/ ) const -//{ -// return NUMITEM_VERSION_03; -//} -// <-- +SvStream& SvxNumBulletItem::Store(SvStream &rStream, USHORT /*nItemVersion*/ )const +{ + pNumRule->Store(rStream); + return rStream; +} /* -----------------08.12.98 10:43------------------- * -- cgit v1.2.3