diff options
author | sb <sb@openoffice.org> | 2010-11-19 11:35:41 +0100 |
---|---|---|
committer | sb <sb@openoffice.org> | 2010-11-19 11:35:41 +0100 |
commit | 1e3884c191eba90ebce96b516c65393a5afe29df (patch) | |
tree | a7238ce383ed9aa425dee4908b65c284e2cfaad2 /sw/source | |
parent | 525c94b15bbf251aa28734fdd1c98da97b125a19 (diff) | |
parent | c75630a0387433905286e2517156c86218b5a25b (diff) |
sb131: merged in re/DEV300_next towards DEV300_m94
Diffstat (limited to 'sw/source')
299 files changed, 10259 insertions, 10499 deletions
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 728b4c63d3..1d71600a24 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -38,6 +38,7 @@ // #include <cmath> #include <cfloat> #include <hintids.hxx> +#include <osl/diagnose.hxx> #include <rtl/math.hxx> #include <editeng/langitem.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -270,7 +271,7 @@ SwCalc::SwCalc( SwDoc& rD ) : aErrExpr( aEmptyStr, SwSbxValue(), 0 ), rDoc( rD ), - pLclData( &SvtSysLocale().GetLocaleData() ), + pLclData( m_aSysLocale.GetLocaleDataPtr() ), pCharClass( &GetAppCharClass() ), nListPor( 0 ), eError( CALC_NOERR ) @@ -419,7 +420,7 @@ SwCalc::~SwCalc() { for( USHORT n = 0; n < TBLSZ; ++n ) delete VarTable[n]; - if( pLclData != &SvtSysLocale().GetLocaleData() ) + if( pLclData != m_aSysLocale.GetLocaleDataPtr() ) delete pLclData; if( pCharClass != &GetAppCharClass() ) delete pCharClass; @@ -1608,63 +1609,64 @@ String SwCalc::GetDBName(const String& rName) //------------------------------------------------------------------------------ -/****************************************************************************** - * Methode : BOOL SwCalc::Str2Double( double& ) - * Beschreibung: - * Erstellt : OK 07.06.94 12:56 - * Aenderung : JP 27.10.98 - ******************************************************************************/ -BOOL SwCalc::Str2Double( const String& rCommand, xub_StrLen& rCommandPos, - double& rVal, const LocaleDataWrapper* pLclData ) +namespace { - const LocaleDataWrapper* pLclD = pLclData; - if( !pLclD ) - pLclD = &SvtSysLocale().GetLocaleData(); +static bool +lcl_Str2Double( const String& rCommand, xub_StrLen& rCommandPos, double& rVal, + const LocaleDataWrapper* const pLclData ) +{ + OSL_ASSERT(pLclData); const xub_Unicode nCurrCmdPos = rCommandPos; rtl_math_ConversionStatus eStatus; const sal_Unicode* pEnd; rVal = rtl_math_uStringToDouble( rCommand.GetBuffer() + rCommandPos, rCommand.GetBuffer() + rCommand.Len(), - pLclD->getNumDecimalSep().GetChar(0), - pLclD->getNumThousandSep().GetChar(0), + pLclData->getNumDecimalSep().GetChar(0), + pLclData->getNumThousandSep().GetChar(0), &eStatus, &pEnd ); rCommandPos = static_cast<xub_StrLen>(pEnd - rCommand.GetBuffer()); - if( !pLclData && pLclD != &SvtSysLocale().GetLocaleData() ) - delete (LocaleDataWrapper*)pLclD; - return rtl_math_ConversionStatus_Ok == eStatus && nCurrCmdPos != rCommandPos; } -BOOL SwCalc::Str2Double( const String& rCommand, xub_StrLen& rCommandPos, - double& rVal, SwDoc* pDoc ) +} + +/****************************************************************************** + * Methode : BOOL SwCalc::Str2Double( double& ) + * Beschreibung: + * Erstellt : OK 07.06.94 12:56 + * Aenderung : JP 27.10.98 + ******************************************************************************/ +bool SwCalc::Str2Double( const String& rCommand, xub_StrLen& rCommandPos, + double& rVal, const LocaleDataWrapper* const pLclData ) +{ + const SvtSysLocale aSysLocale; + return lcl_Str2Double( rCommand, rCommandPos, rVal, + pLclData ? pLclData : aSysLocale.GetLocaleDataPtr() ); +} + +bool SwCalc::Str2Double( const String& rCommand, xub_StrLen& rCommandPos, + double& rVal, SwDoc* const pDoc ) { - const LocaleDataWrapper* pLclD = &SvtSysLocale().GetLocaleData(); + const SvtSysLocale aSysLocale; + ::std::auto_ptr<const LocaleDataWrapper> pLclD; if( pDoc ) { - LanguageType eLang = GetDocAppScriptLang( *pDoc ); - if( eLang != SvxLocaleToLanguage( pLclD->getLocale() ) ) - pLclD = new LocaleDataWrapper( + if (eLang != + SvxLocaleToLanguage(aSysLocale.GetLocaleData().getLocale())) + { + pLclD.reset( new LocaleDataWrapper( ::comphelper::getProcessServiceFactory(), - SvxCreateLocale( eLang ) ); + SvxCreateLocale( eLang ) ) ); + } } - const xub_Unicode nCurrCmdPos = rCommandPos; - rtl_math_ConversionStatus eStatus; - const sal_Unicode* pEnd; - rVal = rtl_math_uStringToDouble( rCommand.GetBuffer() + rCommandPos, - rCommand.GetBuffer() + rCommand.Len(), - pLclD->getNumDecimalSep().GetChar(0), - pLclD->getNumThousandSep().GetChar(0), - &eStatus, &pEnd ); - rCommandPos = static_cast<xub_StrLen>(pEnd - rCommand.GetBuffer()); - - if( pLclD != &SvtSysLocale().GetLocaleData() ) - delete (LocaleDataWrapper*)pLclD; + bool const bRet = lcl_Str2Double( rCommand, rCommandPos, rVal, + (pLclD.get()) ? pLclD.get() : aSysLocale.GetLocaleDataPtr() ); - return rtl_math_ConversionStatus_Ok == eStatus && nCurrCmdPos != rCommandPos; + return bRet; } //------------------------------------------------------------------------------ diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx index 9e37e408e3..e048f47d85 100644 --- a/sw/source/core/crsr/callnk.cxx +++ b/sw/source/core/crsr/callnk.cxx @@ -196,6 +196,10 @@ SwCallLink::~SwCallLink() { const SwNodeIndex* pIndex = pFlyFrm->GetFmt()->GetCntnt().GetCntntIdx(); ASSERT( pIndex, "Fly ohne Cntnt" ); + + if (!pIndex) + return; + const SwNode& rStNd = pIndex->GetNode(); if( rStNd.EndOfSectionNode()->StartOfSectionIndex() > nNode || diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index fce9273ef3..f09ce0eb26 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -484,10 +484,10 @@ BOOL SwCrsrShell::GotoNxtPrvTblFormula( BOOL bNext, BOOL bOnlyErrors ) { const SfxPoolItem* pItem; const SwTableBox* pTBox; - USHORT n, nMaxItems = GetDoc()->GetAttrPool().GetItemCount( RES_BOXATR_FORMULA ); + sal_uInt32 n, nMaxItems = GetDoc()->GetAttrPool().GetItemCount2( RES_BOXATR_FORMULA ); for( n = 0; n < nMaxItems; ++n ) - if( 0 != (pItem = GetDoc()->GetAttrPool().GetItem( + if( 0 != (pItem = GetDoc()->GetAttrPool().GetItem2( RES_BOXATR_FORMULA, n ) ) && 0 != (pTBox = ((SwTblBoxFormula*)pItem)->GetTableBox() ) && pTBox->GetSttNd() && @@ -556,10 +556,10 @@ BOOL SwCrsrShell::GotoNxtPrvTOXMark( BOOL bNext ) const SwCntntFrm* pCFrm; const SwTxtNode* pTxtNd; const SwTxtTOXMark* pTxtTOX; - USHORT n, nMaxItems = GetDoc()->GetAttrPool().GetItemCount( RES_TXTATR_TOXMARK ); + sal_uInt32 n, nMaxItems = GetDoc()->GetAttrPool().GetItemCount2( RES_TXTATR_TOXMARK ); for( n = 0; n < nMaxItems; ++n ) - if( 0 != (pItem = GetDoc()->GetAttrPool().GetItem( + if( 0 != (pItem = GetDoc()->GetAttrPool().GetItem2( RES_TXTATR_TOXMARK, n ) ) && 0 != (pTxtTOX = ((SwTOXMark*)pItem)->GetTxtTOXMark() ) && ( pTxtNd = &pTxtTOX->GetTxtNode())->GetNodes().IsDocNodes() && @@ -717,8 +717,7 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext, SwFmtFld* pFmtFld = new SwFmtFld( SwDateTimeField( (SwDateTimeFieldType*)pDoc->GetSysFldType( RES_DATETIMEFLD ) ) ); - pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex(), - pDoc->IsClipBoard() ); + pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex() ); pTxtFld->ChgTxtNode( pTNd ); } diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 814fd21bbf..6c3404e4de 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -143,8 +143,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart, // hinterher alle am Stringende (koenten ja 'normale' 0x7f drinstehen BOOL bEmpty = RES_TXTATR_FIELD != pHt->Which() || !(static_cast<SwTxtFld const*>(pHt) - ->GetFld().GetFld()->ExpandField( - rNd.GetDoc()->IsClipBoard()).Len()); + ->GetFld().GetFld()->ExpandField(true).Len()); if ( bEmpty && nStart == nAkt ) { rArr.Insert( nAkt, rArr.Count() ); diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 291b845e5b..eb2f4b417f 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -100,7 +100,6 @@ #include <fldupde.hxx> #include <swbaslnk.hxx> #include <printdata.hxx> -#include <swprtopt.hxx> #include <cmdid.h> // fuer den dflt - Printer in SetJob #include <statstr.hrc> // StatLine-String #include <comcore.hrc> @@ -207,6 +206,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const case PURGE_OLE: return mbPurgeOLE; case KERN_ASIAN_PUNCTUATION: return mbKernAsianPunctuation; case DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT: return mbDoNotResetParaAttrsForNumFont; + case MATH_BASELINE_ALIGNMENT: return mbMathBaselineAlignment; default: ASSERT(false, "Invalid setting id"); } @@ -305,7 +305,7 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value) case UNIX_FORCE_ZERO_EXT_LEADING: mbUnixForceZeroExtLeading = value; break; - case PROTECT_FORM: + case PROTECT_FORM: mbProtectForm = value; break; @@ -346,6 +346,9 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value) case DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT: mbDoNotResetParaAttrsForNumFont = value; break; + case MATH_BASELINE_ALIGNMENT: + mbMathBaselineAlignment = value; + break; default: ASSERT(false, "Invalid setting id"); } @@ -631,6 +634,8 @@ void SwDoc::setJobsetup(/*[in]*/ const JobSetup &rJobSetup ) SwPrintData* SwDoc::getPrintData() const { + if(!pPrtData) + ((SwDoc*)this)->pPrtData = new SwPrintData; return pPrtData; } @@ -1843,10 +1848,10 @@ void SwDoc::DocInfoChgd( ) const SwFmtRefMark* SwDoc::GetRefMark( const String& rName ) const { const SfxPoolItem* pItem; - USHORT nMaxItems = GetAttrPool().GetItemCount( RES_TXTATR_REFMARK ); - for( USHORT n = 0; n < nMaxItems; ++n ) + sal_uInt32 nMaxItems = GetAttrPool().GetItemCount2( RES_TXTATR_REFMARK ); + for( sal_uInt32 n = 0; n < nMaxItems; ++n ) { - if( 0 == (pItem = GetAttrPool().GetItem( RES_TXTATR_REFMARK, n ) )) + if( 0 == (pItem = GetAttrPool().GetItem2( RES_TXTATR_REFMARK, n ) )) continue; const SwFmtRefMark* pFmtRef = (SwFmtRefMark*)pItem; @@ -1865,10 +1870,10 @@ const SwFmtRefMark* SwDoc::GetRefMark( USHORT nIndex ) const const SwTxtRefMark* pTxtRef; const SwFmtRefMark* pRet = 0; - USHORT nMaxItems = GetAttrPool().GetItemCount( RES_TXTATR_REFMARK ); - USHORT nCount = 0; - for( USHORT n = 0; n < nMaxItems; ++n ) - if( 0 != (pItem = GetAttrPool().GetItem( RES_TXTATR_REFMARK, n )) && + sal_uInt32 nMaxItems = GetAttrPool().GetItemCount2( RES_TXTATR_REFMARK ); + sal_uInt32 nCount = 0; + for( sal_uInt32 n = 0; n < nMaxItems; ++n ) + if( 0 != (pItem = GetAttrPool().GetItem2( RES_TXTATR_REFMARK, n )) && 0 != (pTxtRef = ((SwFmtRefMark*)pItem)->GetTxtRefMark()) && &pTxtRef->GetTxtNode().GetNodes() == &GetNodes() ) { @@ -1891,10 +1896,10 @@ USHORT SwDoc::GetRefMarks( SvStringsDtor* pNames ) const const SfxPoolItem* pItem; const SwTxtRefMark* pTxtRef; - USHORT nMaxItems = GetAttrPool().GetItemCount( RES_TXTATR_REFMARK ); - USHORT nCount = 0; - for( USHORT n = 0; n < nMaxItems; ++n ) - if( 0 != (pItem = GetAttrPool().GetItem( RES_TXTATR_REFMARK, n )) && + sal_uInt32 nMaxItems = GetAttrPool().GetItemCount2( RES_TXTATR_REFMARK ); + sal_uInt32 nCount = 0; + for( sal_uInt32 n = 0; n < nMaxItems; ++n ) + if( 0 != (pItem = GetAttrPool().GetItem2( RES_TXTATR_REFMARK, n )) && 0 != (pTxtRef = ((SwFmtRefMark*)pItem)->GetTxtRefMark()) && &pTxtRef->GetTxtNode().GetNodes() == &GetNodes() ) { @@ -2135,9 +2140,9 @@ const SwFmtINetFmt* SwDoc::FindINetAttr( const String& rName ) const const SwFmtINetFmt* pItem; const SwTxtINetFmt* pTxtAttr; const SwTxtNode* pTxtNd; - USHORT n, nMaxItems = GetAttrPool().GetItemCount( RES_TXTATR_INETFMT ); + sal_uInt32 n, nMaxItems = GetAttrPool().GetItemCount2( RES_TXTATR_INETFMT ); for( n = 0; n < nMaxItems; ++n ) - if( 0 != (pItem = (SwFmtINetFmt*)GetAttrPool().GetItem( + if( 0 != (pItem = (SwFmtINetFmt*)GetAttrPool().GetItem2( RES_TXTATR_INETFMT, n ) ) && pItem->GetName().Equals( rName ) && 0 != ( pTxtAttr = pItem->GetTxtINetFmt()) && @@ -2396,6 +2401,54 @@ BOOL SwDoc::RemoveInvisibleContent() EndUndo( UNDO_UI_DELETE_INVISIBLECNTNT, NULL ); return bRet; } +/*-- 25.08.2010 14:18:12--------------------------------------------------- + + -----------------------------------------------------------------------*/ +BOOL SwDoc::HasInvisibleContent() const +{ + BOOL bRet = sal_False; + + SwClientIter aIter( *GetSysFldType( RES_HIDDENPARAFLD ) ); + if( aIter.First( TYPE( SwFmtFld ) ) ) + bRet = sal_True; + + // + // Search for any hidden paragraph (hidden text attribute) + // + if( ! bRet ) + { + for( ULONG n = GetNodes().Count(); !bRet && (n > 0); ) + { + SwTxtNode* pTxtNd = GetNodes()[ --n ]->GetTxtNode(); + if ( pTxtNd ) + { + SwPaM aPam( *pTxtNd, 0, *pTxtNd, pTxtNd->GetTxt().Len() ); + if( pTxtNd->HasHiddenCharAttribute( true ) || ( pTxtNd->HasHiddenCharAttribute( false ) ) ) + { + bRet = sal_True; + } + } + } + } + + if( ! bRet ) + { + const SwSectionFmts& rSectFmts = GetSections(); + USHORT n; + + for( n = rSectFmts.Count(); !bRet && (n > 0); ) + { + SwSectionFmt* pSectFmt = rSectFmts[ --n ]; + // don't add sections in Undo/Redo + if( !pSectFmt->IsInNodesArr()) + continue; + SwSection* pSect = pSectFmt->GetSection(); + if( pSect->IsHidden() ) + bRet = sal_True; + } + } + return bRet; +} /*-- 11.06.2004 08:34:04--------------------------------------------------- -----------------------------------------------------------------------*/ @@ -2451,7 +2504,7 @@ BOOL SwDoc::ConvertFieldsToText() nWhich != RES_REFPAGEGETFLD&& nWhich != RES_REFPAGESETFLD)) { - String sText = pField->GetCntnt(); + String sText = pField->ExpandField(true); //database fields should not convert their command into text if( RES_DBFLD == pCurType->Which() && !static_cast<const SwDBField*>(pField)->IsInitialized()) sText.Erase(); @@ -2510,26 +2563,17 @@ bool SwDoc::LinksUpdated() const } // embedded alle lokalen Links (Bereiche/Grafiken) -bool SwDoc::EmbedAllLinks() +::sfx2::SvBaseLink* lcl_FindNextRemovableLink( const ::sfx2::SvBaseLinks& rLinks, sfx2::LinkManager& rLnkMgr ) { - BOOL bRet = FALSE; - sfx2::LinkManager& rLnkMgr = GetLinkManager(); - const ::sfx2::SvBaseLinks& rLnks = rLnkMgr.GetLinks(); - if( rLnks.Count() ) + for( USHORT n = 0; n < rLinks.Count(); ++n ) { - BOOL bDoesUndo = DoesUndo(); - DoUndo( FALSE ); - - for( USHORT n = 0; n < rLnks.Count(); ++n ) + ::sfx2::SvBaseLink* pLnk = &(*rLinks[ n ]); + if( pLnk && + ( OBJECT_CLIENT_GRF == pLnk->GetObjType() || + OBJECT_CLIENT_FILE == pLnk->GetObjType() ) && + pLnk->ISA( SwBaseLink ) ) { - ::sfx2::SvBaseLink* pLnk = &(*rLnks[ n ]); - if( pLnk && - ( OBJECT_CLIENT_GRF == pLnk->GetObjType() || - OBJECT_CLIENT_FILE == pLnk->GetObjType() ) && - pLnk->ISA( SwBaseLink ) ) - { ::sfx2::SvBaseLinkRef xLink = pLnk; - USHORT nCount = rLnks.Count(); String sFName; rLnkMgr.GetDisplayNames( xLink, 0, &sFName, 0, 0 ); @@ -2537,20 +2581,33 @@ bool SwDoc::EmbedAllLinks() INetURLObject aURL( sFName ); if( INET_PROT_FILE == aURL.GetProtocol() || INET_PROT_CID == aURL.GetProtocol() ) - { - // dem Link sagen, das er aufgeloest wird! - xLink->Closed(); + return pLnk; + } + } + return 0; +} +bool SwDoc::EmbedAllLinks() +{ + BOOL bRet = FALSE; + sfx2::LinkManager& rLnkMgr = GetLinkManager(); + const ::sfx2::SvBaseLinks& rLinks = rLnkMgr.GetLinks(); + if( rLinks.Count() ) + { + BOOL bDoesUndo = DoesUndo(); + DoUndo( FALSE ); - // falls einer vergessen hat sich auszutragen - if( xLink.Is() ) - rLnkMgr.Remove( xLink ); + ::sfx2::SvBaseLink* pLnk = 0; + while( 0 != (pLnk = lcl_FindNextRemovableLink( rLinks, rLnkMgr ) ) ) + { + ::sfx2::SvBaseLinkRef xLink = pLnk; + // dem Link sagen, das er aufgeloest wird! + xLink->Closed(); - if( nCount != rLnks.Count() + 1 ) - n = 0; // wieder von vorne anfangen, es wurden - // mehrere Links entfernt - bRet = TRUE; - } - } + // falls einer vergessen hat sich auszutragen + if( xLink.Is() ) + rLnkMgr.Remove( xLink ); + + bRet = TRUE; } DelAllUndoObj(); diff --git a/sw/source/core/doc/docbasic.cxx b/sw/source/core/doc/docbasic.cxx index fc88148156..2cba12edf5 100644 --- a/sw/source/core/doc/docbasic.cxx +++ b/sw/source/core/doc/docbasic.cxx @@ -167,9 +167,9 @@ USHORT SwDoc::CallEvent( USHORT nEvent, const SwCallMouseEvent& rCallEvent, if( bCheckPtr ) { const SfxPoolItem* pItem; - USHORT n, nMaxItems = GetAttrPool().GetItemCount( RES_TXTATR_INETFMT ); + sal_uInt32 n, nMaxItems = GetAttrPool().GetItemCount2( RES_TXTATR_INETFMT ); for( n = 0; n < nMaxItems; ++n ) - if( 0 != (pItem = GetAttrPool().GetItem( RES_TXTATR_INETFMT, n ) ) + if( 0 != (pItem = GetAttrPool().GetItem2( RES_TXTATR_INETFMT, n ) ) && rCallEvent.PTR.pINetAttr == pItem ) { bCheckPtr = FALSE; // als Flag missbrauchen diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 23ecd3feb5..4c3c50b014 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -305,7 +305,7 @@ namespace sw { namespace mark MarkManager::MarkManager(SwDoc& rDoc) : m_pDoc(&rDoc) { } - +#if OSL_DEBUG_LEVEL > 1 void MarkManager::dumpFieldmarks( ) const { const_iterator_t pIt = m_vFieldmarks.begin(); @@ -316,7 +316,7 @@ namespace sw { namespace mark ::rtl::OUStringToOString(str, RTL_TEXTENCODING_UTF8).getStr()); } } - +#endif ::sw::mark::IMark* MarkManager::makeMark(const SwPaM& rPaM, const ::rtl::OUString& rName, const IDocumentMarkAccess::MarkType eType) diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx index b3b5682eba..4b4d89fcda 100644 --- a/sw/source/core/doc/doccorr.cxx +++ b/sw/source/core/doc/doccorr.cxx @@ -73,9 +73,9 @@ namespace { - // find the relevant section in which the SwUnoCrsr may wander. returns NULL if - // no restrictions apply - const SwStartNode* lcl_FindUnoCrsrSection( const SwNode& rNode ) + // find the relevant section in which the SwUnoCrsr may wander. + // returns NULL if no restrictions apply + static const SwStartNode* lcl_FindUnoCrsrSection( const SwNode& rNode ) { const SwStartNode* pStartNode = rNode.StartOfSectionNode(); while( ( pStartNode != NULL ) && @@ -86,45 +86,28 @@ namespace return pStartNode; } - static inline void lcl_PaMCorrAbs1(SwPaM * pPam, - SwNode const * const pOldNode, - const SwPosition& rNewPos, - const xub_StrLen nOffset) - { - for(int nb = 0; nb < 2; ++nb) - if(&((pPam)->GetBound(BOOL(nb)).nNode.GetNode()) == pOldNode) - { - (pPam)->GetBound(BOOL(nb)) = rNewPos; - (pPam)->GetBound(BOOL(nb)).nContent += nOffset; - } - }; - - static inline bool lcl_PaMCorrAbs2(SwPaM* pPam, - const SwPosition& rNewPos, - ULONG nSttNode, - ULONG nEndNode) + static inline bool lcl_PosCorrAbs(SwPosition & rPos, + const SwPosition& rStart, + const SwPosition& rEnd, + const SwPosition& rNewPos) { - bool bRet = false; - - for(int nb = 0; nb < 2; ++nb) - if((pPam)->GetBound(BOOL(nb)).nNode >= nSttNode && - (pPam)->GetBound(BOOL(nb)).nNode <= nEndNode) - { - (pPam)->GetBound(BOOL(nb)) = rNewPos; - bRet = true; - } - return bRet; + if ((rStart <= rPos) && (rPos <= rEnd)) + { + rPos = rNewPos; + return true; + } + return false; }; - static inline void lcl_PaMCorrAbs3(SwPaM * pPam, + static inline bool lcl_PaMCorrAbs(SwPaM & rPam, const SwPosition& rStart, const SwPosition& rEnd, const SwPosition& rNewPos) { - for(int nb = 0; nb < 2; ++nb) - if(rStart <= (pPam)->GetBound(BOOL(nb)) && - (pPam)->GetBound(BOOL(nb)) <= rEnd ) - (pPam)->GetBound(BOOL(nb)) = rNewPos; + bool bRet = false; + bRet |= lcl_PosCorrAbs(rPam.GetBound(true ), rStart, rEnd, rNewPos); + bRet |= lcl_PosCorrAbs(rPam.GetBound(false), rStart, rEnd, rNewPos); + return bRet; }; static inline void lcl_PaMCorrRel1(SwPaM * pPam, @@ -143,119 +126,69 @@ namespace } } -void PaMCorrAbs( const SwNodeIndex &rOldNode, - const SwPosition &rNewPos, - const xub_StrLen nOffset) -{ - const SwNode* pOldNode = &rOldNode.GetNode(); - const SwPosition aNewPos( rNewPos ); - const SwDoc* pDoc = pOldNode->GetDoc(); - SwCrsrShell* pShell = pDoc->GetEditShell(); - - if( pShell ) - { - FOREACHSHELL_START( pShell ) - SwPaM *_pStkCrsr = PCURSH->GetStkCrsr(); - if( _pStkCrsr ) - do { - lcl_PaMCorrAbs1( _pStkCrsr, pOldNode, aNewPos, nOffset ); - } while ( (_pStkCrsr != 0 ) && - ((_pStkCrsr=(SwPaM *)_pStkCrsr->GetNext()) != PCURSH->GetStkCrsr()) ); - - FOREACHPAM_START( PCURSH->_GetCrsr() ) - lcl_PaMCorrAbs1( PCURCRSR, pOldNode, aNewPos, nOffset ); - FOREACHPAM_END() - - if( PCURSH->IsTableMode() ) - lcl_PaMCorrAbs1( PCURSH->GetTblCrs(), pOldNode, aNewPos, nOffset ); - - FOREACHSHELL_END( pShell ) - } - - { - SwUnoCrsrTbl& rTbl = (SwUnoCrsrTbl&)pDoc->GetUnoCrsrTbl(); - for( USHORT n = 0; n < rTbl.Count(); ++n ) - { - FOREACHPAM_START( rTbl[ n ] ) - lcl_PaMCorrAbs1( PCURCRSR, pOldNode, aNewPos, nOffset ); - FOREACHPAM_END() - SwUnoTableCrsr* pUnoTblCrsr = - dynamic_cast<SwUnoTableCrsr*>(rTbl[ n ]); - if( pUnoTblCrsr ) - { - FOREACHPAM_START( &pUnoTblCrsr->GetSelRing() ) - lcl_PaMCorrAbs1( PCURCRSR, pOldNode, aNewPos, nOffset ); - FOREACHPAM_END() - } - } - } -} - - -void PaMCorrAbs( const SwNodeIndex &rStartNode, - const SwNodeIndex &rEndNode, - const SwPosition &rNewPos ) +void PaMCorrAbs( const SwPaM& rRange, + const SwPosition& rNewPos ) { - const ULONG nSttNode = rStartNode.GetIndex(); - const ULONG nEndNode = rEndNode.GetIndex(); - const SwPosition aNewPos( rNewPos ); - SwDoc* pDoc = rStartNode.GetNode().GetDoc(); + SwPosition const aStart( *rRange.Start() ); + SwPosition const aEnd( *rRange.End() ); + SwPosition const aNewPos( rNewPos ); + SwDoc *const pDoc = aStart.nNode.GetNode().GetDoc(); + SwCrsrShell *const pShell = pDoc->GetEditShell(); - SwCrsrShell* pShell = pDoc->GetEditShell(); if( pShell ) { FOREACHSHELL_START( pShell ) SwPaM *_pStkCrsr = PCURSH->GetStkCrsr(); if( _pStkCrsr ) do { - lcl_PaMCorrAbs2( _pStkCrsr, aNewPos, nSttNode, nEndNode ); + lcl_PaMCorrAbs( *_pStkCrsr, aStart, aEnd, aNewPos ); } while ( (_pStkCrsr != 0 ) && ((_pStkCrsr=(SwPaM *)_pStkCrsr->GetNext()) != PCURSH->GetStkCrsr()) ); FOREACHPAM_START( PCURSH->_GetCrsr() ) - lcl_PaMCorrAbs2( PCURCRSR, aNewPos, nSttNode, nEndNode ); + lcl_PaMCorrAbs( *PCURCRSR, aStart, aEnd, aNewPos ); FOREACHPAM_END() if( PCURSH->IsTableMode() ) - lcl_PaMCorrAbs2( PCURSH->GetTblCrs(), aNewPos, nSttNode, nEndNode ); + lcl_PaMCorrAbs( *PCURSH->GetTblCrs(), aStart, aEnd, aNewPos ); FOREACHSHELL_END( pShell ) } - { - SwUnoCrsrTbl& rTbl = (SwUnoCrsrTbl&)pDoc->GetUnoCrsrTbl(); + SwUnoCrsrTbl& rTbl = const_cast<SwUnoCrsrTbl&>(pDoc->GetUnoCrsrTbl()); + for( USHORT n = 0; n < rTbl.Count(); ++n ) { - bool bChange = false; + SwUnoCrsr *const pUnoCursor = rTbl[ n ]; - SwUnoCrsr* pUnoCursor = rTbl[ n ]; + bool bChange = false; // has the UNO cursor been corrected? // determine whether the UNO cursor will leave it's designated // section - bool bLeaveSection = + bool const bLeaveSection = pUnoCursor->IsRemainInSection() && ( lcl_FindUnoCrsrSection( aNewPos.nNode.GetNode() ) != lcl_FindUnoCrsrSection( pUnoCursor->GetPoint()->nNode.GetNode() ) ); FOREACHPAM_START( pUnoCursor ) - bChange |= lcl_PaMCorrAbs2(PCURCRSR, aNewPos, nSttNode, nEndNode); + bChange |= lcl_PaMCorrAbs( *PCURCRSR, aStart, aEnd, aNewPos ); FOREACHPAM_END() - SwUnoTableCrsr* pUnoTblCrsr = - dynamic_cast<SwUnoTableCrsr*>(pUnoCursor); + SwUnoTableCrsr *const pUnoTblCrsr = + dynamic_cast<SwUnoTableCrsr *>(rTbl[ n ]); if( pUnoTblCrsr ) { FOREACHPAM_START( &pUnoTblCrsr->GetSelRing() ) bChange |= - lcl_PaMCorrAbs2( PCURCRSR, aNewPos, nSttNode, nEndNode ); + lcl_PaMCorrAbs( *PCURCRSR, aStart, aEnd, aNewPos ); FOREACHPAM_END() } // if a UNO cursor leaves its designated section, we must inform // (and invalidate) said cursor - if( bChange && bLeaveSection ) + if (bChange && bLeaveSection) { // the UNO cursor has left its section. We need to notify it! SwMsgPoolItem aHint( RES_UNOCURSOR_LEAVES_SECTION ); @@ -265,72 +198,31 @@ void PaMCorrAbs( const SwNodeIndex &rStartNode, } } - -void PaMCorrAbs( const SwPaM& rRange, - const SwPosition& rNewPos ) -{ - SwPosition aStart( *rRange.Start() ); - SwPosition aEnd( *rRange.End() ); - SwPosition aNewPos( rNewPos ); - SwDoc* pDoc = aStart.nNode.GetNode().GetDoc(); - SwCrsrShell* pShell = pDoc->GetEditShell(); - - if( pShell ) - { - FOREACHSHELL_START( pShell ) - SwPaM *_pStkCrsr = PCURSH->GetStkCrsr(); - if( _pStkCrsr ) - do { - lcl_PaMCorrAbs3( _pStkCrsr, aStart, aEnd, aNewPos ); - } while ( (_pStkCrsr != 0 ) && - ((_pStkCrsr=(SwPaM *)_pStkCrsr->GetNext()) != PCURSH->GetStkCrsr()) ); - - FOREACHPAM_START( PCURSH->_GetCrsr() ) - lcl_PaMCorrAbs3( PCURCRSR, aStart, aEnd, aNewPos ); - FOREACHPAM_END() - - if( PCURSH->IsTableMode() ) - lcl_PaMCorrAbs3( PCURSH->GetTblCrs(), aStart, aEnd, aNewPos ); - - FOREACHSHELL_END( pShell ) - } - { - SwUnoCrsrTbl& rTbl = (SwUnoCrsrTbl&)pDoc->GetUnoCrsrTbl(); - for( USHORT n = 0; n < rTbl.Count(); ++n ) - { - FOREACHPAM_START( rTbl[ n ] ) - lcl_PaMCorrAbs3( PCURCRSR, aStart, aEnd, aNewPos ); - FOREACHPAM_END() - - SwUnoTableCrsr* pUnoTblCrsr = - dynamic_cast<SwUnoTableCrsr*>(rTbl[ n ]); - if( pUnoTblCrsr ) - { - FOREACHPAM_START( &pUnoTblCrsr->GetSelRing() ) - lcl_PaMCorrAbs3( PCURCRSR, aStart, aEnd, aNewPos ); - FOREACHPAM_END() - } - } - } -} - void SwDoc::CorrAbs(const SwNodeIndex& rOldNode, const SwPosition& rNewPos, const xub_StrLen nOffset, BOOL bMoveCrsr) { + SwCntntNode *const pCntntNode( rOldNode.GetNode().GetCntntNode() ); + SwPaM const aPam(rOldNode, 0, + rOldNode, (pCntntNode) ? pCntntNode->Len() : 0); + SwPosition aNewPos(rNewPos); + aNewPos.nContent += nOffset; + getIDocumentMarkAccess()->correctMarksAbsolute(rOldNode, rNewPos, nOffset); - { // fix readlines + { // fix redlines SwRedlineTbl& rTbl = *pRedlineTbl; for( USHORT n = 0; n < rTbl.Count(); ++n ) { // is on position ?? - lcl_PaMCorrAbs1( rTbl[ n ], &rOldNode.GetNode(), SwPosition(rNewPos), nOffset ); + lcl_PaMCorrAbs(*rTbl[ n ], *aPam.Start(), *aPam.End(), aNewPos); } } if(bMoveCrsr) - ::PaMCorrAbs(rOldNode, rNewPos, nOffset); + { + ::PaMCorrAbs(aPam, aNewPos); + } } void SwDoc::CorrAbs(const SwPaM& rRange, @@ -352,12 +244,15 @@ void SwDoc::CorrAbs(const SwNodeIndex& rStartNode, const SwPosition& rNewPos, BOOL bMoveCrsr) { - SwPosition aNewPos(rNewPos); - _DelBookmarks(rStartNode, rEndNode); if(bMoveCrsr) - ::PaMCorrAbs(rStartNode, rEndNode, rNewPos); + { + SwCntntNode *const pCntntNode( rEndNode.GetNode().GetCntntNode() ); + SwPaM const aPam(rStartNode, 0, + rEndNode, (pCntntNode) ? pCntntNode->Len() : 0); + ::PaMCorrAbs(aPam, rNewPos); + } } diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 9d907b9896..86e27c006c 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -436,9 +436,8 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) "Was ist das fuer ein MessageItem?" ); SwFieldType* pFldType(0); - USHORT i; - for( i = 0; i < pFldTypes->Count(); ++i ) + for (USHORT i = 0; i < pFldTypes->Count(); ++i) { if( RES_TABLEFLD == ( pFldType = (*pFldTypes)[i] )->Which() ) { @@ -507,13 +506,15 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) // und dann noch alle Tabellen Box Formeln abklappern const SfxPoolItem* pItem; - USHORT nMaxItems = GetAttrPool().GetItemCount( RES_BOXATR_FORMULA ); - for( i = 0; i < nMaxItems; ++i ) - if( 0 != (pItem = GetAttrPool().GetItem( RES_BOXATR_FORMULA, i ) ) && + sal_uInt32 nMaxItems = GetAttrPool().GetItemCount2( RES_BOXATR_FORMULA ); + for (sal_uInt32 i = 0; i < nMaxItems; ++i) + { + if( 0 != (pItem = GetAttrPool().GetItem2( RES_BOXATR_FORMULA, i ) ) && ((SwTblBoxFormula*)pItem)->GetDefinedIn() ) { ((SwTblBoxFormula*)pItem)->ChangeState( pHt ); } + } // alle Felder/Boxen sind jetzt invalide, also kann das Rechnen anfangen @@ -608,8 +609,9 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) } // dann berechene noch die Formeln an den Boxen - for( i = 0; i < nMaxItems; ++i ) - if( 0 != (pItem = GetAttrPool().GetItem( RES_BOXATR_FORMULA, i ) ) && + for (sal_uInt32 i = 0; i < nMaxItems; ++i ) + { + if( 0 != (pItem = GetAttrPool().GetItem2( RES_BOXATR_FORMULA, i ) ) && ((SwTblBoxFormula*)pItem)->GetDefinedIn() && !((SwTblBoxFormula*)pItem)->IsValid() ) { @@ -685,6 +687,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) } } } + } if( pCalc ) delete pCalc; @@ -1732,7 +1735,6 @@ String lcl_DBDataToString(const SwDBData& rData) void SwDoc::GetAllUsedDB( SvStringsDtor& rDBNameList, const SvStringsDtor* pAllDBNames ) { - USHORT n; SvStringsDtor aUsedDBNames; SvStringsDtor aAllDBNames; @@ -1743,7 +1745,7 @@ void SwDoc::GetAllUsedDB( SvStringsDtor& rDBNameList, } SwSectionFmts& rArr = GetSections(); - for( n = rArr.Count(); n; ) + for (USHORT n = rArr.Count(); n; ) { SwSection* pSect = rArr[ --n ]->GetSection(); @@ -1757,10 +1759,10 @@ void SwDoc::GetAllUsedDB( SvStringsDtor& rDBNameList, } const SfxPoolItem* pItem; - USHORT nMaxItems = GetAttrPool().GetItemCount( RES_TXTATR_FIELD ); - for( n = 0; n < nMaxItems; ++n ) + sal_uInt32 nMaxItems = GetAttrPool().GetItemCount2( RES_TXTATR_FIELD ); + for (sal_uInt32 n = 0; n < nMaxItems; ++n) { - if( 0 == (pItem = GetAttrPool().GetItem( RES_TXTATR_FIELD, n ) )) + if( 0 == (pItem = GetAttrPool().GetItem2( RES_TXTATR_FIELD, n ) )) continue; const SwFmtFld* pFmtFld = (SwFmtFld*)pItem; @@ -1916,10 +1918,9 @@ void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames, aNewDBData.nCommandType = (short)rNewName.GetToken(2, DB_DELIM).ToInt32(); String sFormel; - USHORT n; SwSectionFmts& rArr = GetSections(); - for( n = rArr.Count(); n; ) + for (USHORT n = rArr.Count(); n; ) { SwSection* pSect = rArr[ --n ]->GetSection(); @@ -1932,11 +1933,11 @@ void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames, } const SfxPoolItem* pItem; - USHORT nMaxItems = GetAttrPool().GetItemCount( RES_TXTATR_FIELD ); + sal_uInt32 nMaxItems = GetAttrPool().GetItemCount2( RES_TXTATR_FIELD ); - for( n = 0; n < nMaxItems; ++n ) + for (sal_uInt32 n = 0; n < nMaxItems; ++n ) { - if( 0 == (pItem = GetAttrPool().GetItem( RES_TXTATR_FIELD, n ) )) + if( 0 == (pItem = GetAttrPool().GetItem2( RES_TXTATR_FIELD, n ) )) continue; SwFmtFld* pFmtFld = (SwFmtFld*)pItem; @@ -2329,9 +2330,8 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode ) SwSectionNode* pSectNd; USHORT nArrStt = 0; ULONG nSttCntnt = rDoc.GetNodes().GetEndOfExtras().GetIndex(); - USHORT n; - for( n = rArr.Count(); n; ) + for (USHORT n = rArr.Count(); n; ) { SwSection* pSect = rArr[ --n ]->GetSection(); if( pSect && pSect->IsHidden() && pSect->GetCondition().Len() && @@ -2351,13 +2351,13 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode ) // erst alle anzeigen, damit die Frames vorhanden sind. Mit deren // Position wird das BodyAnchor ermittelt. // Dafuer erst den ContentBereich, dann die Sonderbereiche!!! - for( n = nArrStt; n < aTmpArr.Count(); ++n ) + for (USHORT n = nArrStt; n < aTmpArr.Count(); ++n) { pSectNd = rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode(); ASSERT( pSectNd, "Wo ist mein SectionNode" ); pSectNd->GetSection().SetCondHidden( FALSE ); } - for( n = 0; n < nArrStt; ++n ) + for (USHORT n = 0; n < nArrStt; ++n) { pSectNd = rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode(); ASSERT( pSectNd, "Wo ist mein SectionNode" ); @@ -2365,8 +2365,10 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode ) } // so, erst jetzt alle sortiert in die Liste eintragen - for( n = 0; n < aTmpArr.Count(); ++n ) + for (USHORT n = 0; n < aTmpArr.Count(); ++n) + { GetBodyNode( *rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode() ); + } } String sTrue( String::CreateFromAscii( @@ -2378,10 +2380,10 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode ) USHORT nWhich, n; const String* pFormel = 0; const SfxPoolItem* pItem; - USHORT nMaxItems = rDoc.GetAttrPool().GetItemCount( RES_TXTATR_FIELD ); + sal_uInt32 nMaxItems = rDoc.GetAttrPool().GetItemCount2( RES_TXTATR_FIELD ); for( n = 0; n < nMaxItems; ++n ) { - if( 0 == (pItem = rDoc.GetAttrPool().GetItem( RES_TXTATR_FIELD, n )) ) + if( 0 == (pItem = rDoc.GetAttrPool().GetItem2( RES_TXTATR_FIELD, n )) ) continue; const SwFmtFld* pFmtFld = (SwFmtFld*)pItem; @@ -2464,24 +2466,26 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode ) { SwDBData aDBData(((SwDBNumSetField*)pFld)->GetDBData(&rDoc)); - if( bIsDBMgr && - rDoc.GetNewDBMgr()->OpenDataSource( aDBData.sDataSource, aDBData.sCommand )&& - GETFLD_ALL == eGetMode || - ( GETFLD_CALC & eGetMode && - ((SwDBNumSetField*)pFld)->IsCondValid())) + if ( + (bIsDBMgr && rDoc.GetNewDBMgr()->OpenDataSource(aDBData.sDataSource, aDBData.sCommand)) && + (GETFLD_ALL == eGetMode || (GETFLD_CALC & eGetMode && ((SwDBNumSetField*)pFld)->IsCondValid())) + ) + { pFormel = &pFld->GetPar1(); + } } break; case RES_DBNEXTSETFLD: { SwDBData aDBData(((SwDBNextSetField*)pFld)->GetDBData(&rDoc)); - if( bIsDBMgr && - rDoc.GetNewDBMgr()->OpenDataSource( aDBData.sDataSource, aDBData.sCommand )&& - GETFLD_ALL == eGetMode || - ( GETFLD_CALC & eGetMode && - ((SwDBNextSetField*)pFld)->IsCondValid() )) + if ( + (bIsDBMgr && rDoc.GetNewDBMgr()->OpenDataSource(aDBData.sDataSource, aDBData.sCommand)) && + (GETFLD_ALL == eGetMode || (GETFLD_CALC & eGetMode && ((SwDBNextSetField*)pFld)->IsCondValid())) + ) + { pFormel = &pFld->GetPar1(); + } } break; } diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 2afa2fa9e9..914bde9119 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1347,9 +1347,9 @@ void SwDoc::SetDefault( const SfxItemSet& rSet ) nOldWidth = ((SvxTabStopItem&)aOld.Get(RES_PARATR_TABSTOP))[ 0 ].GetTabPos(); int bChg = FALSE; - USHORT nMaxItems = GetAttrPool().GetItemCount( RES_PARATR_TABSTOP ); - for( USHORT n = 0; n < nMaxItems; ++n ) - if( 0 != (pTmpItem = GetAttrPool().GetItem( RES_PARATR_TABSTOP, n ) )) + sal_uInt32 nMaxItems = GetAttrPool().GetItemCount2( RES_PARATR_TABSTOP ); + for( sal_uInt32 n = 0; n < nMaxItems; ++n ) + if( 0 != (pTmpItem = GetAttrPool().GetItem2( RES_PARATR_TABSTOP, n ) )) bChg |= lcl_SetNewDefTabStops( nOldWidth, nNewWidth, *(SvxTabStopItem*)pTmpItem ); diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx index 9af54315b2..65b55f1ab0 100644 --- a/sw/source/core/doc/docftn.cxx +++ b/sw/source/core/doc/docftn.cxx @@ -333,10 +333,15 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo) } BOOL bNumChg = rInfo.nFtnOffset != GetEndNoteInfo().nFtnOffset; - BOOL bExtra = !bNumChg && - rInfo.aFmt.GetNumberingType() != GetEndNoteInfo().aFmt.GetNumberingType()|| - rInfo.GetPrefix() != GetEndNoteInfo().GetPrefix() || - rInfo.GetSuffix() != GetEndNoteInfo().GetSuffix(); + // this seems to be an optimization: UpdateAllFtn() is only called + // if the offset changes; if the offset is the same, + // but type/prefix/suffix changes, just set new numbers. + bool const bExtra = !bNumChg && + ( (rInfo.aFmt.GetNumberingType() != + GetEndNoteInfo().aFmt.GetNumberingType()) + || (rInfo.GetPrefix() != GetEndNoteInfo().GetPrefix()) + || (rInfo.GetSuffix() != GetEndNoteInfo().GetSuffix()) + ); BOOL bFtnDesc = rInfo.GetPageDesc( *this ) != GetEndNoteInfo().GetPageDesc( *this ); SwCharFmt *pOldChrFmt = GetEndNoteInfo().GetCharFmt( *this ), diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 3b81863ea5..33819154ef 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -366,6 +366,7 @@ SwDoc::SwDoc() : mbUseFormerObjectPos = aOptions.IsUseObjectPositioning(); mbUseFormerTextWrapping = aOptions.IsUseOurTextWrapping(); mbConsiderWrapOnObjPos = aOptions.IsConsiderWrappingStyle(); + mbMathBaselineAlignment = false; // default for *old* documents is 'off' mbAddFlyOffsets = false; // hidden mbOldNumbering = false; // hidden mbUseHiResolutionVirtualDevice = true; // hidden @@ -835,8 +836,8 @@ void SwDoc::ClearDoc() pFirstNd->SetAttr( SwFmtPageDesc( pDummyPgDsc )); SwPosition aPos( *pFirstNd, SwIndex( pFirstNd )); - ::PaMCorrAbs( aSttIdx, SwNodeIndex( GetNodes().GetEndOfContent() ), - aPos ); + SwPaM const tmpPaM(aSttIdx, SwNodeIndex(GetNodes().GetEndOfContent())); + ::PaMCorrAbs(tmpPaM, aPos); } GetNodes().Delete( aSttIdx, diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 95ba6541c4..bb15b47941 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -1092,7 +1092,23 @@ void SwDoc::SetNumRule( const SwPaM& rPam, { SvUShortsSort aResetAttrsArray; aResetAttrsArray.Insert( RES_LR_SPACE ); - ResetAttrs( rPam, sal_True, &aResetAttrsArray ); + // --> OD 2010-10-05 #i114929# + // On a selection setup a corresponding Point-and-Mark in order to get + // the indentation attribute reset on all paragraphs touched by the selection + if ( rPam.HasMark() && + rPam.End()->nNode.GetNode().GetTxtNode() ) + { + SwPaM aPam( rPam.Start()->nNode, + rPam.End()->nNode ); + aPam.Start()->nContent = 0; + aPam.End()->nContent = rPam.End()->nNode.GetNode().GetTxtNode()->Len(); + ResetAttrs( aPam, FALSE, &aResetAttrsArray ); + } + else + { + ResetAttrs( rPam, FALSE, &aResetAttrsArray ); + } + // <-- } // <-- @@ -1104,22 +1120,27 @@ void SwDoc::SetNumRule( const SwPaM& rPam, void SwDoc::SetCounted(const SwPaM & rPam, bool bCounted) { - // --> OD 2008-04-03 #refactorlists# -// ULONG nStartPos = rPam.Start()->nNode.GetIndex(); -// ULONG nEndPos = rPam.End()->nNode.GetIndex(); - -// for (ULONG n = nStartPos; n <= nEndPos; n++) -// { -// SwTxtNode * pNd = GetNodes()[n]->GetTxtNode(); - -// if (pNd) -// pNd->SetCountedInList(bCounted); -// } if ( bCounted ) { SvUShortsSort aResetAttrsArray; aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED ); - ResetAttrs( rPam, sal_True, &aResetAttrsArray ); + // --> OD 2010-10-05 #i114929# + // On a selection setup a corresponding Point-and-Mark in order to get + // the list-is-counted attribute reset on all paragraphs touched by the selection + if ( rPam.HasMark() && + rPam.End()->nNode.GetNode().GetTxtNode() ) + { + SwPaM aPam( rPam.Start()->nNode, + rPam.End()->nNode ); + aPam.Start()->nContent = 0; + aPam.End()->nContent = rPam.End()->nNode.GetNode().GetTxtNode()->Len(); + ResetAttrs( aPam, FALSE, &aResetAttrsArray ); + } + else + { + ResetAttrs( rPam, FALSE, &aResetAttrsArray ); + } + // <-- } else { @@ -1128,30 +1149,6 @@ void SwDoc::SetCounted(const SwPaM & rPam, bool bCounted) } } -//void SwDoc::ReplaceNumRule(const SwPaM & rPaM, const SwNumRule & rNumRule) -//{ -// if (DoesUndo()) -// StartUndo(UNDO_START, NULL); - -// ULONG nStt = rPaM.Start()->nNode.GetIndex(); -// ULONG nEnd = rPaM.End()->nNode.GetIndex(); - -// for (ULONG n = nStt; n <= nEnd; n++) -// { -// SwTxtNode * pCNd = GetNodes()[n]->GetTxtNode(); - -// if (pCNd && NULL != pCNd->GetNumRule()) -// { -// SwPaM aPam(*pCNd); - -// InsertPoolItem(aPam, SwNumRuleItem(rNumRule.GetName()), 0); -// } -// } - -// if (DoesUndo()) -// EndUndo(UNDO_START, NULL); -//} - void SwDoc::SetNumRuleStart( const SwPosition& rPos, BOOL bFlag ) { SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode(); diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 4eda348cd3..4c80d17be0 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -110,9 +110,9 @@ USHORT SwDoc::GetTOIKeys( SwTOIKeyType eTyp, SvStringsSort& rArr ) const const SwTxtTOXMark* pMark; const SfxPoolItem* pItem; const SwTOXType* pTOXType; - USHORT i, nMaxItems = GetAttrPool().GetItemCount( RES_TXTATR_TOXMARK ); + sal_uInt32 i, nMaxItems = GetAttrPool().GetItemCount2( RES_TXTATR_TOXMARK ); for( i = 0; i < nMaxItems; ++i ) - if( 0 != (pItem = GetAttrPool().GetItem( RES_TXTATR_TOXMARK, i ) ) && + if( 0 != (pItem = GetAttrPool().GetItem2( RES_TXTATR_TOXMARK, i ) ) && 0!= ( pTOXType = ((SwTOXMark*)pItem)->GetTOXType()) && TOX_INDEX == pTOXType->GetType() && 0 != ( pMark = ((SwTOXMark*)pItem)->GetTxtTOXMark() ) && diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 3c1d88c700..c0117e686c 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -71,9 +71,7 @@ #include <poolfmt.hxx> #include <mdiexp.hxx> #include <swwait.hxx> -#ifndef _COMCORE_HRC #include <comcore.hrc> -#endif #include <accessibilityoptions.hxx> #include <com/sun/star/embed/EmbedMisc.hpp> #include <com/sun/star/embed/EmbedStates.hpp> @@ -266,7 +264,7 @@ void lcl_ClearArea( const SwFrm &rFrm, |* *************************************************************************/ -void SwNoTxtFrm::Paint( const SwRect &rRect, const SwPrtOptions * /*pPrintData*/ ) const +void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const { if ( Frm().IsEmpty() ) return; diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx index 3d8b05a717..6deb411a35 100644 --- a/sw/source/core/doc/visiturl.cxx +++ b/sw/source/core/doc/visiturl.cxx @@ -71,9 +71,9 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint ) const SwFmtINetFmt* pItem; const SwTxtINetFmt* pTxtAttr; const SwTxtNode* pTxtNd; - USHORT n, nMaxItems = pDoc->GetAttrPool().GetItemCount( RES_TXTATR_INETFMT ); + sal_uInt32 n, nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_INETFMT ); for( n = 0; n < nMaxItems; ++n ) - if( 0 != (pItem = (SwFmtINetFmt*)pDoc->GetAttrPool().GetItem( + if( 0 != (pItem = (SwFmtINetFmt*)pDoc->GetAttrPool().GetItem2( RES_TXTATR_INETFMT, n ) ) && ( pItem->GetValue() == sURL || ( sBkmk.Len() && pItem->GetValue() == sBkmk )) && diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 7e81a41f18..426163198e 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -2126,9 +2126,10 @@ BOOL SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) *aSavePaM.GetMark() = SwPosition( *pTblNd ); aSavePaM.Move( fnMoveBackward, fnGoNode ); } - ::PaMCorrAbs( SwNodeIndex( *pTblNd ), - SwNodeIndex( *pTblNd->EndOfSectionNode() ), - *aSavePaM.GetMark() ); + { + SwPaM const tmpPaM(*pTblNd, *pTblNd->EndOfSectionNode()); + ::PaMCorrAbs(tmpPaM, *aSavePaM.GetMark()); + } // harte SeitenUmbrueche am nachfolgenden Node verschieben BOOL bSavePageBreak = FALSE, bSavePageDesc = FALSE; @@ -2182,9 +2183,10 @@ BOOL SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) *aSavePaM.GetMark() = SwPosition( *pTblNd ); aSavePaM.Move( fnMoveBackward, fnGoNode ); } - ::PaMCorrAbs( SwNodeIndex( *pTblNd ), - SwNodeIndex( *pTblNd->EndOfSectionNode() ), - *aSavePaM.GetMark() ); + { + SwPaM const tmpPaM(*pTblNd, *pTblNd->EndOfSectionNode()); + ::PaMCorrAbs(tmpPaM, *aSavePaM.GetMark()); + } // harte SeitenUmbrueche am nachfolgenden Node verschieben SwCntntNode* pNextNd = GetNodes()[ pTblNd->EndOfSectionIndex()+1 ]->GetCntntNode(); diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index d1e3446c72..3b792dc788 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -740,9 +740,9 @@ const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay, SwFindNearestNode aInfo( *pNd ); // dann ueber alle Nodes aller PageDesc const SfxPoolItem* pItem; - USHORT i, nMaxItems = pDoc->GetAttrPool().GetItemCount( RES_PAGEDESC ); + sal_uInt32 i, nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_PAGEDESC ); for( i = 0; i < nMaxItems; ++i ) - if( 0 != (pItem = pDoc->GetAttrPool().GetItem( RES_PAGEDESC, i ) ) && + if( 0 != (pItem = pDoc->GetAttrPool().GetItem2( RES_PAGEDESC, i ) ) && ((SwFmtPageDesc*)pItem)->GetDefinedIn() ) { const SwModify* pMod = ((SwFmtPageDesc*)pItem)->GetDefinedIn(); diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index f709decc3e..d6189a6b82 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -32,6 +32,7 @@ #include <editeng/protitem.hxx> #include <svx/svdpagv.hxx> #include <svx/fmmodel.hxx> +#include <sot/exchange.hxx> #include "swtypes.hxx" #include "pagefrm.hxx" @@ -991,6 +992,14 @@ void SwDrawView::CheckPossibilities() bSzProtect |= ( embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ) ) ? TRUE : FALSE; // <-- + + // #i972: protect position if it is a Math object anchored 'as char' and baseline alignment is activated + SwDoc* pDoc = Imp().GetShell()->GetDoc(); + const bool bProtectMathPos = SotExchange::IsMath( xObj->getClassID() ) + && FLY_AS_CHAR == pFly->GetFmt()->GetAnchor().GetAnchorId() + && pDoc->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ); + if (bProtectMathPos) + bMoveProtect = true; } } } @@ -1112,4 +1121,3 @@ const SdrMarkList& SwDrawView::GetMarkedObjectList() const - diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index b639c37a23..701f013f0a 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -457,7 +457,7 @@ BOOL lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos, const SwField* const pFld = pAttr->GetFld().GetFld(); if (pFld) { - sExp += pFld->ExpandField(rTNd.GetDoc()->IsClipBoard()); + sExp += pFld->ExpandField(true); } } } diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx index 8c5b02794e..06e621b527 100644 --- a/sw/source/core/edit/edfld.cxx +++ b/sw/source/core/edit/edfld.cxx @@ -224,8 +224,7 @@ void SwEditShell::FieldToText( SwFieldType* pType ) *pFmtFld->GetTxtFld()->GetStart() ); // Feldinhalt durch Text ersetzen - String const aEntry( - pFmtFld->GetFld()->ExpandField(GetDoc()->IsClipBoard()) ); + String const aEntry( pFmtFld->GetFld()->ExpandField(true) ); pPaM->SetMark(); pPaM->Move( fnMoveForward ); GetDoc()->DeleteRange( *pPaM ); @@ -342,11 +341,11 @@ SwTxtFld* lcl_FindInputFld( SwDoc* pDoc, SwField& rFld ) ((SwSetExpField&)rFld).GetInputFlag() ) ) { const SfxPoolItem* pItem; - USHORT n, nMaxItems = - pDoc->GetAttrPool().GetItemCount( RES_TXTATR_FIELD ); + sal_uInt32 n, nMaxItems = + pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_FIELD ); for( n = 0; n < nMaxItems; ++n ) if( 0 != (pItem = - pDoc->GetAttrPool().GetItem( RES_TXTATR_FIELD, n ) ) + pDoc->GetAttrPool().GetItem2( RES_TXTATR_FIELD, n ) ) && ((SwFmtFld*)pItem)->GetFld() == &rFld ) { pTFld = ((SwFmtFld*)pItem)->GetTxtFld(); diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index e3ebcbcdf4..8ef9460b89 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -1184,32 +1184,6 @@ void SwEditShell::TransliterateText( sal_uInt32 nType ) EndAllAction(); } -void SwEditShell::TransliterateText( const String& rModuleName ) -{ - utl::TransliterationWrapper aTrans(::comphelper::getProcessServiceFactory(), 0 ); - aTrans.loadModuleByImplName( rModuleName, LANGUAGE_SYSTEM ); - StartAllAction(); - SET_CURR_SHELL( this ); - - SwPaM* pCrsr = GetCrsr(); - if( pCrsr->GetNext() != pCrsr ) - { - GetDoc()->StartUndo(UNDO_EMPTY, NULL); - FOREACHPAM_START( this ) - - if( PCURCRSR->HasMark() ) - GetDoc()->TransliterateText( *PCURCRSR, aTrans ); - - FOREACHPAM_END() - GetDoc()->EndUndo(UNDO_EMPTY, NULL); - } - else - GetDoc()->TransliterateText( *pCrsr, aTrans ); - - EndAllAction(); -} - - void SwEditShell::CountWords( SwDocStat& rStat ) const { FOREACHPAM_START( this ) diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index a2c5cfd363..a792e6f3f2 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -234,25 +234,6 @@ BOOL SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet ) return bRet; } -BOOL SwEditShell::UpdateField( sw::mark::IFieldmark &fieldBM) -{ -// SwDocShell* pDocSh = pDoc->GetDocShell(); - //@TODO implement me...; add undo etc... - if ( pDoc && fieldBM.IsExpanded( ) ) { - SwPosition aSttPos = fieldBM.GetMarkStart( ); - aSttPos.nContent++; - - SwPosition aEndPos = fieldBM.GetMarkEnd( ); - aEndPos.nContent--; - - SwPaM aPaM( aSttPos, aEndPos ); - pDoc->DeleteRange(aPaM); - pDoc->InsertString(aPaM, String::CreateFromAscii("Implement me ;-)") ); - } - return TRUE; -} - - /*-------------------------------------------------------------------- Beschreibung: Aktuelles Verzeichnis vor oder in dem der Cursor steht diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index fb98a31c93..b93d14ae5c 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -203,7 +203,7 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const break; default: - String const value(pFld->ExpandField(pDoc->IsClipBoard())); + String const value(pFld->ExpandField(true)); nRet = rCalcPara.rCalc.Calculate(value).GetDouble(); } } diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx index 92ad0ed940..20760cc751 100644 --- a/sw/source/core/fields/dbfld.cxx +++ b/sw/source/core/fields/dbfld.cxx @@ -28,7 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include <float.h> #include <sfx2/app.hxx> #include <svl/zforlist.hxx> @@ -44,15 +43,11 @@ #include <pam.hxx> #include <ndtxt.hxx> #include <dbfld.hxx> -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif #include <docfld.hxx> #include <expfld.hxx> #include <txtatr.hxx> -#ifndef _UNOFLDMID_H #include <unofldmid.h> -#endif using namespace ::com::sun::star::sdbc; @@ -281,27 +276,23 @@ SwField* SwDBField::Copy() const return pTmp; } -String SwDBField::GetCntnt(BOOL bName) const +String SwDBField::GetFieldName() const { - if(bName) - { - const String& rDBName = ((SwDBFieldType*)GetTyp())->GetName(); + const String& rDBName = static_cast<SwDBFieldType*>(GetTyp())->GetName(); //TODO/CLEANUP //Funktion tut nichts! //String sContent( SFX_APP()->LocalizeDBName(INI2NATIONAL, // rDBName.GetToken(0, DB_DELIM))); - String sContent( rDBName.GetToken(0, DB_DELIM) ); + String sContent( rDBName.GetToken(0, DB_DELIM) ); - if (sContent.Len() > 1) - { - sContent += DB_DELIM; - sContent += rDBName.GetToken(1, DB_DELIM); - sContent += DB_DELIM; - sContent += rDBName.GetToken(2, DB_DELIM); - } - return lcl_DBTrennConv(sContent); + if (sContent.Len() > 1) + { + sContent += DB_DELIM; + sContent += rDBName.GetToken(1, DB_DELIM); + sContent += DB_DELIM; + sContent += rDBName.GetToken(2, DB_DELIM); } - return Expand(); + return lcl_DBTrennConv(sContent); } //------------------------------------------------------------------------------ @@ -547,19 +538,15 @@ void SwDBNameInfField::SetDBData(const SwDBData & rDBData) //------------------------------------------------------------------------------ -String SwDBNameInfField::GetCntnt(BOOL bName) const +String SwDBNameInfField::GetFieldName() const { - String sStr(SwField::GetCntnt(bName)); - - if(bName) + String sStr( SwField::GetFieldName() ); + if (aDBData.sDataSource.getLength()) { - if (aDBData.sDataSource.getLength()) - { - sStr += ':'; - sStr += String(aDBData.sDataSource); - sStr += DB_DELIM; - sStr += String(aDBData.sCommand); - } + sStr += ':'; + sStr += String(aDBData.sDataSource); + sStr += DB_DELIM; + sStr += String(aDBData.sCommand); } return lcl_DBTrennConv(sStr); } diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 66245b33b3..23695758f5 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -171,9 +171,9 @@ void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc, sal_uInt16 nPage, // es NIE zurueck const SfxItemPool &rPool = pDoc->GetAttrPool(); const SwFmtPageDesc *pDesc; - sal_uInt16 nMaxItems = rPool.GetItemCount( RES_PAGEDESC ); - for( sal_uInt16 n = 0; n < nMaxItems; ++n ) - if( 0 != (pDesc = (SwFmtPageDesc*)rPool.GetItem( RES_PAGEDESC, n ) ) + sal_uInt32 nMaxItems = rPool.GetItemCount2( RES_PAGEDESC ); + for( sal_uInt32 n = 0; n < nMaxItems; ++n ) + if( 0 != (pDesc = (SwFmtPageDesc*)rPool.GetItem2( RES_PAGEDESC, n ) ) && pDesc->GetNumOffset() && pDesc->GetDefinedIn() ) { if( pDesc->GetDefinedIn()->ISA( SwCntntNode )) @@ -1198,30 +1198,30 @@ String SwDocInfoField::Expand() const /* --------------------------------------------------------------------------- ---------------------------------------------------------------------------*/ -String SwDocInfoField::GetCntnt(sal_Bool bName) const +String SwDocInfoField::GetFieldName() const { - if ( bName ) - { - String aStr(SwFieldType::GetTypeStr(GetTypeId())); - aStr += ':'; + String aStr(SwFieldType::GetTypeStr(GetTypeId())); + aStr += ':'; - sal_uInt16 nSub = nSubType & 0xff; + sal_uInt16 const nSub = nSubType & 0xff; - switch(nSub) - { - case DI_CUSTOM: - aStr += aName; - break; + switch (nSub) + { + case DI_CUSTOM: + aStr += aName; + break; - default: - aStr += *ViewShell::GetShellRes()->aDocInfoLst[ nSub - DI_SUBTYPE_BEGIN ]; - break; - } - if( IsFixed() ) - ( aStr += ' ' ) += ViewShell::GetShellRes()->aFixedStr; - return aStr; + default: + aStr += *ViewShell::GetShellRes() + ->aDocInfoLst[ nSub - DI_SUBTYPE_BEGIN ]; + break; } - return Expand(); + if (IsFixed()) + { + aStr += ' '; + aStr += ViewShell::GetShellRes()->aFixedStr; + } + return aStr; } /* --------------------------------------------------------------------------- @@ -1517,25 +1517,20 @@ void SwHiddenTxtField::Evaluate(SwDoc* pDoc) /* --------------------------------------------------------------------------- ---------------------------------------------------------------------------*/ -String SwHiddenTxtField::GetCntnt(sal_Bool bName) const +String SwHiddenTxtField::GetFieldName() const { - if ( bName ) - { - String aStr(SwFieldType::GetTypeStr(nSubType)); - aStr += ' '; - aStr += aCond; - aStr += ' '; - aStr += aTRUETxt; + String aStr(SwFieldType::GetTypeStr(nSubType)); + aStr += ' '; + aStr += aCond; + aStr += ' '; + aStr += aTRUETxt; - if(nSubType == TYP_CONDTXTFLD) - { -static char __READONLY_DATA cTmp[] = " : "; - aStr.AppendAscii(cTmp); - aStr += aFALSETxt; - } - return aStr; + if (nSubType == TYP_CONDTXTFLD) + { + aStr.AppendAscii(" : "); + aStr += aFALSETxt; } - return Expand(); + return aStr; } /* --------------------------------------------------------------------------- diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index 07c8839898..bb4d56728d 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -305,18 +305,15 @@ String SwGetExpField::Expand() const return sExpand; } -String SwGetExpField::GetCntnt(BOOL bName) const -{ - if ( bName ) - { - String aStr( SwFieldType::GetTypeStr( static_cast<USHORT>(nsSwGetSetExpType::GSE_FORMULA & nSubType - ? TYP_FORMELFLD - : TYP_GETFLD ) )); - aStr += ' '; - aStr += GetFormula(); - return aStr; - } - return Expand(); +String SwGetExpField::GetFieldName() const +{ + String aStr( SwFieldType::GetTypeStr( + static_cast<USHORT>(((nsSwGetSetExpType::GSE_FORMULA & nSubType) != 0) + ? TYP_FORMELFLD + : TYP_GETFLD ) )); + aStr += ' '; + aStr += GetFormula(); + return aStr; } SwField* SwGetExpField::Copy() const @@ -834,35 +831,28 @@ String SwSetExpField::Expand() const } /*-------------------------------------------------------------------- - Beschreibung: liefert den Namen oder den Inhalt + @return the field name --------------------------------------------------------------------*/ -String SwSetExpField::GetCntnt(BOOL bName) const +String SwSetExpField::GetFieldName() const { - if( bName ) - { - USHORT nStrType; - - if( IsSequenceFld() ) - nStrType = TYP_SEQFLD; - else if( bInput ) - nStrType = TYP_SETINPFLD; - else - nStrType = TYP_SETFLD; + SwFldTypesEnum const nStrType( (IsSequenceFld()) + ? TYP_SEQFLD + : (bInput) + ? TYP_SETINPFLD + : TYP_SETFLD ); - String aStr( SwFieldType::GetTypeStr( nStrType ) ); - aStr += ' '; - aStr += GetTyp()->GetName(); + String aStr( SwFieldType::GetTypeStr( static_cast<USHORT>(nStrType) ) ); + aStr += ' '; + aStr += GetTyp()->GetName(); - if( TYP_SEQFLD != nStrType ) - { - // Sequence nicht die Formel ausgeben - aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " = " )); - aStr += GetFormula(); - } - return aStr; + // Sequence: without formula + if (TYP_SEQFLD != nStrType) + { + aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " = " ) ); + aStr += GetFormula(); } - return Expand(); + return aStr; } SwField* SwSetExpField::Copy() const @@ -1021,20 +1011,16 @@ SwInputField::SwInputField(SwInputFieldType* pTyp, const String& rContent, { } -String SwInputField::GetCntnt(BOOL bName) const +String SwInputField::GetFieldName() const { - if ( bName ) + String aStr(SwField::GetFieldName()); + if ((nSubType & 0x00ff) == INP_USR) { - String aStr(SwField::GetCntnt(bName)); - if ((nSubType & 0x00ff) == INP_USR) - { - aStr += GetTyp()->GetName(); - aStr += ' '; - aStr += aContent; - } - return aStr; + aStr += GetTyp()->GetName(); + aStr += ' '; + aStr += aContent; } - return Expand(); + return aStr; } SwField* SwInputField::Copy() const diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index 95dd94b9b7..af78843912 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -28,16 +28,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - -// #include <math.h> #include <float.h> #include <rtl/math.hxx> #include <svl/zforlist.hxx> #include <svl/zformat.hxx> #include <editeng/unolingu.hxx> -#ifndef _UNOFLDMID_H #include <unofldmid.h> -#endif #include <doc.hxx> #include <editsh.hxx> #include <frame.hxx> @@ -53,9 +49,7 @@ #include <expfld.hxx> #include <shellres.hxx> #include <calc.hxx> -#ifndef _COMCORE_HRC #include <comcore.hrc> -#endif #include <math.h> #include <float.h> @@ -269,21 +263,20 @@ USHORT SwField::GetTypeId() const Beschreibung: liefert den Namen oder den Inhalt --------------------------------------------------------------------*/ -String SwField::GetCntnt( BOOL bName ) const +String SwField::GetFieldName() const { - String sRet; - if( bName ) + USHORT nTypeId = GetTypeId(); + if (RES_DATETIMEFLD == GetTyp()->Which()) { - USHORT nTypeId = GetTypeId(); - if( RES_DATETIMEFLD == GetTyp()->Which() ) - nTypeId = static_cast<USHORT>(GetSubType() & DATEFLD ? TYP_DATEFLD : TYP_TIMEFLD); - - sRet = SwFieldType::GetTypeStr( nTypeId ); - if( IsFixed() ) - ( sRet += ' ' ) += ViewShell::GetShellRes()->aFixedStr; + nTypeId = static_cast<USHORT>( + ((GetSubType() & DATEFLD) != 0) ? TYP_DATEFLD : TYP_TIMEFLD); + } + String sRet = SwFieldType::GetTypeStr( nTypeId ); + if (IsFixed()) + { + sRet += ' '; + sRet += ViewShell::GetShellRes()->aFixedStr; } - else - sRet = Expand(); return sRet; } @@ -434,9 +427,9 @@ BOOL SwField::IsFixed() const return bRet; } -String SwField::ExpandField(bool const bInClipboard) const +String SwField::ExpandField(bool const bCached) const { - if (!bInClipboard) // #i85766# do not expand fields in clipboard documents + if (!bCached) // #i85766# do not expand fields in clipboard documents { m_Cache = Expand(); } @@ -447,7 +440,8 @@ SwField * SwField::CopyField() const { SwField *const pNew = Copy(); // #i85766# cache expansion of source (for clipboard) - pNew->m_Cache = Expand(); + // use this->cache, not this->Expand(): only text formatting calls Expand() + pNew->m_Cache = m_Cache; return pNew; } diff --git a/sw/source/core/fields/macrofld.cxx b/sw/source/core/fields/macrofld.cxx index 1471d46b29..57584fc90f 100644 --- a/sw/source/core/fields/macrofld.cxx +++ b/sw/source/core/fields/macrofld.cxx @@ -28,20 +28,19 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include <hintids.hxx> #include <doc.hxx> #include <docufld.hxx> -#ifndef _UNOFLDMID_H #include <unofldmid.h> -#endif #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/uri/XUriReferenceFactory.hpp> #include <com/sun/star/uri/XVndSunStarScriptUrl.hpp> #include <comphelper/processfactory.hxx> + using namespace ::com::sun::star; using ::rtl::OUString; + /*-------------------------------------------------------------------- Beschreibung: MacroFeldtypen --------------------------------------------------------------------*/ @@ -79,16 +78,12 @@ SwField* SwMacroField::Copy() const return new SwMacroField((SwMacroFieldType*)GetTyp(), aMacro, aText); } -String SwMacroField::GetCntnt(BOOL bName) const +String SwMacroField::GetFieldName() const { - if(bName) - { - String aStr(GetTyp()->GetName()); - aStr += ' '; - aStr += aMacro; - return aStr; - } - return Expand(); + String aStr(GetTyp()->GetName()); + aStr += ' '; + aStr += aMacro; + return aStr; } String SwMacroField::GetLibName() const diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index d0c39fbd91..c31c494575 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -62,18 +62,12 @@ // <-- #include <ftnidx.hxx> #include <viewsh.hxx> -#ifndef _UNOFLDMID_H #include <unofldmid.h> -#endif #include <SwStyleNameMapper.hxx> #include <shellres.hxx> #include <poolfmt.hxx> -#ifndef _POOLFMT_HRC #include <poolfmt.hrc> -#endif -#ifndef _COMCORE_HRC #include <comcore.hrc> -#endif #include <numrule.hxx> #include <SwNodeNum.hxx> @@ -280,11 +274,8 @@ String SwGetRefField::Expand() const } -String SwGetRefField::GetCntnt(BOOL bName) const +String SwGetRefField::GetFieldName() const { - if( !bName ) - return Expand(); - String aStr(GetTyp()->GetName()); aStr += ' '; aStr += sSetRefName; diff --git a/sw/source/core/fields/tblcalc.cxx b/sw/source/core/fields/tblcalc.cxx index 5b43ea2627..50b4ab266f 100644 --- a/sw/source/core/fields/tblcalc.cxx +++ b/sw/source/core/fields/tblcalc.cxx @@ -37,9 +37,8 @@ #include <txtfld.hxx> #include <expfld.hxx> #include <docfld.hxx> // fuer _SetGetExpFld -#ifndef _UNOFLDMID_H #include <unofldmid.h> -#endif + using namespace ::com::sun::star; using ::rtl::OUString; @@ -91,22 +90,12 @@ SwField* SwTblField::Copy() const } -String SwTblField::GetCntnt(BOOL bName) const +String SwTblField::GetFieldName() const { - if( bName ) - { - String aStr(GetTyp()->GetName()); - aStr += ' '; - - USHORT nOldSubType = nSubType; - SwTblField* pThis = (SwTblField*)this; - pThis->nSubType |= nsSwExtendedSubType::SUB_CMD; - aStr += Expand(); - pThis->nSubType = nOldSubType; - - return aStr; - } - return Expand(); + String aStr(GetTyp()->GetName()); + aStr += ' '; + aStr += const_cast<SwTblField *>(this)->GetCommand(); + return aStr; } // suche den TextNode, in dem das Feld steht @@ -127,21 +116,28 @@ const SwNode* SwTblField::GetNodeOfFormula() const return 0; } +String SwTblField::GetCommand() +{ + if (EXTRNL_NAME != GetNameType()) + { + SwNode const*const pNd = GetNodeOfFormula(); + SwTableNode const*const pTblNd = (pNd) ? pNd->FindTableNode() : 0; + if (pTblNd) + { + PtrToBoxNm( &pTblNd->GetTable() ); + } + } + return (EXTRNL_NAME == GetNameType()) + ? SwTableFormula::GetFormula() + : String(); +} String SwTblField::Expand() const { String aStr; if (nSubType & nsSwExtendedSubType::SUB_CMD) { - if( EXTRNL_NAME != GetNameType() ) - { - const SwNode* pNd = GetNodeOfFormula(); - const SwTableNode* pTblNd = pNd ? pNd->FindTableNode() : 0; - if( pTblNd ) - ((SwTblField*)this)->PtrToBoxNm( &pTblNd->GetTable() ); - } - if( EXTRNL_NAME == GetNameType() ) - aStr = SwTableFormula::GetFormula(); + aStr = const_cast<SwTblField *>(this)->GetCommand(); } else { diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx index aff0e3801d..ec771cac18 100644 --- a/sw/source/core/fields/usrfld.cxx +++ b/sw/source/core/fields/usrfld.cxx @@ -40,12 +40,12 @@ #include <doc.hxx> #include <editsh.hxx> #include <dpage.hxx> -#ifndef _UNOFLDMID_H #include <unofldmid.h> -#endif + using namespace ::com::sun::star; using ::rtl::OUString; + /*-------------------------------------------------------------------- Beschreibung: Benutzerfelder --------------------------------------------------------------------*/ @@ -72,17 +72,14 @@ SwField* SwUserField::Copy() const return pTmp; } -String SwUserField::GetCntnt(sal_Bool bName) const +String SwUserField::GetFieldName() const { - if ( bName ) - { String aStr(SwFieldType::GetTypeStr(TYP_USERFLD)); - aStr += ' '; - aStr += GetTyp()->GetName(); - aStr.AppendAscii(" = "); - aStr += ((SwUserFieldType*)GetTyp())->GetContent(); - return aStr; - } - return Expand(); + String aStr(SwFieldType::GetTypeStr(TYP_USERFLD)); + aStr += ' '; + aStr += GetTyp()->GetName(); + aStr.AppendAscii(" = "); + aStr += static_cast<SwUserFieldType*>(GetTyp())->GetContent(); + return aStr; } double SwUserField::GetValue() const diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index 19377c4e06..5bfdc29fab 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -885,9 +885,8 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames ) SwCntntNode* pCNd = GetDoc()->GetNodes().GoNext( &aNdIdx ); SwPosition aPos( aNdIdx, SwIndex( pCNd, 0 )); // #i59539: Don't remove all redline - ::PaMCorrAbs( SwNodeIndex( *pDestNd ), - SwNodeIndex( *pDestNd->EndOfSectionNode() ), - aPos ); + SwPaM const tmpPaM(*pDestNd, *pDestNd->EndOfSectionNode()); + ::PaMCorrAbs(tmpPaM, aPos); } bRet = GetDoc()->InsCopyOfTbl( aDestPos, aBoxes, &pSrcNd->GetTable(), @@ -902,7 +901,11 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames ) SwCntntNode* pCNd = GetDoc()->GetNodes().GoNext( &aNdIdx ); SwPosition aPos( aNdIdx, SwIndex( pCNd, 0 )); // #i59539: Don't remove all redline - ::PaMCorrAbs( PCURCRSR->GetPoint()->nNode, aPos ); + SwNode & rNode(PCURCRSR->GetPoint()->nNode.GetNode()); + SwCntntNode *const pCntntNode( rNode.GetCntntNode() ); + SwPaM const tmpPam(rNode, 0, + rNode, (pCntntNode) ? pCntntNode->Len() : 0); + ::PaMCorrAbs(tmpPam, aPos); } break; // aus der "while"-Schleife heraus diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index f220f409d6..7b965669ad 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -27,6 +27,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include <hintids.hxx> #include <svl/itemiter.hxx> #include <svtools/imapobj.hxx> @@ -69,10 +70,15 @@ #include <fldbas.hxx> #include <fmtfld.hxx> #include <swundo.hxx> +#include <frame.hxx> +#include <notxtfrm.hxx> // --> OD 2006-03-06 #125892# #include <HandleAnchorNodeChg.hxx> // <-- #include <frmatr.hxx> +// --> 3.7.2010 #i972# +#include <ndole.hxx> +// <-- // --> OD 2009-12-29 #i89920# #include <fmtsrnd.hxx> #include <editeng/opaqitem.hxx> @@ -1522,6 +1528,12 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference < pFly->ChgRelPos( aTmp ); } } + + SwFlyFrmFmt *pFlyFrmFmt = pFly->GetFmt(); + ASSERT( pFlyFrmFmt, "fly frame format missing!" ); + if ( pFlyFrmFmt ) + pFlyFrmFmt->SetLastFlyFrmPrtRectPos( pFly->Prt().Pos() ); //stores the value of last Prt rect + EndAllAction(); return aResult; @@ -1587,6 +1599,20 @@ const String& SwFEShell::GetFlyName() const } +const uno::Reference < embed::XEmbeddedObject > SwFEShell::GetOleRef() const +{ + uno::Reference < embed::XEmbeddedObject > xObj; + SwFlyFrm * pFly = FindFlyFrm(); + if (pFly && pFly->Lower() && pFly->Lower()->IsNoTxtFrm()) + { + SwOLENode *pNd = ((SwNoTxtFrm*)pFly->Lower())->GetNode()->GetOLENode(); + if (pNd) + xObj = pNd->GetOLEObj().GetOleRef(); + } + return xObj; +} + + String SwFEShell::GetUniqueGrfName() const { return GetDoc()->GetUniqueGrfName(); @@ -2153,4 +2179,93 @@ void SwFEShell::SetObjDescription( const String& rDescription ) } } } -// <-- + + +void SwFEShell::AlignFormulaToBaseline( const uno::Reference < embed::XEmbeddedObject >& xObj, SwFlyFrm * pFly ) +{ +#if OSL_DEBUG_LEVEL > 1 + SvGlobalName aCLSID( xObj->getClassID() ); + const bool bStarMath = ( SotExchange::IsMath( aCLSID ) != 0 ); + ASSERT( bStarMath, "AlignFormulaToBaseline should only be called for Math objects" ); + + if ( !bStarMath ) + return; +#endif + + if (!pFly) + pFly = FindFlyFrm( xObj ); + ASSERT( pFly , "No fly frame!" ); + SwFrmFmt * pFrmFmt = pFly ? pFly->GetFmt() : 0; + + // baseline to baseline alignment should only be applied to formulas anchored as char + if ( pFly && pFrmFmt && FLY_AS_CHAR == pFrmFmt->GetAnchor().GetAnchorId() ) + { + // get baseline from Math object + uno::Any aBaseline; + if( svt::EmbeddedObjectRef::TryRunningState( xObj ) ) + { + uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY ); + if ( xSet.is() ) + { + try + { + aBaseline = xSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BaseLine") ) ); + } + catch ( uno::Exception& ) + { + ASSERT( FALSE , "Baseline could not be retrieved from Starmath!" ); + } + } + } + + sal_Int32 nBaseline = ::comphelper::getINT32(aBaseline); + const MapMode aSourceMapMode( MAP_100TH_MM ); + const MapMode aTargetMapMode( MAP_TWIP ); + nBaseline = OutputDevice::LogicToLogic( nBaseline, aSourceMapMode.GetMapUnit(), aTargetMapMode.GetMapUnit() ); + + ASSERT( nBaseline > 0, "Wrong value of Baseline while retrieving from Starmath!" ); + //nBaseline must be moved by aPrt position + const SwFlyFrmFmt *pFlyFrmFmt = pFly->GetFmt(); + ASSERT( pFlyFrmFmt, "fly frame format missing!" ); + if ( pFlyFrmFmt ) + nBaseline += pFlyFrmFmt->GetLastFlyFrmPrtRectPos().Y(); + + const SwFmtVertOrient &rVert = pFrmFmt->GetVertOrient(); + SwFmtVertOrient aVert( rVert ); + aVert.SetPos( -nBaseline ); + aVert.SetVertOrient( com::sun::star::text::VertOrientation::NONE ); + + pFrmFmt->LockModify(); + pFrmFmt->SetFmtAttr( aVert ); + pFrmFmt->UnlockModify(); + pFly->InvalidatePos(); + } +} + + +void SwFEShell::AlignAllFormulasToBaseline() +{ + StartAllAction(); + + SwStartNode *pStNd; + SwNodeIndex aIdx( *GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 ); + while ( 0 != (pStNd = aIdx.GetNode().GetStartNode()) ) + { + ++aIdx; + SwOLENode *pOleNode = dynamic_cast< SwOLENode * >( &aIdx.GetNode() ); + if ( pOleNode ) + { + const uno::Reference < embed::XEmbeddedObject > & xObj( pOleNode->GetOLEObj().GetOleRef() ); + if (xObj.is()) + { + SvGlobalName aCLSID( xObj->getClassID() ); + if ( SotExchange::IsMath( aCLSID ) ) + AlignFormulaToBaseline( xObj ); + } + } + + aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 ); + } + + EndAllAction(); +} diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index af73e87a7d..87f736acd1 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -27,7 +27,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include <com/sun/star/embed/EmbedMisc.hpp> + #include "hintids.hxx" #include <svx/sdrobjectfilter.hxx> @@ -48,9 +50,9 @@ #include <svx/svdpage.hxx> #include <svx/svdpagv.hxx> -#ifndef _POOLFMT_HRC +#include <IDocumentSettingAccess.hxx> +#include <cmdid.h> #include <poolfmt.hrc> // fuer InitFldTypes -#endif #include <frmfmt.hxx> #include <frmatr.hxx> #include <fmtfsize.hxx> @@ -2573,26 +2575,32 @@ BYTE SwFEShell::IsSelObjProtected( USHORT eType ) const nChk |= ( pObj->IsMoveProtect() ? FLYPROTECT_POS : 0 ) | ( pObj->IsResizeProtect()? FLYPROTECT_SIZE : 0 ); - if( FLYPROTECT_CONTENT & eType && pObj->ISA(SwVirtFlyDrawObj) ) + if( pObj->ISA(SwVirtFlyDrawObj) ) { SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm(); - if ( pFly->GetFmt()->GetProtect().IsCntntProtected() ) + if ( (FLYPROTECT_CONTENT & eType) && pFly->GetFmt()->GetProtect().IsCntntProtected() ) nChk |= FLYPROTECT_CONTENT; if ( pFly->Lower() && pFly->Lower()->IsNoTxtFrm() ) { SwOLENode *pNd = ((SwCntntFrm*)pFly->Lower())->GetNode()->GetOLENode(); - if ( pNd ) + uno::Reference < embed::XEmbeddedObject > xObj( pNd ? pNd->GetOLEObj().GetOleRef() : 0 ); + if ( xObj.is() ) { - uno::Reference < embed::XEmbeddedObject > xObj = pNd->GetOLEObj().GetOleRef(); - // TODO/LATER: use correct aspect - if ( xObj.is() && - embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ) ) + const bool bNeverResize = (embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT )); + if ( (FLYPROTECT_CONTENT & eType) && bNeverResize ) { nChk |= FLYPROTECT_SIZE; nChk |= FLYPROTECT_FIXED; } + + // set FLYPROTECT_POS if it is a Math object anchored 'as char' and baseline alignment is activated + const bool bProtectMathPos = SotExchange::IsMath( xObj->getClassID() ) + && FLY_AS_CHAR == pFly->GetFmt()->GetAnchor().GetAnchorId() + && pDoc->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ); + if ((FLYPROTECT_POS & eType) && bProtectMathPos) + nChk |= FLYPROTECT_POS; } } } diff --git a/sw/source/core/frmedt/makefile.mk b/sw/source/core/frmedt/makefile.mk index 8b277f8994..45344a44f5 100644 --- a/sw/source/core/frmedt/makefile.mk +++ b/sw/source/core/frmedt/makefile.mk @@ -62,9 +62,9 @@ SLOFILES = $(EXCEPTIONSFILES) \ $(SLO)$/feflyole.obj \ $(SLO)$/feshview.obj \ $(SLO)$/fetab.obj \ - $(SLO)$/tblsel.obj EXCEPTIONSFILES=\ + $(SLO)$/tblsel.obj \ $(SLO)$/fecopy.obj \ $(SLO)$/fefly1.obj \ $(SLO)$/fews.obj diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index 641d97c929..0dd2e17c17 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -55,6 +55,7 @@ // OD 26.08.2003 #i18103# #include <sectfrm.hxx> #include <frmtool.hxx> +#include <deque> //siehe auch swtable.cxx #define COLFUZZY 20L @@ -152,8 +153,7 @@ struct _Sort_CellFrm : pFrm( &rCFrm ) {} }; -SV_DECL_VARARR( _Sort_CellFrms, _Sort_CellFrm, 16, 16 ) -SV_IMPL_VARARR( _Sort_CellFrms, _Sort_CellFrm ) +typedef std::deque< _Sort_CellFrm > _Sort_CellFrms; SV_IMPL_PTRARR( SwChartBoxes, SwTableBoxPtr ); SV_IMPL_PTRARR( SwChartLines, SwChartBoxes* ); @@ -616,9 +616,8 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd, rUnion.Top() <= nFrmBottom && nFrmBottom <= nUnionBottom+ nYFuzzy ) - aCellFrms.Insert( - _Sort_CellFrm( *(SwCellFrm*)pCell ), - aCellFrms.Count() ); + aCellFrms.push_back( + _Sort_CellFrm( *(SwCellFrm*)pCell) ); else { bValidChartSel = FALSE; @@ -643,12 +642,12 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd, // alle Zellen der (Teil-)Tabelle zusammen. Dann teste mal ob // all huebsch nebeneinander liegen. - USHORT n, nEnd, nCellCnt = 0; + size_t n, nCellCnt = 0; long nYPos = LONG_MAX; long nXPos = 0; long nHeight = 0; - for( n = 0, nEnd = aCellFrms.Count(); n < nEnd; ++n ) + for( n = 0 ; n < aCellFrms.size(); ++n ) { const _Sort_CellFrm& rCF = aCellFrms[ n ]; if( (rCF.pFrm->Frm().*fnRect->fnGetTop)() != nYPos ) @@ -699,7 +698,7 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd, { nYPos = LONG_MAX; SwChartBoxes* pBoxes = 0; - for( n = 0, nEnd = aCellFrms.Count(); n < nEnd; ++n ) + for( n = 0; n < aCellFrms.size(); ++n ) { const _Sort_CellFrm& rCF = aCellFrms[ n ]; if( (rCF.pFrm->Frm().*fnRect->fnGetTop)() != nYPos ) diff --git a/sw/source/core/inc/MarkManager.hxx b/sw/source/core/inc/MarkManager.hxx index c663844a9c..c2abd94431 100644 --- a/sw/source/core/inc/MarkManager.hxx +++ b/sw/source/core/inc/MarkManager.hxx @@ -39,9 +39,9 @@ namespace sw { namespace mark { public: MarkManager(/*[in/out]*/ SwDoc& rDoc); - +#if OSL_DEBUG_LEVEL > 1 void dumpFieldmarks( ) const; - +#endif // IDocumentMarkAccess virtual ::sw::mark::IMark* makeMark(const SwPaM& rPaM, const ::rtl::OUString& rName, IDocumentMarkAccess::MarkType eMark); diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx index fb479fc865..8b45aa5e2d 100644 --- a/sw/source/core/inc/cellfrm.hxx +++ b/sw/source/core/inc/cellfrm.hxx @@ -24,8 +24,8 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _CELLFRM_HXX -#define _CELLFRM_HXX +#ifndef SW_CELLFRM_HXX +#define SW_CELLFRM_HXX #include <tools/mempool.hxx> @@ -48,7 +48,8 @@ public: virtual BOOL GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const; virtual void Modify( SfxPoolItem*, SfxPoolItem* ); - virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; + virtual void Paint( SwRect const&, + SwPrintData const*const pPrintData = NULL ) const; virtual void CheckDirection( BOOL bVert ); // --> OD 2010-02-17 #i103961# diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx index 1ea99ac067..2dcfcf614f 100644 --- a/sw/source/core/inc/flyfrm.hxx +++ b/sw/source/core/inc/flyfrm.hxx @@ -24,13 +24,13 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _FLYFRM_HXX -#define _FLYFRM_HXX +#ifndef SW_FLYFRM_HXX +#define SW_FLYFRM_HXX #include "layfrm.hxx" +#include "frmfmt.hxx" class SwPageFrm; -class SwFlyFrmFmt; class SwFmtFrmSize; struct SwCrsrMoveState; class SwBorderAttrs; @@ -158,7 +158,8 @@ public: virtual void Modify( SfxPoolItem*, SfxPoolItem* ); // erfrage vom Client Informationen virtual BOOL GetInfo( SfxPoolItem& ) const; - virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; + virtual void Paint( SwRect const&, + SwPrintData const*const pPrintData = NULL ) const; virtual Size ChgSize( const Size& aNewSize ); virtual BOOL GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const; @@ -283,5 +284,11 @@ public: @author OD */ virtual bool IsFormatPossible() const; + + // overwriting "SwFrmFmt *SwLayoutFrm::GetFmt" to provide the correct derived return type. + // (This is in order to skip on the otherwise necessary casting of the result to + // 'SwFlyFrmFmt *' after calls to this function. The casting is now done in this function.) + virtual const SwFlyFrmFmt *GetFmt() const; + virtual SwFlyFrmFmt *GetFmt(); }; #endif diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index 6d61b3ab08..5707183769 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -24,8 +24,9 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _FRAME_HXX -#define _FRAME_HXX +#ifndef SW_FRAME_HXX +#define SW_FRAME_HXX + #include <svl/svarray.hxx> #include "swtypes.hxx" // fuer SwTwips #include "swrect.hxx" @@ -53,7 +54,7 @@ class SvxBrushItem; class SwSelectionList; struct SwPosition; struct SwCrsrMoveState; -class SwPrtOptions; +class SwPrintData; // --> OD 2004-07-06 #i28701# class SwSortedObjs; @@ -822,7 +823,8 @@ public: SwCrsrMoveState* = 0 ) const; virtual BOOL GetCharRect( SwRect &, const SwPosition&, SwCrsrMoveState* = 0 ) const; - virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; + virtual void Paint( SwRect const&, + SwPrintData const*const pPrintData = NULL ) const; // der "kurze Dienstweg" zwischen den Frames und der Formatierung. // Wer den void* falsch Casted ist selbst schuld! diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx index 9ade91ac84..d827a71f95 100644 --- a/sw/source/core/inc/layfrm.hxx +++ b/sw/source/core/inc/layfrm.hxx @@ -24,8 +24,8 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _LAYFRM_HXX -#define _LAYFRM_HXX +#ifndef SW_LAYFRM_HXX +#define SW_LAYFRM_HXX #include "frame.hxx" @@ -105,7 +105,8 @@ public: SwLayoutFrm( SwFrmFmt* ); ~SwLayoutFrm(); - virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; + virtual void Paint( SwRect const&, + SwPrintData const*const pPrintData = NULL ) const; const SwFrm *Lower() const { return pLower; } SwFrm *Lower() { return pLower; } const SwCntntFrm *ContainsCntnt() const; @@ -123,9 +124,9 @@ public: // <-- BOOL IsAnLower( const SwFrm * ) const; - const SwFrmFmt *GetFmt() const { return (const SwFrmFmt*)GetDep(); } - SwFrmFmt *GetFmt() { return (SwFrmFmt*)GetDep(); } - void SetFrmFmt( SwFrmFmt* ); + virtual const SwFrmFmt *GetFmt() const; + virtual SwFrmFmt *GetFmt(); + void SetFrmFmt( SwFrmFmt* ); //Verschieben der Ftns aller Lower - ab dem StartCntnt. //TRUE wenn mindestens eine Ftn verschoben wurde. @@ -206,4 +207,4 @@ inline SwFrm* SwLayoutFrm::GetLastLower() return const_cast<SwFrm*>(static_cast<const SwLayoutFrm*>(this)->GetLastLower()); } -#endif //_LAYFRM_HXX +#endif // SW_LAYFRM_HXX diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx index 0f821849cb..25e9a6fe6a 100644 --- a/sw/source/core/inc/mvsave.hxx +++ b/sw/source/core/inc/mvsave.hxx @@ -24,14 +24,11 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _MVSAVE_HXX -#define _MVSAVE_HXX - +#ifndef SW_MVSAVE_HXX +#define SW_MVSAVE_HXX #include <tools/string.hxx> -#ifndef _KEYCOD_HXX //autogen #include <vcl/keycod.hxx> -#endif #include <svl/svarray.hxx> #include <IDocumentMarkAccess.hxx> #include <vector> @@ -150,25 +147,10 @@ public: // Crsr verschieben kann // die Funktionen rufen nicht die SwDoc::Corr - Methoden! - // Setzt alle PaMs an OldPos auf NewPos + Offset -void PaMCorrAbs( const SwPosition &rOldPos, - const SwPosition &rNewPos, - const xub_StrLen nOffset = 0 ); - - // Setzt alle PaMs in OldNode auf NewPos + Offset -void PaMCorrAbs( const SwNodeIndex &rOldNode, - const SwPosition &rNewPos, - const xub_StrLen nOffset = 0 ); - // Setzt alle PaMs im Bereich vom Range nach NewPos void PaMCorrAbs( const SwPaM& rRange, const SwPosition& rNewPos ); - // Setzt alle PaMs im Bereich von [StartNode, EndNode] nach NewPos -void PaMCorrAbs( const SwNodeIndex &rStartNode, - const SwNodeIndex &rEndNode, - const SwPosition &rNewPos ); - // Setzt alle PaMs in OldNode auf relative Pos void PaMCorrRel( const SwNodeIndex &rOldNode, const SwPosition &rNewPos, @@ -227,5 +209,5 @@ public: }; -#endif // _MVSAVE_HXX +#endif // SW_MVSAVE_HXX diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx index 0da68a3a53..ec18c44050 100644 --- a/sw/source/core/inc/notxtfrm.hxx +++ b/sw/source/core/inc/notxtfrm.hxx @@ -24,8 +24,8 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _NOTXTFRM_HXX -#define _NOTXTFRM_HXX +#ifndef SW_NOTXTFRM_HXX +#define SW_NOTXTFRM_HXX #include <cntfrm.hxx> @@ -56,7 +56,8 @@ public: ~SwNoTxtFrm(); virtual void Modify( SfxPoolItem*, SfxPoolItem* ); - virtual void Paint(const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; + virtual void Paint( SwRect const&, + SwPrintData const*const pPrintData = NULL ) const; virtual BOOL GetCharRect( SwRect &, const SwPosition&, SwCrsrMoveState* = 0) const; BOOL GetCrsrOfst(SwPosition* pPos, Point& aPoint, diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx index 5de7604ae7..50dbd394b4 100644 --- a/sw/source/core/inc/rootfrm.hxx +++ b/sw/source/core/inc/rootfrm.hxx @@ -24,8 +24,9 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _ROOTFRM_HXX -#define _ROOTFRM_HXX +#ifndef SW_ROOTFRM_HXX +#define SW_ROOTFRM_HXX + #include "layfrm.hxx" class SwCntntFrm; @@ -197,7 +198,8 @@ public: virtual BOOL GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const; - virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; + virtual void Paint( SwRect const&, + SwPrintData const*const pPrintData = NULL ) const; virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ); virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ); #ifdef DBG_UTIL @@ -365,5 +367,5 @@ inline void SwRootFrm::SetVirtPageNum( const BOOL bOf) const ((SwRootFrm*)this)->bIsVirtPageNum = bOf; } -#endif //_ROOTFRM_HXX +#endif // SW_ROOTFRM_HXX diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx index efeb702ad9..910385285d 100644 --- a/sw/source/core/inc/scriptinfo.hxx +++ b/sw/source/core/inc/scriptinfo.hxx @@ -139,24 +139,24 @@ public: inline BYTE GetDefaultDir() const { return nDefaultDir; }; // array operations, nCnt refers to array position - inline USHORT CountScriptChg() const; - inline xub_StrLen GetScriptChg( const USHORT nCnt ) const; + inline size_t CountScriptChg() const; + inline xub_StrLen GetScriptChg( const size_t nCnt ) const; inline BYTE GetScriptType( const USHORT nCnt ) const; - inline USHORT CountDirChg() const; - inline xub_StrLen GetDirChg( const USHORT nCnt ) const; - inline BYTE GetDirType( const USHORT nCnt ) const; + inline size_t CountDirChg() const; + inline xub_StrLen GetDirChg( const size_t nCnt ) const; + inline BYTE GetDirType( const size_t nCnt ) const; - inline USHORT CountKashida() const; - inline xub_StrLen GetKashida( const USHORT nCnt ) const; + inline size_t CountKashida() const; + inline xub_StrLen GetKashida( const size_t nCnt ) const; - inline USHORT CountCompChg() const; - inline xub_StrLen GetCompStart( const USHORT nCnt ) const; - inline xub_StrLen GetCompLen( const USHORT nCnt ) const; - inline BYTE GetCompType( const USHORT nCnt ) const; + inline size_t CountCompChg() const; + inline xub_StrLen GetCompStart( const size_t nCnt ) const; + inline xub_StrLen GetCompLen( const size_t nCnt ) const; + inline BYTE GetCompType( const size_t nCnt ) const; - inline USHORT CountHiddenChg() const; - inline xub_StrLen GetHiddenChg( const USHORT nCnt ) const; + inline size_t CountHiddenChg() const; + inline xub_StrLen GetHiddenChg( const size_t nCnt ) const; static void CalcHiddenRanges( const SwTxtNode& rNode, MultiSelection& rHiddenMulti ); @@ -356,59 +356,59 @@ inline void SwScriptInfo::SetInvalidity( const xub_StrLen nPos ) if ( nPos < nInvalidityPos ) nInvalidityPos = nPos; }; -inline USHORT SwScriptInfo::CountScriptChg() const { return aScriptChg.Count(); } -inline xub_StrLen SwScriptInfo::GetScriptChg( const USHORT nCnt ) const +inline size_t SwScriptInfo::CountScriptChg() const { return aScriptChg.size(); } +inline xub_StrLen SwScriptInfo::GetScriptChg( const size_t nCnt ) const { - ASSERT( nCnt < aScriptChg.Count(),"No ScriptChange today!"); + ASSERT( nCnt < aScriptChg.size(),"No ScriptChange today!"); return aScriptChg[ nCnt ]; } inline BYTE SwScriptInfo::GetScriptType( const xub_StrLen nCnt ) const { - ASSERT( nCnt < aScriptChg.Count(),"No ScriptType today!"); + ASSERT( nCnt < aScriptType.size(),"No ScriptType today!"); return aScriptType[ nCnt ]; } -inline USHORT SwScriptInfo::CountDirChg() const { return aDirChg.Count(); } -inline xub_StrLen SwScriptInfo::GetDirChg( const USHORT nCnt ) const +inline size_t SwScriptInfo::CountDirChg() const { return aDirChg.size(); } +inline xub_StrLen SwScriptInfo::GetDirChg( const size_t nCnt ) const { - ASSERT( nCnt < aDirChg.Count(),"No DirChange today!"); + ASSERT( nCnt < aDirChg.size(),"No DirChange today!"); return aDirChg[ nCnt ]; } -inline BYTE SwScriptInfo::GetDirType( const xub_StrLen nCnt ) const +inline BYTE SwScriptInfo::GetDirType( const size_t nCnt ) const { - ASSERT( nCnt < aDirChg.Count(),"No DirType today!"); + ASSERT( nCnt < aDirType.size(),"No DirType today!"); return aDirType[ nCnt ]; } -inline USHORT SwScriptInfo::CountKashida() const { return aKashida.Count(); } -inline xub_StrLen SwScriptInfo::GetKashida( const USHORT nCnt ) const +inline size_t SwScriptInfo::CountKashida() const { return aKashida.size(); } +inline xub_StrLen SwScriptInfo::GetKashida( const size_t nCnt ) const { - ASSERT( nCnt < aKashida.Count(),"No Kashidas today!"); + ASSERT( nCnt < aKashida.size(),"No Kashidas today!"); return aKashida[ nCnt ]; } -inline USHORT SwScriptInfo::CountCompChg() const { return aCompChg.Count(); }; -inline xub_StrLen SwScriptInfo::GetCompStart( const USHORT nCnt ) const +inline size_t SwScriptInfo::CountCompChg() const { return aCompChg.size(); }; +inline xub_StrLen SwScriptInfo::GetCompStart( const size_t nCnt ) const { - ASSERT( nCnt < aCompChg.Count(),"No CompressionStart today!"); + ASSERT( nCnt < aCompChg.size(),"No CompressionStart today!"); return aCompChg[ nCnt ]; } -inline xub_StrLen SwScriptInfo::GetCompLen( const USHORT nCnt ) const +inline xub_StrLen SwScriptInfo::GetCompLen( const size_t nCnt ) const { - ASSERT( nCnt < aCompChg.Count(),"No CompressionLen today!"); + ASSERT( nCnt < aCompLen.size(),"No CompressionLen today!"); return aCompLen[ nCnt ]; } -inline BYTE SwScriptInfo::GetCompType( const USHORT nCnt ) const +inline BYTE SwScriptInfo::GetCompType( const size_t nCnt ) const { - ASSERT( nCnt < aCompChg.Count(),"No CompressionType today!"); + ASSERT( nCnt < aCompType.size(),"No CompressionType today!"); return aCompType[ nCnt ]; } -inline USHORT SwScriptInfo::CountHiddenChg() const { return aHiddenChg.Count(); }; -inline xub_StrLen SwScriptInfo::GetHiddenChg( const USHORT nCnt ) const +inline size_t SwScriptInfo::CountHiddenChg() const { return aHiddenChg.size(); }; +inline xub_StrLen SwScriptInfo::GetHiddenChg( const size_t nCnt ) const { - ASSERT( nCnt < aHiddenChg.Count(),"No HiddenChg today!"); + ASSERT( nCnt < aHiddenChg.size(),"No HiddenChg today!"); return aHiddenChg[ nCnt ]; } diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx index 0383152d00..787b5fba8c 100644 --- a/sw/source/core/inc/tabfrm.hxx +++ b/sw/source/core/inc/tabfrm.hxx @@ -24,8 +24,8 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _TABFRM_HXX -#define _TABFRM_HXX +#ifndef SW_TABFRM_HXX +#define SW_TABFRM_HXX #include <tools/mempool.hxx> #include "layfrm.hxx" @@ -129,7 +129,8 @@ public: virtual void Modify( SfxPoolItem*, SfxPoolItem* ); virtual BOOL GetInfo( SfxPoolItem &rHnt ) const; - virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; + virtual void Paint( SwRect const&, + SwPrintData const*const pPrintData = NULL ) const; virtual void CheckDirection( BOOL bVert ); virtual void Cut(); @@ -230,4 +231,4 @@ inline SwTabFrm *SwTabFrm::GetFollow() return (SwTabFrm*)SwFlowFrm::GetFollow(); } -#endif //_TABFRM_HXX +#endif // SW_TABFRM_HXX diff --git a/sw/source/core/inc/txmsrt.hxx b/sw/source/core/inc/txmsrt.hxx index ca494527fc..3a11e267db 100644 --- a/sw/source/core/inc/txmsrt.hxx +++ b/sw/source/core/inc/txmsrt.hxx @@ -24,8 +24,8 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _TXMSRT_HXX -#define _TXMSRT_HXX +#ifndef SW_TXMSRT_HXX +#define SW_TXMSRT_HXX #include <i18npool/lang.h> #include <tox.hxx> @@ -154,7 +154,7 @@ private: String sSortTxt; String sSortTxtReading; - virtual void _GetText( String&, String& ) = 0; + virtual void GetText_Impl( String&, String& ) const = 0; }; inline void SwTOXSortTabBase::GetTxt( String& rSortTxt, @@ -163,7 +163,7 @@ inline void SwTOXSortTabBase::GetTxt( String& rSortTxt, if( !bValidTxt ) { SwTOXSortTabBase* pThis = (SwTOXSortTabBase*)this; - pThis->_GetText( pThis->sSortTxt, pThis->sSortTxtReading ); + pThis->GetText_Impl( pThis->sSortTxt, pThis->sSortTxtReading ); pThis->bValidTxt = TRUE; } @@ -194,7 +194,7 @@ struct SwTOXIndex : public SwTOXSortTabBase virtual BOOL operator<( const SwTOXSortTabBase& ); private: - virtual void _GetText( String&, String& ); + virtual void GetText_Impl( String&, String& ) const; BYTE nKeyLevel; }; @@ -211,7 +211,7 @@ struct SwTOXCustom : public SwTOXSortTabBase virtual BOOL operator<( const SwTOXSortTabBase& ); private: - virtual void _GetText( String&, String& ); + virtual void GetText_Impl( String&, String& ) const; String aKey; String sReading; @@ -231,7 +231,7 @@ struct SwTOXContent : public SwTOXSortTabBase virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT nAuthField = 0 ) const; virtual USHORT GetLevel() const; private: - virtual void _GetText( String&, String& ); + virtual void GetText_Impl( String&, String& ) const; }; @@ -248,7 +248,7 @@ struct SwTOXPara : public SwTOXSortTabBase virtual String GetURL() const; private: - virtual void _GetText( String&, String& ); + virtual void GetText_Impl( String&, String& ) const; SwTOXElement eType; USHORT m_nLevel; @@ -267,7 +267,7 @@ struct SwTOXTable : public SwTOXSortTabBase virtual String GetURL() const; private: - virtual void _GetText( String&, String& ); + virtual void GetText_Impl( String&, String& ) const; USHORT nLevel; }; @@ -277,7 +277,7 @@ struct SwTOXAuthority : public SwTOXSortTabBase private: SwFmtFld& m_rField; virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT nAuthField = 0 ) const; - virtual void _GetText( String&, String& ); + virtual void GetText_Impl( String&, String& ) const; public: SwTOXAuthority( const SwCntntNode& rNd, SwFmtFld& rField, const SwTOXInternational& rIntl ); @@ -291,4 +291,4 @@ public: }; -#endif // _TXMSRT_HXX +#endif // SW_TXMSRT_HXX diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index bdaadecf64..9dc3ece46a 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -24,8 +24,9 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _TXTFRM_HXX -#define _TXTFRM_HXX +#ifndef SW_TXTFRM_HXX +#define SW_TXTFRM_HXX + #include <tools/mempool.hxx> #include <tools/string.hxx> #include "cntfrm.hxx" @@ -292,7 +293,8 @@ public: void PaintExtraData( const SwRect & rRect ) const; //Seitennummer usw. SwRect Paint(); - virtual void Paint( const SwRect &, const SwPrtOptions *pPrintData = NULL ) const; + virtual void Paint( SwRect const&, + SwPrintData const*const pPrintData = NULL ) const; virtual void Modify( SfxPoolItem*, SfxPoolItem* ); virtual sal_Bool GetInfo( SfxPoolItem & ) const; diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx index 7b4a87a53b..6387bde937 100644 --- a/sw/source/core/inc/viewimp.hxx +++ b/sw/source/core/inc/viewimp.hxx @@ -24,8 +24,10 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _VIEWIMP_HXX -#define _VIEWIMP_HXX +#ifndef SW_VIEWIMP_HXX +#define SW_VIEWIMP_HXX + +#include <vector> #include <vcl/timer.hxx> #include <tools/color.hxx> @@ -53,10 +55,9 @@ struct SdrPaintProcRec; class SwAccessibleMap; class SdrObject; class Fraction; -class SwPrtOptions; +class SwPrintData; class SwPagePreviewLayout; struct PrevwPage; -#include <vector> class SwTxtFrm; class SwViewImp @@ -215,7 +216,7 @@ public: // and <heaven>. // OD 25.06.2003 #108784# - correct type of 1st parameter void PaintLayer( const SdrLayerID _nLayerID, - const SwPrtOptions *pPrintData, + SwPrintData const*const pPrintData, const SwRect& _rRect, const Color* _pPageBackgrdColor = 0, const bool _bIsPageRightToLeft = false ) const; @@ -360,5 +361,5 @@ inline void SwViewImp::AddAccessibleObj( const SdrObject *pObj ) SwRect aEmptyRect; MoveAccessible( 0, pObj, aEmptyRect ); } -#endif //_VIEWIMP_HXX +#endif // SW_VIEWIMP_HXX diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 28d3a9b307..318beefcd6 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -1004,10 +1004,11 @@ BOOL SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs ) SwAnchoredObject* pObj = (*GetDrawObjs())[i]; const SwFrmFmt& rFmt = pObj->GetFrmFmt(); const BOOL bFly = pObj->ISA(SwFlyFrm); - if ( bFly && - WEIT_WECH == pObj->GetObjRect().Width()|| - rFmt.GetFrmSize().GetWidthPercent() ) + if ((bFly && (WEIT_WECH == pObj->GetObjRect().Width())) + || rFmt.GetFrmSize().GetWidthPercent()) + { continue; + } if ( FLY_AS_CHAR == rFmt.GetAnchor().GetAnchorId() ) { diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 7b09b9983e..58efef39b4 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -1273,6 +1273,7 @@ void SwFlyFrm::ChgRelPos( const Point &rNewPos ) aHori.SetPos( nTmpX ); aSet.Put( aHori ); } + SetCurrRelPos( rNewPos ); pFmt->GetDoc()->SetAttr( aSet, *pFmt ); } } @@ -2851,3 +2852,14 @@ bool SwFlyFrm::IsFormatPossible() const return SwAnchoredObject::IsFormatPossible() && !IsLocked() && !IsColLocked(); } + +const SwFlyFrmFmt * SwFlyFrm::GetFmt() const +{ + return static_cast< const SwFlyFrmFmt * >( GetDep() ); +} + +SwFlyFrmFmt * SwFlyFrm::GetFmt() +{ + return static_cast< SwFlyFrmFmt * >( GetDep() ); +} + diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx index 7956827165..e6a9c1472e 100644 --- a/sw/source/core/layout/flyincnt.cxx +++ b/sw/source/core/layout/flyincnt.cxx @@ -358,3 +358,4 @@ void SwFlyInCntFrm::MakeAll() } Unlock(); } + diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index b525043dc3..471cf61cd3 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1738,7 +1738,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx, // die in den Fussnoten liegen, nicht etwa die (spaltigen) Bereiche, // in denen die Fussnoten(Container) liegen. // #109767# Table frame is in section, insert section in cell frame. - if( pSct && ( pFtnFrm && !pSct->IsInFtn() ) || pUpper->IsCellFrm() ) + if( pSct && ((pFtnFrm && !pSct->IsInFtn()) || pUpper->IsCellFrm()) ) pSct = NULL; if( pSct ) { // damit der SectionFrm nicht zerstoert wird durch pTmp->MoveFwd() diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 2d1291a7b2..73e7032cf6 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -2430,7 +2430,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) : #endif bVis = ((SwCrsrShell*)pSh)->GetCharRect().IsOver(pSh->VisArea()); } - aBools.Insert( bVis, aBools.Count() ); + aBools.push_back( bVis ); pSh = (ViewShell*)pSh->GetNext(); } while ( pSh != pImp->GetShell() ); diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index 58bd439634..b0148cb96d 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -102,7 +102,7 @@ void SwLayCacheImpl::Insert( USHORT nType, ULONG nIndex, xub_StrLen nOffset ) { aType.Insert( nType, aType.Count() ); SvULongs::Insert( nIndex, SvULongs::Count() ); - aOffset.Insert( nOffset, aOffset.Count() ); + aOffset.push_back( nOffset ); } BOOL SwLayCacheImpl::Read( SvStream& rStream ) @@ -1238,12 +1238,12 @@ SwLayCacheIoImpl::SwLayCacheIoImpl( SvStream& rStrm, BOOL bWrtMd ) : BOOL SwLayCacheIoImpl::OpenRec( BYTE cType ) { BOOL bRes = TRUE; - UINT16 nLvl = aRecTypes.Count(); + size_t nLvl = aRecTypes.size(); ASSERT( nLvl == aRecSizes.Count(), "OpenRec: Level" ); UINT32 nPos = pStream->Tell(); if( bWriteMode ) { - aRecTypes.Insert( cType, nLvl ); + aRecTypes.push_back( cType ); aRecSizes.Insert( nPos, nLvl ); *pStream << (UINT32) 0; } @@ -1252,7 +1252,7 @@ BOOL SwLayCacheIoImpl::OpenRec( BYTE cType ) UINT32 nVal; *pStream >> nVal; BYTE cRecTyp = (BYTE)nVal; - aRecTypes.Insert( cRecTyp, nLvl ); + aRecTypes.push_back( cRecTyp ); sal_uInt32 nSize = nVal >> 8; aRecSizes.Insert( nPos + nSize, nLvl ); if( !nVal || cRecTyp != cType || @@ -1261,7 +1261,7 @@ BOOL SwLayCacheIoImpl::OpenRec( BYTE cType ) ASSERT( nVal, "OpenRec: Record-Header is 0" ); ASSERT( cRecTyp == cType, "OpenRec: Wrong Record Type" ); - aRecTypes[nLvl] = 0; + aRecTypes.back() = 0; aRecSizes[nLvl] = pStream->Tell(); bRes = sal_False; bError = TRUE; @@ -1275,7 +1275,7 @@ BOOL SwLayCacheIoImpl::OpenRec( BYTE cType ) BOOL SwLayCacheIoImpl::CloseRec( BYTE ) { BOOL bRes = TRUE; - UINT16 nLvl = aRecTypes.Count(); + size_t nLvl = aRecTypes.size(); ASSERT( nLvl == aRecSizes.Count(), "CloseRec: wrong Level" ); ASSERT( nLvl, "CloseRec: no levels" ); if( nLvl ) @@ -1287,7 +1287,7 @@ BOOL SwLayCacheIoImpl::CloseRec( BYTE ) UINT32 nBgn = aRecSizes[nLvl]; pStream->Seek( nBgn ); UINT32 nSize = nPos - nBgn; - UINT32 nVal = ( nSize << 8 ) | aRecTypes[nLvl]; + UINT32 nVal = ( nSize << 8 ) | aRecTypes.back(); *pStream << nVal; pStream->Seek( nPos ); if( pStream->GetError() != SVSTREAM_OK ) @@ -1307,7 +1307,7 @@ BOOL SwLayCacheIoImpl::CloseRec( BYTE ) bRes = FALSE; } - aRecTypes.Remove( nLvl, 1 ); + aRecTypes.pop_back(); aRecSizes.Remove( nLvl, 1 ); } diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx index 5965d0b9ab..fe4290322d 100644 --- a/sw/source/core/layout/layhelp.hxx +++ b/sw/source/core/layout/layhelp.hxx @@ -71,11 +71,11 @@ class SwLayCacheImpl : public SvULongs void Insert( USHORT nType, ULONG nIndex, xub_StrLen nOffset ); public: - SwLayCacheImpl() : SvULongs( 20, 10 ), aOffset( 20, 10 ), aType( 20, 10 ) {} + SwLayCacheImpl() : SvULongs( 20, 10 ), aType( 20, 10 ) {} BOOL Read( SvStream& rStream ); ULONG GetBreakIndex( USHORT nIdx ) const { return GetObject( nIdx ); } - xub_StrLen GetBreakOfst( USHORT nIdx ) const { return aOffset[ nIdx ]; } + xub_StrLen GetBreakOfst( size_t nIdx ) const { return aOffset[ nIdx ]; } USHORT GetBreakType( USHORT nIdx ) const { return aType[ nIdx ]; } USHORT GetFlyCount() const { return aFlyCache.Count(); } diff --git a/sw/source/core/layout/makefile.mk b/sw/source/core/layout/makefile.mk index 7019203aa2..076069b513 100644 --- a/sw/source/core/layout/makefile.mk +++ b/sw/source/core/layout/makefile.mk @@ -49,6 +49,7 @@ CDEFS+=-DDEBUG EXCEPTIONSFILES = \ $(SLO)$/anchoreddrawobject.obj \ $(SLO)$/flycnt.obj \ + $(SLO)$/layact.obj \ $(SLO)$/laycache.obj \ $(SLO)$/layouter.obj \ $(SLO)$/movedfwdfrmsbyobjpos.obj \ diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 8ced3ab17a..f58388cc31 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -1827,10 +1827,11 @@ void SwRootFrm::ImplCalcBrowseWidth() SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i]; const SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt(); const BOOL bFly = pAnchoredObj->ISA(SwFlyFrm); - if ( bFly && - WEIT_WECH == pAnchoredObj->GetObjRect().Width()|| - rFmt.GetFrmSize().GetWidthPercent() ) + if ((bFly && (WEIT_WECH == pAnchoredObj->GetObjRect().Width())) + || rFmt.GetFrmSize().GetWidthPercent()) + { continue; + } long nWidth = 0; switch ( rFmt.GetAnchor().GetAnchorId() ) diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 3c6d08242b..886fafedc8 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -30,12 +30,7 @@ #include <com/sun/star/text/HoriOrientation.hpp> - -#include <hintids.hxx> - -#ifndef _SOUND_HXX //autogen #include <vcl/sound.hxx> -#endif #include <tools/poly.hxx> #define _SVSTDARR_LONGS #include <svl/svstdarr.hxx> @@ -49,19 +44,15 @@ // --> collapsing borders FME 2005-05-27 #i29550# #include <svx/framelink.hxx> // <-- -#ifndef _GRAPH_HXX //autogen #include <vcl/graph.hxx> -#endif #include <svx/svdpagv.hxx> -#include <tgrditem.hxx> - +#include <hintids.hxx> +#include <tgrditem.hxx> #include <fmtsrnd.hxx> #include <fmtclds.hxx> #include <tools/shl.hxx> -#ifndef _COMCORE_HRC #include <comcore.hrc> -#endif #include <swmodule.hxx> #include <rootfrm.hxx> #include <pagefrm.hxx> @@ -89,15 +80,11 @@ #include <ptqueue.hxx> #include <noteurl.hxx> #include <virtoutp.hxx> -#ifndef _LINEINFO_HXX #include <lineinfo.hxx> -#endif #include <dbg_lay.hxx> #include <accessibilityoptions.hxx> // OD 20.12.2002 #94627# -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif // OD 28.02.2003 #b4779636#, #107692# #include <swtable.hxx> // OD 02.07.2003 #108784# @@ -2735,7 +2722,8 @@ void SwTabFrmPainter::Insert( SwLineEntry& rNew, bool bHori ) |* |*************************************************************************/ -void SwRootFrm::Paint( const SwRect& rRect, const SwPrtOptions *pPrintData ) const +void +SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const { ASSERT( Lower() && Lower()->IsPageFrm(), "Lower der Root keine Seite." ); @@ -3185,7 +3173,7 @@ SwShortCut::SwShortCut( const SwFrm& rFrm, const SwRect& rRect ) } } -void SwLayoutFrm::Paint( const SwRect& rRect, const SwPrtOptions* /* pPrintData */ ) const +void SwLayoutFrm::Paint(SwRect const& rRect, SwPrintData const*const) const { ViewShell *pSh = GetShell(); @@ -3473,7 +3461,7 @@ BOOL SwFlyFrm::IsPaint( SdrObject *pObj, const ViewShell *pSh ) /************************************************************************* |* SwCellFrm::Paint( const SwRect& ) const |*************************************************************************/ -void SwCellFrm::Paint( const SwRect& rRect, const SwPrtOptions* /* pPrintData */ ) const +void SwCellFrm::Paint(SwRect const& rRect, SwPrintData const*const) const { if ( GetLayoutRowSpan() >= 1 ) SwLayoutFrm::Paint( rRect ); @@ -3492,7 +3480,7 @@ void SwCellFrm::Paint( const SwRect& rRect, const SwPrtOptions* /* pPrintData */ void MA_FASTCALL lcl_PaintLowerBorders( const SwLayoutFrm *pLay, const SwRect &rRect, const SwPageFrm *pPage ); -void SwFlyFrm::Paint( const SwRect& rRect, const SwPrtOptions* /* pPrintData */ ) const +void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const { //wegen der Ueberlappung von Rahmen und Zeichenobjekten muessen die //Flys ihre Umrandung (und die der Innenliegenden) direkt ausgeben. @@ -3727,7 +3715,7 @@ void SwFlyFrm::Paint( const SwRect& rRect, const SwPrtOptions* /* pPrintData */ |* |*************************************************************************/ -void SwTabFrm::Paint( const SwRect& rRect, const SwPrtOptions* /* pPrintData */ ) const +void SwTabFrm::Paint(SwRect const& rRect, SwPrintData const*const) const { if ( pGlobalShell->GetViewOptions()->IsTable() ) { diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index b9a6365435..2f0bb91e7b 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -414,6 +414,19 @@ SwFrm::~SwFrm() #endif } +/*************************************************************************/ + +const SwFrmFmt * SwLayoutFrm::GetFmt() const +{ + return static_cast< const SwFlyFrmFmt * >( GetDep() ); +} + +SwFrmFmt * SwLayoutFrm::GetFmt() +{ + return static_cast< SwFlyFrmFmt * >( GetDep() ); +} + + /************************************************************************* |* |* SwLayoutFrm::SetFrmFmt() diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 380a6bfba2..5ff8118f11 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -1811,10 +1811,10 @@ USHORT SwFrm::GetVirtPageNum() const const SwFrm *pFrm = 0; const SfxItemPool &rPool = pPage->GetFmt()->GetDoc()->GetAttrPool(); const SfxPoolItem* pItem; - USHORT nMaxItems = rPool.GetItemCount( RES_PAGEDESC ); - for( USHORT n = 0; n < nMaxItems; ++n ) + sal_uInt32 nMaxItems = rPool.GetItemCount2( RES_PAGEDESC ); + for( sal_uInt32 n = 0; n < nMaxItems; ++n ) { - if( 0 == (pItem = rPool.GetItem( RES_PAGEDESC, n ) )) + if( 0 == (pItem = rPool.GetItem2( RES_PAGEDESC, n ) )) continue; const SwFmtPageDesc *pDesc = (SwFmtPageDesc*)pItem; diff --git a/sw/source/core/layout/unusedf.cxx b/sw/source/core/layout/unusedf.cxx index 1c5d00a744..a3dd5eda4c 100644 --- a/sw/source/core/layout/unusedf.cxx +++ b/sw/source/core/layout/unusedf.cxx @@ -28,8 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - #include "rootfrm.hxx" #include "cntfrm.hxx" #include "flyfrm.hxx" @@ -41,7 +39,7 @@ void SwFrm::Format( const SwBorderAttrs * ) ASSERT( FALSE, "Format() der Basisklasse gerufen." ); } -void SwFrm::Paint(const SwRect &, const SwPrtOptions * ) const +void SwFrm::Paint(SwRect const&, SwPrintData const*const) const { ASSERT( FALSE, "Paint() der Basisklasse gerufen." ); } diff --git a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx index f8b2db9b55..6d42785291 100644 --- a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx @@ -455,3 +455,4 @@ sal_uInt8 SwAsCharAnchoredObjectPosition::GetLineAlignment() const { return mnLineAlignment; } + diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index a901d3c7c7..479842ce5a 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -781,7 +781,7 @@ BOOL SwOLEObj::IsOleRef() const return xOLERef.is(); } -uno::Reference < embed::XEmbeddedObject > SwOLEObj::GetOleRef() +const uno::Reference < embed::XEmbeddedObject > SwOLEObj::GetOleRef() { if( !xOLERef.is() ) { @@ -1016,3 +1016,4 @@ void SwOLELRUCache::RemoveObj( SwOLEObj& rObj ) if( !Count() ) DELETEZ( pOLELRU_Cache ); } + diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index e8fc5b382b..142c53450a 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -38,12 +38,8 @@ #include <tgrditem.hxx> #include <paratr.hxx> -#ifndef _FMTLINE_HXX #include <fmtline.hxx> -#endif -#ifndef _LINEINFO_HXX #include <lineinfo.hxx> -#endif #include <charfmt.hxx> #include <pagefrm.hxx> #include <viewsh.hxx> // ViewShell @@ -596,7 +592,7 @@ sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const * SwTxtFrm::Paint() *************************************************************************/ -void SwTxtFrm::Paint( const SwRect &rRect, const SwPrtOptions * /*pPrintData*/ ) const +void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const { ResetRepaint(); diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index 5afacc5130..c335380347 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -779,7 +779,7 @@ void SwTxtNode::GetMinMaxSize( ULONG nIndex, ULONG& rMin, ULONG &rMax, case RES_TXTATR_FIELD : { SwField *pFld = (SwField*)pHint->GetFld().GetFld(); - const String aTxt = pFld->GetCntnt( FALSE ); + const String aTxt = pFld->ExpandField(true); if( lcl_MinMaxString( aArg, aIter.GetFnt(), aTxt, 0, aTxt.Len() ) ) nAdd = 20; @@ -982,7 +982,7 @@ USHORT SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd ) case RES_TXTATR_FIELD : { SwField *pFld = (SwField*)pHint->GetFld().GetFld(); - const String aTxt = pFld->GetCntnt( FALSE ); + String const aTxt = pFld->ExpandField(true); SwDrawTextInfo aDrawInf( pSh, *pOut, 0, aTxt, 0, aTxt.Len() ); nProWidth += aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width(); diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 34dbba9e9f..2aff9ba362 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -805,8 +805,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) MultiSelection aHiddenMulti( aRange ); CalcHiddenRanges( rNode, aHiddenMulti ); - aHiddenChg.Remove( 0, aHiddenChg.Count() ); - USHORT nHiddenIdx = 0; + aHiddenChg.clear(); USHORT i = 0; for( i = 0; i < aHiddenMulti.GetRangeCount(); ++i ) { @@ -814,8 +813,8 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) const xub_StrLen nStart = (xub_StrLen)rRange.Min(); const xub_StrLen nEnd = (xub_StrLen)rRange.Max() + 1; - aHiddenChg.Insert( nStart, nHiddenIdx++ ); - aHiddenChg.Insert( nEnd, nHiddenIdx++ ); + aHiddenChg.push_back( nStart ); + aHiddenChg.push_back( nEnd ); } // @@ -915,9 +914,9 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) // // remove invalid entries from script information arrays - const USHORT nScriptRemove = aScriptChg.Count() - nCnt; - aScriptChg.Remove( nCnt, nScriptRemove ); - aScriptType.Remove( nCnt, nScriptRemove ); + const size_t nScriptRemove = aScriptChg.size() - nCnt; + aScriptChg.erase( aScriptChg.begin() + nCnt, aScriptChg.end() ); + aScriptType.erase( aScriptType.begin() + nCnt, aScriptType.begin() + (nCnt + nScriptRemove) ); // get the start of the last compression group USHORT nLastCompression = nChg; @@ -933,10 +932,10 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) } // remove invalid entries from compression information arrays - const USHORT nCompRemove = aCompChg.Count() - nCntComp; - aCompChg.Remove( nCntComp, nCompRemove ); - aCompLen.Remove( nCntComp, nCompRemove ); - aCompType.Remove( nCntComp, nCompRemove ); + const size_t nCompRemove = aCompChg.size() - nCntComp; + aCompChg.erase( aCompChg.begin() + nCntComp, aCompChg.end() ); + aCompLen.erase( aCompLen.begin() + nCntComp, aCompLen.begin() + (nCntComp + nCompRemove) ); + aCompType.erase( aCompType.begin() + nCntComp, aCompType.end() ); // get the start of the last kashida group USHORT nLastKashida = nChg; @@ -947,7 +946,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) } // remove invalid entries from kashida array - aKashida.Remove( nCntKash, aKashida.Count() - nCntKash ); + aKashida.erase( aKashida.begin() + nCntKash, aKashida.end() ); // // TAKE CARE OF WEAK CHARACTERS: WE MUST FIND AN APPROPRIATE @@ -981,8 +980,9 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) if ( nScript != nNextScript ) { - aScriptChg.Insert( nEnd, nCnt ); - aScriptType.Insert( nScript, nCnt++ ); + aScriptChg.insert( aScriptChg.begin() + nCnt, nEnd ); + aScriptType.insert( aScriptType.begin() + nCnt, nScript ); + nCnt++; nScript = nNextScript; } } @@ -991,7 +991,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) // UPDATE THE SCRIPT INFO ARRAYS: // - while ( nChg < rTxt.Len() || ( !aScriptChg.Count() && !rTxt.Len() ) ) + while ( nChg < rTxt.Len() || ( aScriptChg.empty() && !rTxt.Len() ) ) { ASSERT( i18n::ScriptType::WEAK != nScript, "Inserting WEAK into SwScriptInfo structure" ); @@ -1032,18 +1032,19 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) if (nType == U_NON_SPACING_MARK || nType == U_ENCLOSING_MARK || nType == U_COMBINING_SPACING_MARK ) { - aScriptChg.Insert( nChg - 1, nCnt ); + aScriptChg.insert( aScriptChg.begin() + nCnt, nChg - 1 ); } else { - aScriptChg.Insert( nChg, nCnt ); + aScriptChg.insert( aScriptChg.begin() + nCnt, nChg ); } } else { - aScriptChg.Insert( nChg, nCnt ); + aScriptChg.insert( aScriptChg.begin() + nCnt, nChg ); } - aScriptType.Insert( nScript, nCnt++ ); + aScriptType.insert( aScriptType.begin() + nCnt, nScript ); + nCnt++; // if current script is asian, we search for compressable characters // in this range @@ -1087,10 +1088,11 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) if ( CHARCOMPRESS_PUNCTUATION_KANA == aCompEnum || ePrevState != KANA ) { - aCompChg.Insert( nPrevChg, nCntComp ); + aCompChg.insert( aCompChg.begin() + nCntComp, nPrevChg ); BYTE nTmpType = ePrevState; - aCompType.Insert( nTmpType, nCntComp ); - aCompLen.Insert( nLastCompression - nPrevChg, nCntComp++ ); + aCompType.insert( aCompType.begin() + nCntComp, nTmpType ); + aCompLen.insert( aCompLen.begin() + nCntComp, nLastCompression - nPrevChg ); + nCntComp++; } } @@ -1108,10 +1110,11 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) if ( CHARCOMPRESS_PUNCTUATION_KANA == aCompEnum || ePrevState != KANA ) { - aCompChg.Insert( nPrevChg, nCntComp ); + aCompChg.insert( aCompChg.begin() + nCntComp, nPrevChg ); BYTE nTmpType = ePrevState; - aCompType.Insert( nTmpType, nCntComp ); - aCompLen.Insert( nLastCompression - nPrevChg, nCntComp++ ); + aCompType.insert( aCompType.begin() + nCntComp, nTmpType ); + aCompLen.insert( aCompLen.begin() + nCntComp, nLastCompression - nPrevChg ); + nCntComp++; } } } @@ -1277,7 +1280,10 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) } // end of current word if ( STRING_LEN != nKashidaPos ) - aKashida.Insert( nKashidaPos, nCntKash++ ); + { + aKashida.insert( aKashida.begin() + nCntKash, nKashidaPos); + nCntKash++; + } } // end of kashida search } @@ -1292,7 +1298,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) // check kashida data long nTmpKashidaPos = -1; sal_Bool bWrongKash = sal_False; - for (i = 0; i < aKashida.Count(); ++i ) + for (i = 0; i < aKashida.size(); ++i ) { long nCurrKashidaPos = GetKashida( i ); if ( nCurrKashidaPos <= nTmpKashidaPos ) @@ -1306,9 +1312,8 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) #endif // remove invalid entries from direction information arrays - const USHORT nDirRemove = aDirChg.Count(); - aDirChg.Remove( 0, nDirRemove ); - aDirType.Remove( 0, nDirRemove ); + aDirChg.clear(); + aDirType.clear(); // Perform Unicode Bidi Algorithm for text direction information bool bPerformUBA = UBIDI_LTR != nDefaultDir; @@ -1328,7 +1333,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) // 1. All text in RTL runs will use the CTL font // #i89825# change the script type also to CTL (hennerdrewes) // 2. Text in embedded LTR runs that does not have any strong LTR characters (numbers!) - for ( USHORT nDirIdx = 0; nDirIdx < aDirChg.Count(); ++nDirIdx ) + for ( size_t nDirIdx = 0; nDirIdx < aDirChg.size(); ++nDirIdx ) { const BYTE nCurrDirType = GetDirType( nDirIdx ); // nStart ist start of RTL run: @@ -1340,7 +1345,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) ( nCurrDirType > UBIDI_LTR && !lcl_HasStrongLTR( rTxt, nStart, nEnd ) ) ) // non-strong text in embedded LTR run { // nScriptIdx points into the ScriptArrays: - USHORT nScriptIdx = 0; + size_t nScriptIdx = 0; // Skip entries in ScriptArray which are not inside the RTL run: // Make nScriptIdx become the index of the script group with @@ -1360,21 +1365,21 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) // we have to insert a new script change: if ( nStart > 0 && nStartPosOfGroup < nStart ) { - aScriptChg.Insert( nStart, nScriptIdx ); - aScriptType.Insert( nScriptTypeOfGroup, nScriptIdx ); + aScriptChg.insert( aScriptChg.begin() + nScriptIdx, nStart ); + aScriptType.insert( aScriptType.begin() + nScriptIdx, nScriptTypeOfGroup ); ++nScriptIdx; } // Remove entries in ScriptArray which end inside the RTL run: - while ( nScriptIdx < aScriptChg.Count() && GetScriptChg( nScriptIdx ) <= nEnd ) + while ( nScriptIdx < aScriptChg.size() && GetScriptChg( nScriptIdx ) <= nEnd ) { - aScriptChg.Remove( nScriptIdx, 1 ); - aScriptType.Remove( nScriptIdx, 1 ); + aScriptChg.erase( aScriptChg.begin() + nScriptIdx ); + aScriptType.erase( aScriptType.begin() + nScriptIdx ); } // Insert a new entry in ScriptArray for the end of the RTL run: - aScriptChg.Insert( nEnd, nScriptIdx ); - aScriptType.Insert( i18n::ScriptType::COMPLEX, nScriptIdx ); + aScriptChg.insert( aScriptChg.begin() + nScriptIdx, nEnd ); + aScriptType.insert( aScriptType.begin() + nScriptIdx, i18n::ScriptType::COMPLEX ); #if OSL_DEBUG_LEVEL > 1 BYTE nScriptType; @@ -1384,7 +1389,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) (void) nLastScriptChg; (void) nLastScriptType; - for ( USHORT i2 = 0; i2 < aScriptChg.Count(); ++i2 ) + for ( size_t i2 = 0; i2 < aScriptChg.size(); ++i2 ) { nScriptChg = GetScriptChg( i2 ); nScriptType = GetScriptType( i2 ); @@ -1401,9 +1406,8 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) void SwScriptInfo::UpdateBidiInfo( const String& rTxt ) { // remove invalid entries from direction information arrays - const USHORT nDirRemove = aDirChg.Count(); - aDirChg.Remove( 0, nDirRemove ); - aDirType.Remove( 0, nDirRemove ); + aDirChg.clear(); + aDirType.clear(); // // Bidi functions from icu 2.0 @@ -1420,13 +1424,12 @@ void SwScriptInfo::UpdateBidiInfo( const String& rTxt ) int32_t nEnd; UBiDiLevel nCurrDir; // counter for direction information arrays - USHORT nCntDir = 0; for ( USHORT nIdx = 0; nIdx < nCount; ++nIdx ) { ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir ); - aDirChg.Insert( (USHORT)nEnd, nCntDir ); - aDirType.Insert( (BYTE)nCurrDir, nCntDir++ ); + aDirChg.push_back( (USHORT)nEnd ); + aDirType.push_back( (BYTE)nCurrDir ); nStart = nEnd; } @@ -2011,7 +2014,7 @@ sal_Bool SwScriptInfo::IsArabicText( const XubString& rTxt, xub_StrLen nStt, xub sal_Bool SwScriptInfo::IsKashidaValid ( xub_StrLen nKashPos ) const { - for ( xub_StrLen i = 0; i < aKashidaInvalid.Count(); ++i ) + for ( size_t i = 0; i < aKashidaInvalid.size(); ++i ) { if ( aKashidaInvalid [ i ] == nKashPos ) return false; @@ -2023,13 +2026,13 @@ sal_Bool SwScriptInfo::IsKashidaValid ( xub_StrLen nKashPos ) const * SwScriptInfo::ClearKashidaInvalid() *************************************************************************/ -void SwScriptInfo::ClearKashidaInvalid ( xub_StrLen nKashPos ) +void SwScriptInfo::ClearKashidaInvalid ( xub_StrLen nKashPos ) { - for ( xub_StrLen i = 0; i < aKashidaInvalid.Count(); ++i ) + for ( size_t i = 0; i < aKashidaInvalid.size(); ++i ) { if ( aKashidaInvalid [ i ] == nKashPos ) { - aKashidaInvalid.Remove (i, 1); + aKashidaInvalid.erase ( aKashidaInvalid.begin() + i ); return; } } @@ -2085,7 +2088,7 @@ bool SwScriptInfo::MarkOrClearKashidaInvalid ( xub_StrLen nStt, xub_StrLen nLen, void SwScriptInfo::MarkKashidaInvalid ( xub_StrLen nKashPos ) { - aKashidaInvalid.Insert( nKashPos, aKashidaInvalid.Count() ); + aKashidaInvalid.push_back( nKashPos ); } /************************************************************************* @@ -2122,8 +2125,8 @@ USHORT SwScriptInfo::GetKashidaPositions ( xub_StrLen nStt, xub_StrLen nLen, void SwScriptInfo::SetNoKashidaLine ( xub_StrLen nStt, xub_StrLen nLen ) { - aNoKashidaLine.Insert( nStt, aNoKashidaLine.Count()); - aNoKashidaLineEnd.Insert( nStt+nLen, aNoKashidaLineEnd.Count()); + aNoKashidaLine.push_back( nStt ); + aNoKashidaLineEnd.push_back( nStt+nLen ); } /************************************************************************* @@ -2133,7 +2136,7 @@ void SwScriptInfo::SetNoKashidaLine ( xub_StrLen nStt, xub_StrLen nLen ) bool SwScriptInfo::IsKashidaLine ( xub_StrLen nCharIdx ) const { - for( xub_StrLen i = 0; i < aNoKashidaLine.Count(); ++i ) + for( size_t i = 0; i < aNoKashidaLine.size(); ++i ) { if( nCharIdx >= aNoKashidaLine[ i ] && nCharIdx < aNoKashidaLineEnd[ i ]) return false; @@ -2146,13 +2149,13 @@ bool SwScriptInfo::IsKashidaLine ( xub_StrLen nCharIdx ) const void SwScriptInfo::ClearNoKashidaLine ( xub_StrLen nStt, xub_StrLen nLen ) { - xub_StrLen i = 0; - while( i < aNoKashidaLine.Count()) + size_t i = 0; + while( i < aNoKashidaLine.size()) { if( nStt + nLen >= aNoKashidaLine[ i ] && nStt < aNoKashidaLineEnd [ i ] ) { - aNoKashidaLine.Remove(i, 1); - aNoKashidaLineEnd.Remove(i, 1); + aNoKashidaLine.erase(aNoKashidaLine.begin() + i); + aNoKashidaLineEnd.erase(aNoKashidaLineEnd.begin() + i); } else ++i; diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx index f071c96127..70d04f6f35 100644 --- a/sw/source/core/text/pormulti.cxx +++ b/sw/source/core/text/pormulti.cxx @@ -1022,10 +1022,10 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos, { pRet->pItem = NULL; pRet->pAttr = (*pHints)[n2Lines]; - aEnd.Insert( *pRet->pAttr->GetEnd(), 0 ); + aEnd.push_front( *pRet->pAttr->GetEnd() ); if( pItem ) { - aEnd[ 0 ] = GetTxt().Len(); + aEnd.front() = GetTxt().Len(); bOn = ((SvxTwoLinesItem*)pItem)->GetEndBracket() == p2Lines->GetEndBracket() && ((SvxTwoLinesItem*)pItem)->GetStartBracket() == @@ -1036,7 +1036,7 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos, { pRet->pItem = pItem; pRet->pAttr = NULL; - aEnd.Insert( GetTxt().Len(), 0 ); + aEnd.push_front( GetTxt().Len() ); } pRet->nId = SW_MC_DOUBLE; pRet->nLevel = GetTxtFrm()->IsRightToLeft() ? 1 : 0; @@ -1070,23 +1070,23 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos, // If the start of the next atribute is behind the end of // the last attribute on the aEnd-stack, this is the endposition // on the stack is the end of the 2-line portion. - if( !bOn || aEnd[ aEnd.Count()-1 ] < *pTmp->GetStart() ) + if( !bOn || aEnd.back() < *pTmp->GetStart() ) break; // At this moment, bOn is TRUE and the next attribute starts // behind rPos, so we could move rPos to the next startpoint rPos = *pTmp->GetStart(); // We clean up the aEnd-stack, endpositions equal to rPos are // superfluous. - while( aEnd.Count() && aEnd[ aEnd.Count()-1 ] <= rPos ) + while( !aEnd.empty() && aEnd.back() <= rPos ) { bOn = !bOn; - aEnd.Remove( aEnd.Count()-1, 1 ); + aEnd.pop_back(); } // If the endstack is empty, we simulate an attribute with // state TRUE and endposition rPos - if( !aEnd.Count() ) + if( aEnd.empty() ) { - aEnd.Insert( rPos, 0 ); + aEnd.push_front( rPos ); bOn = sal_True; } } @@ -1098,8 +1098,8 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos, if( bTwo == bOn ) { // .. with the same state, so the last attribute could // be continued. - if( aEnd[ aEnd.Count()-1 ] < *pTmp->GetEnd() ) - aEnd[ aEnd.Count()-1 ] = *pTmp->GetEnd(); + if( aEnd.back() < *pTmp->GetEnd() ) + aEnd.back() = *pTmp->GetEnd(); } else { // .. with a different state. @@ -1107,17 +1107,17 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos, // If this is smaller than the last on the stack, we put // it on the stack. If it has the same endposition, the last // could be removed. - if( aEnd[ aEnd.Count()-1 ] > *pTmp->GetEnd() ) - aEnd.Insert( *pTmp->GetEnd(), aEnd.Count() ); - else if( aEnd.Count() > 1 ) - aEnd.Remove( aEnd.Count()-1, 1 ); + if( aEnd.back() > *pTmp->GetEnd() ) + aEnd.push_back( *pTmp->GetEnd() ); + else if( aEnd.size() > 1 ) + aEnd.pop_back(); else - aEnd[ aEnd.Count()-1 ] = *pTmp->GetEnd(); + aEnd.back() = *pTmp->GetEnd(); } } } - if( bOn && aEnd.Count() ) - rPos = aEnd[ aEnd.Count()-1 ]; + if( bOn && !aEnd.empty() ) + rPos = aEnd.back(); return pRet; } if( nRotate < nCount || ( pRotItem && pRotItem == pRotate && @@ -1133,7 +1133,7 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos, // The bOn flag signs the state of the last 2-line attribute in the // aEnd-stack, which could interrupts the winning rotation attribute. sal_Bool bOn = pItem ? sal_True : sal_False; - aEnd.Insert( GetTxt().Len(), 0 ); + aEnd.push_front( GetTxt().Len() ); // n2Lines is the index of the last 2-line-attribute, which contains // the actual position. i = 0; @@ -1145,17 +1145,17 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos, continue; if( n2Start < *pTmp->GetStart() ) { - if( bOn || aEnd[ aEnd.Count()-1 ] < *pTmp->GetStart() ) + if( bOn || aEnd.back() < *pTmp->GetStart() ) break; n2Start = *pTmp->GetStart(); - while( aEnd.Count() && aEnd[ aEnd.Count()-1 ] <= n2Start ) + while( !aEnd.empty() && aEnd.back() <= n2Start ) { bOn = !bOn; - aEnd.Remove( aEnd.Count()-1, 1 ); + aEnd.pop_back(); } - if( !aEnd.Count() ) + if( aEnd.empty() ) { - aEnd.Insert( n2Start, 0 ); + aEnd.push_front( n2Start ); bOn = sal_False; } } @@ -1170,36 +1170,36 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos, { if( bTwo == bOn ) { - if( aEnd[ aEnd.Count()-1 ] < *pTmp->GetEnd() ) - aEnd[ aEnd.Count()-1 ] = *pTmp->GetEnd(); + if( aEnd.back() < *pTmp->GetEnd() ) + aEnd.back() = *pTmp->GetEnd(); } else { bOn = bTwo; - if( aEnd[ aEnd.Count()-1 ] > *pTmp->GetEnd() ) - aEnd.Insert( *pTmp->GetEnd(), aEnd.Count() ); - else if( aEnd.Count() > 1 ) - aEnd.Remove( aEnd.Count()-1, 1 ); + if( aEnd.back() > *pTmp->GetEnd() ) + aEnd.push_back( *pTmp->GetEnd() ); + else if( aEnd.size() > 1 ) + aEnd.pop_back(); else - aEnd[ aEnd.Count()-1 ] = *pTmp->GetEnd(); + aEnd.back() = *pTmp->GetEnd(); } } } - if( !bOn && aEnd.Count() ) - n2Start = aEnd[ aEnd.Count()-1 ]; + if( !bOn && !aEnd.empty() ) + n2Start = aEnd.back(); - if( aEnd.Count() ) - aEnd.Remove( 0, aEnd.Count() ); + if( !aEnd.empty() ) + aEnd.clear(); bOn = sal_True; if( nRotate < nCount ) { pRet->pItem = NULL; pRet->pAttr = (*pHints)[nRotate]; - aEnd.Insert( *pRet->pAttr->GetEnd(), 0 ); + aEnd.push_front( *pRet->pAttr->GetEnd() ); if( pRotItem ) { - aEnd[ 0 ] = GetTxt().Len(); + aEnd.front() = GetTxt().Len(); bOn = ((SvxCharRotateItem*)pRotItem)->GetValue() == pRotate->GetValue(); } @@ -1208,7 +1208,7 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos, { pRet->pItem = pRotItem; pRet->pAttr = NULL; - aEnd.Insert( GetTxt().Len(), 0 ); + aEnd.push_front( GetTxt().Len() ); } i = 0; while( i < nCount ) @@ -1218,17 +1218,17 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos, continue; if( rPos < *pTmp->GetStart() ) { - if( !bOn || aEnd[ aEnd.Count()-1 ] < *pTmp->GetStart() ) + if( !bOn || aEnd.back() < *pTmp->GetStart() ) break; rPos = *pTmp->GetStart(); - while( aEnd.Count() && aEnd[ aEnd.Count()-1 ] <= rPos ) + while( !aEnd.empty() && aEnd.back() <= rPos ) { bOn = !bOn; - aEnd.Remove( aEnd.Count()-1, 1 ); + aEnd.pop_back(); } - if( !aEnd.Count() ) + if( aEnd.empty() ) { - aEnd.Insert( rPos, 0 ); + aEnd.push_front( rPos ); bOn = sal_True; } } @@ -1241,23 +1241,23 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos, { if( bTwo == bOn ) { - if( aEnd[ aEnd.Count()-1 ] < *pTmp->GetEnd() ) - aEnd[ aEnd.Count()-1 ] = *pTmp->GetEnd(); + if( aEnd.back() < *pTmp->GetEnd() ) + aEnd.back() = *pTmp->GetEnd(); } else { bOn = bTwo; - if( aEnd[ aEnd.Count()-1 ] > *pTmp->GetEnd() ) - aEnd.Insert( *pTmp->GetEnd(), aEnd.Count() ); - else if( aEnd.Count() > 1 ) - aEnd.Remove( aEnd.Count()-1, 1 ); + if( aEnd.back() > *pTmp->GetEnd() ) + aEnd.push_back( *pTmp->GetEnd() ); + else if( aEnd.size() > 1 ) + aEnd.pop_back(); else - aEnd[ aEnd.Count()-1 ] = *pTmp->GetEnd(); + aEnd.back() = *pTmp->GetEnd(); } } } - if( bOn && aEnd.Count() ) - rPos = aEnd[ aEnd.Count()-1 ]; + if( bOn && !aEnd.empty() ) + rPos = aEnd.back(); if( rPos > n2Start ) rPos = n2Start; return pRet; diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx index 64d20d0d4c..d427aaa083 100644 --- a/sw/source/core/text/txtfld.cxx +++ b/sw/source/core/text/txtfld.cxx @@ -106,6 +106,8 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf, } ViewShell *pSh = rInf.GetVsh(); + SwDoc *const pDoc( (pSh) ? pSh->GetDoc() : 0 ); + bool const bInClipboard( (pDoc) ? pDoc->IsClipBoard() : true ); sal_Bool bPlaceHolder = sal_False; switch( pFld->GetTyp()->Which() ) @@ -117,16 +119,26 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf, case RES_COMBINED_CHARS: { - String sStr( pFld->GetCntnt( bName )); if( bName ) - pRet = new SwFldPortion( sStr ); + { + String const sName( pFld->GetFieldName() ); + pRet = new SwFldPortion(sName); + } else - pRet = new SwCombinedPortion( sStr ); + { + String const sContent( pFld->ExpandField(bInClipboard) ); + pRet = new SwCombinedPortion(sContent); + } } break; case RES_HIDDENTXTFLD: - pRet = new SwHiddenPortion(pFld->GetCntnt( bName )); + { + String const str( (bName) + ? pFld->GetFieldName() + : pFld->ExpandField(bInClipboard) ); + pRet = new SwHiddenPortion(str); + } break; case RES_CHAPTERFLD: @@ -135,13 +147,25 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf, ((SwChapterField*)pFld)->ChangeExpansion( pFrame, &((SwTxtFld*)pHint)->GetTxtNode() ); } - pRet = new SwFldPortion( pFld->GetCntnt( bName ) ); + { + String const str( (bName) + ? pFld->GetFieldName() + : pFld->ExpandField(bInClipboard) ); + pRet = new SwFldPortion( str ); + } break; case RES_DOCSTATFLD: if( !bName && pSh && !pSh->Imp()->IsUpdateExpFlds() ) + { ((SwDocStatField*)pFld)->ChangeExpansion( pFrame ); - pRet = new SwFldPortion( pFld->GetCntnt( bName ) ); + } + { + String const str( (bName) + ? pFld->GetFieldName() + : pFld->ExpandField(bInClipboard) ); + pRet = new SwFldPortion( str ); + } break; case RES_PAGENUMBERFLD: @@ -153,7 +177,6 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf, const SwRootFrm* pTmpRootFrm = pSh->GetLayout(); const sal_Bool bVirt = pTmpRootFrm->IsVirtPageNum(); - SwDoc* pDoc = pSh->GetDoc(); MSHORT nVirtNum = pFrame->GetVirtPageNum(); MSHORT nNumPages = pTmpRootFrm->GetPageNum(); sal_Int16 nNumFmt = -1; @@ -163,7 +186,12 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf, pPageNr->ChangeExpansion( pDoc, nVirtNum, nNumPages, bVirt, nNumFmt > -1 ? &nNumFmt : 0); } - pRet = new SwFldPortion( pFld->GetCntnt( bName ) ); + { + String const str( (bName) + ? pFld->GetFieldName() + : pFld->ExpandField(bInClipboard) ); + pRet = new SwFldPortion( str ); + } break; } case RES_GETEXPFLD: @@ -183,7 +211,12 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf, pExpFld->ChgBodyTxtFlag( sal_True ); } } - pRet = new SwFldPortion( pFld->GetCntnt( bName ) ); + { + String const str( (bName) + ? pFld->GetFieldName() + : pFld->ExpandField(bInClipboard) ); + pRet = new SwFldPortion( str ); + } break; } case RES_DBFLD: @@ -207,13 +240,25 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf, } */ } - pRet = new SwFldPortion( pFld->GetCntnt( bName ) ); + { + String const str( (bName) + ? pFld->GetFieldName() + : pFld->ExpandField(bInClipboard) ); + pRet = new SwFldPortion(str); + } break; } case RES_REFPAGEGETFLD: if( !bName && pSh && !pSh->Imp()->IsUpdateExpFlds() ) + { ((SwRefPageGetField*)pFld)->ChangeExpansion( pFrame, (SwTxtFld*)pHint ); - pRet = new SwFldPortion( pFld->GetCntnt( bName ) ); + } + { + String const str( (bName) + ? pFld->GetFieldName() + : pFld->ExpandField(bInClipboard) ); + pRet = new SwFldPortion(str); + } break; case RES_JUMPEDITFLD: @@ -224,9 +269,12 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf, break; default: - { - pRet = new SwFldPortion(pFld->GetCntnt( bName ) ); - } + { + String const str( (bName) + ? pFld->GetFieldName() + : pFld->ExpandField(bInClipboard) ); + pRet = new SwFldPortion(str); + } } if( bNewFlyPor ) @@ -249,7 +297,12 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf, else pTmpFnt->SetDiffFnt( &pChFmt->GetAttrSet(), pFrm->GetTxtNode()->getIDocumentSettingAccess() ); } - pRet = new SwFldPortion( pFld->GetCntnt( bName ), pTmpFnt, bPlaceHolder ); + { + String const str( (bName) + ? pFld->GetFieldName() + : pFld->ExpandField(bInClipboard) ); + pRet = new SwFldPortion(str, pTmpFnt, bPlaceHolder); + } } return pRet; @@ -488,13 +541,7 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const } else { - // --> OD 2006-06-02 #b6432095# - // use method <SwNumRule::MakeNumString(..)> instead of - // method <SwTxtNode::GetNumString()>, because for levels with - // numbering none the prefix and the suffix strings have to be provided. -// XubString aTxt( pTxtNd->GetNumString() ); - XubString aTxt( pNumRule->MakeNumString( *(pTxtNd->GetNum()) ) ); - // <-- + XubString aTxt( pTxtNd->GetNumString() ); // --> OD 2008-01-23 #newlistlevelattrs# if ( aTxt.Len() > 0 ) { diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index e3d80b4af6..ce3b8f90bb 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -51,9 +51,7 @@ #include <authfld.hxx> #include <toxwrap.hxx> -#ifndef _COMCORE_HRC #include <comcore.hrc> -#endif #include <numrule.hxx> extern BOOL IsFrameBehind( const SwTxtNode& rMyNd, xub_StrLen nMySttPos, @@ -403,7 +401,7 @@ BOOL SwTOXIndex::operator<( const SwTOXSortTabBase& rCmpBase ) // -void SwTOXIndex::_GetText( String& rTxt, String& rTxtReading ) +void SwTOXIndex::GetText_Impl( String& rTxt, String& rTxtReading ) const { ASSERT(pTxtMark, "pTxtMark == 0, Kein Stichwort"); const SwTOXMark& rTOXMark = pTxtMark->GetTOXMark(); @@ -530,7 +528,7 @@ USHORT SwTOXCustom::GetLevel() const } -void SwTOXCustom::_GetText( String& rTxt, String &rTxtReading ) +void SwTOXCustom::GetText_Impl( String& rTxt, String &rTxtReading ) const { rTxt = aKey; rTxtReading = sReading; @@ -553,7 +551,7 @@ SwTOXContent::SwTOXContent( const SwTxtNode& rNd, const SwTxtTOXMark* pMark, // Der Text des Inhalts // -void SwTOXContent::_GetText( String& rTxt, String& rTxtReading ) +void SwTOXContent::GetText_Impl( String& rTxt, String& rTxtReading ) const { const xub_StrLen* pEnd = pTxtMark->GetEnd(); if( pEnd && !pTxtMark->GetTOXMark().IsAlternativeText() ) @@ -612,7 +610,7 @@ SwTOXPara::SwTOXPara( const SwCntntNode& rNd, SwTOXElement eT, USHORT nLevel ) } -void SwTOXPara::_GetText( String& rTxt, String& ) +void SwTOXPara::GetText_Impl( String& rTxt, String& ) const { const SwCntntNode* pNd = aTOXSources[0].pNd; switch( eType ) @@ -801,7 +799,7 @@ SwTOXTable::SwTOXTable( const SwCntntNode& rNd ) } -void SwTOXTable::_GetText( String& rTxt, String& ) +void SwTOXTable::GetText_Impl( String& rTxt, String& ) const { const SwNode* pNd = aTOXSources[0].pNd; if( pNd && 0 != ( pNd = pNd->FindTableNode() ) ) @@ -868,11 +866,14 @@ USHORT SwTOXAuthority::GetLevel() const /*-- 15.09.99 14:28:08--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwTOXAuthority::_GetText( String& rTxt, String& ) +static String lcl_GetText(SwFmtFld const& rField) +{ + return rField.GetFld()->ExpandField(true); +} + +void SwTOXAuthority::GetText_Impl( String& rTxt, String& ) const { - bool const isClipBoard( - m_rField.GetTxtFld()->GetTxtNode().GetDoc()->IsClipBoard()); - rTxt = m_rField.GetFld()->ExpandField(isClipBoard); + rTxt = lcl_GetText(m_rField); } /* -----------------21.09.99 12:50------------------- @@ -885,7 +886,7 @@ void SwTOXAuthority::FillText( SwTxtNode& rNd, String sText; if(AUTH_FIELD_IDENTIFIER == nAuthField) { - sText = pField->Expand(); + sText = lcl_GetText(m_rField); const SwAuthorityFieldType* pType = (const SwAuthorityFieldType*)pField->GetTyp(); sal_Unicode cChar = pType->GetPrefix(); if(cChar && cChar != ' ') diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index a2fbd39f9f..ffe85c51d1 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -259,10 +259,9 @@ BOOL SwFmtFld::IsProtect() const |* *************************************************************************/ -SwTxtFld::SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStartPos, - bool const bInClipboard) +SwTxtFld::SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStartPos) : SwTxtAttr( rAttr, nStartPos ) - , m_aExpand( rAttr.GetFld()->ExpandField(bInClipboard) ) + , m_aExpand( rAttr.GetFld()->ExpandField(true) ) , m_pTxtNode( 0 ) { rAttr.pTxtAttr = this; diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 4046cbc59f..c4a559b9d5 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -99,6 +99,10 @@ #include <list.hxx> // <-- + +using namespace ::com::sun::star; + + SV_DECL_PTRARR( TmpHints, SwTxtAttr*, 0, 4 ) TYPEINIT1( SwTxtNode, SwCntntNode ) @@ -2566,9 +2570,14 @@ void SwTxtNode::NumRuleChgd() } SetInSwFntCache( FALSE ); - SvxLRSpaceItem& rLR = (SvxLRSpaceItem&)GetSwAttrSet().GetLRSpace(); - - SwModify::Modify( &rLR, &rLR ); + // Sending "noop" modify in order to cause invalidations of registered + // <SwTxtFrm> instances to get the list style change respectively the change + // in the list tree reflected in the layout. + // Important note: + { + SvxLRSpaceItem& rLR = (SvxLRSpaceItem&)GetSwAttrSet().GetLRSpace(); + SwModify::Modify( &rLR, &rLR ); + } } // -> #i27615# @@ -2834,13 +2843,19 @@ XubString SwTxtNode::GetNumString( const bool _bInclPrefixAndSuffixStrings, cons } const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L; if ( pRule && - IsCountedInList() && - pRule->Get( static_cast<USHORT>(GetActualListLevel()) ).IsTxtFmt() ) + IsCountedInList() ) { - return pRule->MakeNumString( GetNum()->GetNumberVector(), + SvxNumberType const& rNumberType( + pRule->Get( static_cast<USHORT>(GetActualListLevel()) ) ); + if (rNumberType.IsTxtFmt() || + // #b6432095# + (style::NumberingType::NUMBER_NONE == rNumberType.GetNumberingType())) + { + return pRule->MakeNumString( GetNum()->GetNumberVector(), _bInclPrefixAndSuffixStrings ? TRUE : FALSE, FALSE, _nRestrictToThisLevel ); + } } return aEmptyStr; @@ -3057,8 +3072,7 @@ void SwTxtNode::Replace0xFF( XubString& rTxt, xub_StrLen& rTxtStt, { const XubString aExpand( static_cast<SwTxtFld const*>(pAttr)->GetFld() - .GetFld()->ExpandField( - GetDoc()->IsClipBoard())); + .GetFld()->ExpandField(true)); rTxt.Insert( aExpand, nPos ); nPos = nPos + aExpand.Len(); nEndPos = nEndPos + aExpand.Len(); @@ -3207,7 +3221,7 @@ BOOL SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx, { XubString const aExpand( static_cast<SwTxtFld const*>(pHt)->GetFld().GetFld() - ->ExpandField(GetDoc()->IsClipBoard())); + ->ExpandField(true)); if( aExpand.Len() ) { aDestIdx++; // dahinter einfuegen; @@ -3305,7 +3319,7 @@ const ModelToViewHelper::ConversionMap* { const XubString aExpand( static_cast<SwTxtFld const*>(pAttr)->GetFld().GetFld() - ->ExpandField(GetDoc()->IsClipBoard())); + ->ExpandField(true)); if ( aExpand.Len() > 0 ) { const xub_StrLen nFieldPos = *pAttr->GetStart(); @@ -5080,8 +5094,6 @@ bool SwTxtNode::IsInContent() const #include <unoparagraph.hxx> -using namespace ::com::sun::star; - uno::Reference< rdf::XMetadatable > SwTxtNode::MakeUnoObject() { diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index b86595b102..c622a8ea34 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1043,8 +1043,7 @@ SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr, pNew = new SwTxtINetFmt( (SwFmtINetFmt&)rNew, nStt, nEnd ); break; case RES_TXTATR_FIELD: - pNew = new SwTxtFld( static_cast<SwFmtFld &>(rNew), nStt, - rDoc.IsClipBoard() ); + pNew = new SwTxtFld( static_cast<SwFmtFld &>(rNew), nStt ); break; case RES_TXTATR_FLYCNT: { diff --git a/sw/source/core/undo/makefile.mk b/sw/source/core/undo/makefile.mk index c381761adb..35771fa444 100644 --- a/sw/source/core/undo/makefile.mk +++ b/sw/source/core/undo/makefile.mk @@ -49,6 +49,7 @@ EXCEPTIONSFILES = \ $(SLO)$/unattr.obj \ $(SLO)$/undobj.obj \ $(SLO)$/undraw.obj \ + $(SLO)$/unnum.obj \ $(SLO)$/unovwr.obj \ $(SLO)$/untbl.obj diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index 9526112d0e..8beea93a9b 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -1389,7 +1389,13 @@ SwRegHistory::SwRegHistory( const SwNode& rNd, SwHistory* pHst ) void SwRegHistory::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) { - if ( m_pHistory && ( pOld || pNew ) ) + // --> OD 2010-10-05 #i114861# + // Do not handle a "noop" modify + // - e.g. <SwTxtNode::NumRuleChgd()> uses such a "noop" modify +// if ( m_pHistory && ( pOld || pNew ) ) + if ( m_pHistory && ( pOld || pNew ) && + pOld != pNew ) + // <-- { if ( pNew->Which() < POOLATTR_END ) { diff --git a/sw/source/core/undo/unnum.cxx b/sw/source/core/undo/unnum.cxx index 11a92c6385..a18c14212d 100644 --- a/sw/source/core/undo/unnum.cxx +++ b/sw/source/core/undo/unnum.cxx @@ -197,13 +197,12 @@ void SwUndoInsNum::SaveOldNumRule( const SwNumRule& rOld ) pOldNumRule = new SwNumRule( rOld ); } -/* */ +/* */ SwUndoDelNum::SwUndoDelNum( const SwPaM& rPam ) : SwUndo( UNDO_DELNUM ), SwUndRng( rPam ), - aNodeIdx( BYTE( nEndNode - nSttNode > 255 ? 255 : nEndNode - nSttNode )), - aLevels( BYTE( nEndNode - nSttNode > 255 ? 255 : nEndNode - nSttNode )) + aNodeIdx( BYTE( nEndNode - nSttNode > 255 ? 255 : nEndNode - nSttNode )) { pHistory = new SwHistory; } @@ -229,7 +228,7 @@ void SwUndoDelNum::Undo( SwUndoIter& rUndoIter ) for( USHORT n = 0; n < aNodeIdx.Count(); ++n ) { SwTxtNode* pNd = rDoc.GetNodes()[ aNodeIdx[ n ] ]->GetTxtNode(); - ASSERT( pNd, "wo ist der TextNode geblieben?" ); + ASSERT( pNd, "Where is TextNode gone?" ); pNd->SetAttrListLevel(aLevels[ n ] ); if( pNd->GetCondFmtColl() ) @@ -261,12 +260,12 @@ void SwUndoDelNum::AddNode( const SwTxtNode& rNd, BOOL ) USHORT nIns = aNodeIdx.Count(); aNodeIdx.Insert( rNd.GetIndex(), nIns ); - aLevels.Insert( static_cast<BYTE>(rNd.GetActualListLevel()), nIns ); + aLevels.insert( aLevels.begin() + nIns, static_cast<BYTE>(rNd.GetActualListLevel()) ); } } -/* */ +/* */ SwUndoMoveNum::SwUndoMoveNum( const SwPaM& rPam, long nOff, BOOL bIsOutlMv ) @@ -325,7 +324,7 @@ void SwUndoMoveNum::Repeat( SwUndoIter& rUndoIter ) rUndoIter.GetDoc().MoveParagraph( *rUndoIter.pAktPam, nOffset, FALSE ); } -/* */ +/* */ SwUndoNumUpDown::SwUndoNumUpDown( const SwPaM& rPam, short nOff ) @@ -356,7 +355,7 @@ void SwUndoNumUpDown::Repeat( SwUndoIter& rUndoIter ) rUndoIter.GetDoc().NumUpDown( *rUndoIter.pAktPam, 1 == nOffset ); } -/* */ +/* */ // #115901# SwUndoNumOrNoNum::SwUndoNumOrNoNum( const SwNodeIndex& rIdx, BOOL bOldNum, @@ -402,7 +401,7 @@ void SwUndoNumOrNoNum::Repeat( SwUndoIter& rUndoIter ) TRUE); } -/* */ +/* */ SwUndoNumRuleStart::SwUndoNumRuleStart( const SwPosition& rPos, BOOL bFlg ) : SwUndo( UNDO_SETNUMRULESTART ), diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index aaf0efd655..c6ae8d2463 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -1745,7 +1745,7 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd, ( nNodes != ( pSourceBox->GetSttNd()->EndOfSectionIndex() - pSourceBox->GetSttIdx() ) ) && ( nNodes - 1 > nLineDiff ); - aMvBoxes.Insert( bNodesMoved, nInsPos ); + aMvBoxes.insert( aMvBoxes.begin() + nInsPos, bNodesMoved ); } } } @@ -1805,7 +1805,7 @@ void SwUndoTblNdsChg::Undo( SwUndoIter& rUndoIter ) } Ptrs.pDelSects->DeleteAndDestroy( 0, Ptrs.pDelSects->Count() ); } - else if( aMvBoxes.Count() ) + else if( !aMvBoxes.empty() ) { // dann muessen Nodes verschoben und nicht geloescht werden! // Dafuer brauchen wir aber ein temp Array diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 72a9a7a08d..fd4fbdc5eb 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -1267,13 +1267,16 @@ uno::Reference< beans::XPropertySet > SwXTextField::getTextFieldMaster(void) th OUString SwXTextField::getPresentation(sal_Bool bShowCommand) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); - OUString sRet; - const SwField* pField = GetField(); - if(pField) - sRet = pField->GetCntnt(bShowCommand); - else + + SwField const*const pField = GetField(); + if (!pField) + { throw uno::RuntimeException(); - return sRet; + } + ::rtl::OUString const ret( (bShowCommand) + ? pField->GetFieldName() + : pField->ExpandField(true) ); + return ret; } /* -----------------18.02.99 13:39------------------- * diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx index 3038865007..b36fd80d18 100644 --- a/sw/source/core/unocore/unosrch.cxx +++ b/sw/source/core/unocore/unosrch.cxx @@ -185,7 +185,17 @@ void SwSearchProperties_Impl::FillItemSet(SfxItemSet& rSet, sal_Bool bIsValueSea *pContourItem = 0, *pCharColorItem = 0, *pCasemapItem = 0, - *pBrushItem = 0; + *pBrushItem = 0, + *pFontCJKItem = 0, + *pFontSizeCJKItem = 0, + *pCJKLangItem = 0, + *pCJKPostureItem = 0, + *pCJKWeightItem = 0, + *pFontCTLItem = 0, + *pFontSizeCTLItem = 0, + *pCTLLangItem = 0, + *pCTLPostureItem = 0, + *pCTLWeightItem = 0; PropertyEntryVector_t::const_iterator aIt = aPropertyEntries.begin(); for(sal_uInt32 i = 0; i < nArrLen; i++, ++aIt) @@ -370,6 +380,56 @@ void SwSearchProperties_Impl::FillItemSet(SfxItemSet& rSet, sal_Bool bIsValueSea pWLineItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pWLineItem; break; + case RES_CHRATR_CJK_FONT: + if(!pFontCJKItem ) + pFontCJKItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); + pTempItem = pFontCJKItem; + break; + case RES_CHRATR_CJK_FONTSIZE: + if(!pFontSizeCJKItem ) + pFontSizeCJKItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); + pTempItem = pFontSizeCJKItem; + break; + case RES_CHRATR_CJK_LANGUAGE: + if(!pCJKLangItem ) + pCJKLangItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); + pTempItem = pCJKLangItem; + break; + case RES_CHRATR_CJK_POSTURE: + if(!pCJKPostureItem ) + pCJKPostureItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); + pTempItem = pCJKPostureItem; + break; + case RES_CHRATR_CJK_WEIGHT: + if(!pCJKWeightItem ) + pCJKWeightItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); + pTempItem = pCJKWeightItem; + break; + case RES_CHRATR_CTL_FONT: + if(!pFontCTLItem ) + pFontCTLItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); + pTempItem = pFontCTLItem; + break; + case RES_CHRATR_CTL_FONTSIZE: + if(!pFontSizeCTLItem ) + pFontSizeCTLItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); + pTempItem = pFontSizeCTLItem; + break; + case RES_CHRATR_CTL_LANGUAGE: + if(!pCTLLangItem ) + pCTLLangItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); + pTempItem = pCTLLangItem; + break; + case RES_CHRATR_CTL_POSTURE: + if(!pCTLPostureItem ) + pCTLPostureItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); + pTempItem = pCTLPostureItem; + break; + case RES_CHRATR_CTL_WEIGHT: + if(!pCTLWeightItem ) + pCTLWeightItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); + pTempItem = pCTLWeightItem; + break; } if(pTempItem) { diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index b68fea70a9..a93d84296a 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -3993,11 +3993,11 @@ SwAutoStylesEnumImpl::SwAutoStylesEnumImpl( SwDoc* pInitDoc, IStyleAccess::SwAut { std::set< std::pair< USHORT, USHORT > > aRubyMap; SwAttrPool& rAttrPool = pDoc->GetAttrPool(); - USHORT nCount = rAttrPool.GetItemCount( RES_TXTATR_CJK_RUBY ); + sal_uInt32 nCount = rAttrPool.GetItemCount2( RES_TXTATR_CJK_RUBY ); - for ( USHORT nI = 0; nI < nCount; ++nI ) + for ( sal_uInt32 nI = 0; nI < nCount; ++nI ) { - const SwFmtRuby* pItem = static_cast<const SwFmtRuby*>(rAttrPool.GetItem( RES_TXTATR_CJK_RUBY, nI )); + const SwFmtRuby* pItem = static_cast<const SwFmtRuby*>(rAttrPool.GetItem2( RES_TXTATR_CJK_RUBY, nI )); if ( pItem && pItem->GetTxtRuby() ) { std::pair< USHORT, USHORT > aPair( pItem->GetPosition(), pItem->GetAdjustment() ); diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index a9658fc7bc..c173e0f41b 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -2285,17 +2285,6 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc) rDoc.SetAttr( aSet, *rTbl.GetFrmFmt() ); } } -/* -----------------------------11.07.00 12:14-------------------------------- - - ---------------------------------------------------------------------------*/ -SwXTextTable* SwXTextTable::GetImplementation(uno::Reference< XInterface> xRef ) -{ - uno::Reference<lang::XUnoTunnel> xTunnel( xRef, uno::UNO_QUERY); - if(xTunnel.is()) - return reinterpret_cast< SwXTextTable * >( - sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething(SwXTextTable::getUnoTunnelId()) )); - return 0; -} /* -----------------------------10.03.00 18:02-------------------------------- ---------------------------------------------------------------------------*/ diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx index 7b538316bf..2ad35fadaa 100644 --- a/sw/source/core/view/pagepreviewlayout.cxx +++ b/sw/source/core/view/pagepreviewlayout.cxx @@ -1450,12 +1450,6 @@ sal_uInt16 SwPagePreviewLayout::GetColOfPage( sal_uInt16 _nPageNum ) const return nCol; } -Size SwPagePreviewLayout::GetMaxPageSize() const -{ - ASSERT( PreviewLayoutValid(), "PagePreviewLayout not valid" ); - return maMaxPageSize; -} - Size SwPagePreviewLayout::GetPrevwDocSize() const { ASSERT( PreviewLayoutValid(), "PagePreviewLayout not valid" ); diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index 5d8cb3f043..9410da39e2 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -40,7 +40,6 @@ #include <wdocsh.hxx> #include <viewsh.hxx> #include <docfld.hxx> -#include <swprtopt.hxx> #include <svl/languageoptions.hxx> #include <toolkit/awt/vclxdevice.hxx> @@ -125,9 +124,9 @@ void SwRenderData::ViewOptionAdjustStart( SwWrtShell &rSh, const SwViewOption &r } m_pViewOptionAdjust = new SwViewOptionAdjust_Impl( rSh, rViewOptions ); } - -void SwRenderData::ViewOptionAdjust( const SwPrtOptions *pPrtOptions ) + +void SwRenderData::ViewOptionAdjust(SwPrintData const*const pPrtOptions) { m_pViewOptionAdjust->AdjustViewOptions( pPrtOptions ); } @@ -139,24 +138,24 @@ void SwRenderData::ViewOptionAdjustStop() { delete m_pViewOptionAdjust; m_pViewOptionAdjust = 0; - } + } } -void SwRenderData::MakeSwPrtOptions( - SwPrtOptions &rOptions, +void SwRenderData::MakeSwPrtOptions( + SwPrintData & rOptions, const SwDocShell *pDocShell, const SwPrintUIOptions *pOpt, - const SwRenderData *pData, + const SwRenderData *pData, bool bIsPDFExport ) { if (!pDocShell || !pOpt || !pData) return; - + // get default print options const TypeId aSwWebDocShellTypeId = TYPE(SwWebDocShell); BOOL bWeb = pDocShell->IsA( aSwWebDocShellTypeId ); - rOptions.MakeOptions( bWeb ); + ::sw::InitPrintOptionsFromApplication(rOptions, bWeb); // get print options to use from provided properties rOptions.bPrintGraphic = pOpt->IsPrintGraphics(); @@ -183,19 +182,8 @@ void SwRenderData::MakeSwPrtOptions( //! function will destroy the pointers rOptions.SetPrintUIOptions( pOpt ); rOptions.SetRenderData( pData ); - - // rOptions.aMulti is not used anymore in the XRenderable API - // Thus we set it to a dummy value here. - rOptions.aMulti = MultiSelection( Range( 1, 1 ) ); - - //! Note: Since for PDF export of (multi-)selection a temporary - //! document is created that contains only the selects parts, - //! and thus that document is to printed in whole the, - //! rOptions.bPrintSelection parameter will be false. - if (bIsPDFExport) - rOptions.bPrintSelection = FALSE; } - + ////////////////////////////////////////////////////////////////////// diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx index 20e12f2e3c..1162567480 100644 --- a/sw/source/core/view/vdraw.cxx +++ b/sw/source/core/view/vdraw.cxx @@ -52,7 +52,7 @@ #include "viewimp.hxx" #include "dflyobj.hxx" #include "viewopt.hxx" -#include "swprtopt.hxx" +#include "printdata.hxx" #include "dcontact.hxx" #include "dview.hxx" #include "flyfrm.hxx" @@ -179,7 +179,7 @@ void SwViewImp::UnlockPaint() // outliner of the draw view for painting layers <hell> and <heaven>. // OD 25.06.2003 #108784# - correct type of 1st parameter void SwViewImp::PaintLayer( const SdrLayerID _nLayerID, - const SwPrtOptions * _pPrintData, + SwPrintData const*const pPrintData, const SwRect& , const Color* _pPageBackgrdColor, const bool _bIsPageRightToLeft ) const @@ -226,11 +226,11 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID, } pOutDev->Push( PUSH_LINECOLOR ); // #114231# - if (_pPrintData) + if (pPrintData) { // hide drawings but not form controls (form controls are handled elsewhere) SdrView &rSdrView = const_cast< SdrView & >(GetPageView()->GetView()); - rSdrView.setHideDraw( !_pPrintData->IsPrintDraw() ); + rSdrView.setHideDraw( !pPrintData->IsPrintDraw() ); } GetPageView()->DrawLayer(_nLayerID, pOutDev); pOutDev->Pop(); diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx index 91f89299e8..dc56548152 100644 --- a/sw/source/core/view/viewpg.cxx +++ b/sw/source/core/view/viewpg.cxx @@ -41,19 +41,15 @@ #include <rootfrm.hxx> #include <viewimp.hxx> #include <viewopt.hxx> -#include <swprtopt.hxx> // SwPrtOptions +#include <printdata.hxx> #include <fldbas.hxx> #include <ptqueue.hxx> #include <swregion.hxx> #include <hints.hxx> #include <fntcache.hxx> -#ifndef _STATSTR_HRC #include <statstr.hrc> // Text fuer SfxProgress -#endif -#ifndef _COMCORE_HRC #include <comcore.hrc> -#endif #include <IDocumentFieldsAccess.hxx> #include <IDocumentDeviceAccess.hxx> @@ -77,7 +73,7 @@ void ViewShell::ShowPreViewSelection( sal_uInt16 nSelPage ) OD 09.01.2003 #i6467# */ -void ViewShell::AdjustOptionsForPagePreview( const SwPrtOptions &_rPrintOptions ) +void ViewShell::AdjustOptionsForPagePreview(SwPrintData const& rPrintOptions) { if ( !IsPreView() ) { @@ -85,7 +81,7 @@ void ViewShell::AdjustOptionsForPagePreview( const SwPrtOptions &_rPrintOptions return; } - PrepareForPrint( _rPrintOptions ); + PrepareForPrint( rPrintOptions ); return; } diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index c37036e42a..d7c0aadc9d 100755..100644 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -71,7 +71,7 @@ #include <docufld.hxx> // PostItFld /-Type #include <shellres.hxx> #include <viewopt.hxx> -#include <swprtopt.hxx> // SwPrtOptions +#include <printdata.hxx> // SwPrintData #include <pagedesc.hxx> #include <poolfmt.hxx> // fuer RES_POOLPAGE_JAKET #include <mdiexp.hxx> // Ansteuern der Statusleiste @@ -369,107 +369,6 @@ void ViewShell::CalcPagesForPrint( USHORT nMax ) /******************************************************************************/ -SwDoc * ViewShell::CreatePrtDoc( SfxObjectShellRef &rDocShellRef) -{ - ASSERT( this->IsA( TYPE(SwFEShell) ),"ViewShell::Prt for FEShell only"); - SwFEShell* pFESh = (SwFEShell*)this; - // Wir bauen uns ein neues Dokument - SwDoc *pPrtDoc = new SwDoc; - pPrtDoc->acquire(); - pPrtDoc->SetRefForDocShell( (SfxObjectShellRef*)&(long&)rDocShellRef ); - pPrtDoc->LockExpFlds(); - - const SfxPoolItem* pCpyItem; - const SfxItemPool& rPool = GetAttrPool(); - for( USHORT nWh = POOLATTR_BEGIN; nWh < POOLATTR_END; ++nWh ) - if( 0 != ( pCpyItem = rPool.GetPoolDefaultItem( nWh ) ) ) - pPrtDoc->GetAttrPool().SetPoolDefaultItem( *pCpyItem ); - - // JP 29.07.99 - Bug 67951 - set all Styles from the SourceDoc into - // the PrintDoc - will be replaced! - pPrtDoc->ReplaceStyles( *GetDoc() ); - - SwShellCrsr *pActCrsr = pFESh->_GetCrsr(); - SwShellCrsr *pFirstCrsr = dynamic_cast<SwShellCrsr*>(pActCrsr->GetNext()); - if( !pActCrsr->HasMark() ) // bei Multiselektion kann der aktuelle Cursor leer sein - { - pActCrsr = dynamic_cast<SwShellCrsr*>(pActCrsr->GetPrev()); - } - - Point aSelPoint; - if( pFESh->IsTableMode() ) - { - SwShellTableCrsr* pShellTblCrsr = pFESh->GetTableCrsr(); - - const SwCntntNode* pCntntNode = pShellTblCrsr->GetNode()->GetCntntNode(); - const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->GetFrm( 0, pShellTblCrsr->Start() ) : 0; - if( pCntntFrm ) - { - SwRect aCharRect; - SwCrsrMoveState aTmpState( MV_NONE ); - pCntntFrm->GetCharRect( aCharRect, *pShellTblCrsr->Start(), &aTmpState ); - aSelPoint = Point( aCharRect.Left(), aCharRect.Top() ); - } - } - else - { - aSelPoint = pFirstCrsr->GetSttPos(); - } - - const SwPageFrm* pPage = GetLayout()->GetPageAtPos( aSelPoint ); - ASSERT( pPage, "no page found!" ); - - // get page descriptor - fall back to the first one if pPage could not be found - const SwPageDesc* pPageDesc = pPage ? pPrtDoc->FindPageDescByName( - pPage->GetPageDesc()->GetName() ) : &pPrtDoc->_GetPageDesc( (sal_uInt16)0 ); - - if( !pFESh->IsTableMode() && pActCrsr->HasMark() ) - { // Am letzten Absatz die Absatzattribute richten: - SwNodeIndex aNodeIdx( *pPrtDoc->GetNodes().GetEndOfContent().StartOfSectionNode() ); - SwTxtNode* pTxtNd = pPrtDoc->GetNodes().GoNext( &aNodeIdx )->GetTxtNode(); - SwCntntNode *pLastNd = - pActCrsr->GetCntntNode( (*pActCrsr->GetMark()) <= (*pActCrsr->GetPoint()) ); - // Hier werden die Absatzattribute des ersten Absatzes uebertragen - if( pLastNd && pLastNd->IsTxtNode() ) - ((SwTxtNode*)pLastNd)->CopyCollFmt( *pTxtNd ); - } - - // es wurde in der CORE eine neu angelegt (OLE-Objekte kopiert!) -// if( aDocShellRef.Is() ) -// SwDataExchange::InitOle( aDocShellRef, pPrtDoc ); - // und fuellen es mit dem selektierten Bereich - pFESh->Copy( pPrtDoc ); - - //Jetzt noch am ersten Absatz die Seitenvorlage setzen - { - SwNodeIndex aNodeIdx( *pPrtDoc->GetNodes().GetEndOfContent().StartOfSectionNode() ); - SwCntntNode* pCNd = pPrtDoc->GetNodes().GoNext( &aNodeIdx ); // gehe zum 1. ContentNode - if( pFESh->IsTableMode() ) - { - SwTableNode* pTNd = pCNd->FindTableNode(); - if( pTNd ) - pTNd->GetTable().GetFrmFmt()->SetFmtAttr( SwFmtPageDesc( pPageDesc ) ); - } - else - { - pCNd->SetAttr( SwFmtPageDesc( pPageDesc ) ); - if( pFirstCrsr->HasMark() ) - { - SwTxtNode *pTxtNd = pCNd->GetTxtNode(); - if( pTxtNd ) - { - SwCntntNode *pFirstNd = - pFirstCrsr->GetCntntNode( (*pFirstCrsr->GetMark()) > (*pFirstCrsr->GetPoint()) ); - // Hier werden die Absatzattribute des ersten Absatzes uebertragen - if( pFirstNd && pFirstNd->IsTxtNode() ) - ((SwTxtNode*)pFirstNd)->CopyCollFmt( *pTxtNd ); - } - } - } - } - return pPrtDoc; -} - SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt) { ASSERT( this->IsA( TYPE(SwFEShell) ),"ViewShell::Prt for FEShell only"); @@ -582,7 +481,7 @@ SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt) sal_Bool ViewShell::PrintOrPDFExport( OutputDevice *pOutDev, - const SwPrtOptions &rPrintData, + SwPrintData const& rPrintData, sal_Int32 nRenderer /* the index in the vector of pages to be printed */ ) { //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -608,32 +507,15 @@ sal_Bool ViewShell::PrintOrPDFExport( //!! (h?ngt mit OLE Objekten im Dokument zusammen.) SfxObjectShellRef aDocShellRef; - //! Note: Since for PDF export of (multi-)selection a temporary - //! document is created that contains only the selects parts, - //! and thus that document is to printed in whole the, - //! rPrintData.bPrintSelection parameter will be false. - BOOL bSelection = rPrintData.bPrintSelection; - - // PDF export for (multi-)selection has already generated a temporary document - // with the selected text. (see XRenderable implementation in unotxdoc.cxx) - // Thus we like to go in the 'else' part here in that case. - // Is is implemented this way because PDF export calls this Prt function + // Print/PDF export for (multi-)selection has already generated a + // temporary document with the selected text. + // (see XRenderable implementation in unotxdoc.cxx) + // It is implemented this way because PDF export calls this Prt function // once per page and we do not like to always have the temporary document - // to be created that often here in the 'then' part. - if ( bSelection ) - { - pOutDevDoc = CreatePrtDoc( aDocShellRef ); + // to be created that often here. + pOutDevDoc = GetDoc(); + pShell = new ViewShell( *this, 0, pOutDev ); - // eine ViewShell darauf - pShell = new ViewShell( *pOutDevDoc, 0, pOpt, pOutDev ); - pOutDevDoc->SetRefForDocShell( 0 ); - } - else - { - pOutDevDoc = GetDoc(); - pShell = new ViewShell( *this, 0, pOutDev ); - } - SdrView *pDrawView = pShell->GetDrawView(); if (pDrawView) { @@ -682,6 +564,8 @@ sal_Bool ViewShell::PrintOrPDFExport( rPrintData.GetRenderData().m_pPostItShell : pShell; ::SetSwVisArea( pViewSh2, pStPage->Frm() ); +// FIXME disabled because rPrintData.aOffset is always (0,0) +#if 0 // wenn wir einen Umschlag drucken wird ein Offset beachtet if( pStPage->GetFmt()->GetPoolFmtId() == RES_POOLPAGE_JAKET ) { @@ -691,6 +575,7 @@ sal_Bool ViewShell::PrintOrPDFExport( aTmp.SetOrigin( aNewOrigin ); pOutDev->SetMapMode( aTmp ); } +#endif pShell->InitPrt( pOutDev ); @@ -705,12 +590,6 @@ sal_Bool ViewShell::PrintOrPDFExport( delete pShell; - if (bSelection ) - { - if ( !pOutDevDoc->release() ) - delete pOutDevDoc; - } - // restore settings of OutputDevice (should be done always now since the // output device is now provided by a call from outside the Writer) pOutDev->Pop(); @@ -788,9 +667,9 @@ void ViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintDat BOOL ViewShell::IsAnyFieldInDoc() const { const SfxPoolItem* pItem; - USHORT nMaxItems = pDoc->GetAttrPool().GetItemCount( RES_TXTATR_FIELD ); - for( USHORT n = 0; n < nMaxItems; ++n ) - if( 0 != (pItem = pDoc->GetAttrPool().GetItem( RES_TXTATR_FIELD, n ))) + sal_uInt32 nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_FIELD ); + for( sal_uInt32 n = 0; n < nMaxItems; ++n ) + if( 0 != (pItem = pDoc->GetAttrPool().GetItem2( RES_TXTATR_FIELD, n ))) { const SwFmtFld* pFmtFld = (SwFmtFld*)pItem; const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld(); diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx index 280ecf1166..4d52488de5 100644 --- a/sw/source/filter/ascii/ascatr.cxx +++ b/sw/source/filter/ascii/ascatr.cxx @@ -125,7 +125,7 @@ BOOL SwASC_AttrIter::OutAttr( xub_StrLen nSwPos ) { case RES_TXTATR_FIELD: sOut = static_cast<SwTxtFld const*>(pHt)->GetFld().GetFld() - ->ExpandField(rWrt.pDoc->IsClipBoard()); + ->ExpandField(true); break; case RES_TXTATR_FTN: diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index d0f73494bb..13164ee383 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -1250,8 +1250,9 @@ class HTMLEndPosLst SvXub_StrLens aScriptChgLst; // positions where script changes // 0 is not contained in this list, // but the text length - SvUShorts aScriptLst; // the script that is valif up to the position - // contained in aScriptChgList at the same index + // the script that is valif up to the position + // contained in aScriptChgList at the same index + ::std::vector<USHORT> aScriptLst; SwDoc *pDoc; // das aktuelle Dokument SwDoc* pTemplate; // die HTML-Vorlage (oder 0) @@ -1797,8 +1798,8 @@ HTMLEndPosLst::HTMLEndPosLst( SwDoc *pD, SwDoc* pTempl, { sal_uInt16 nScript = pBreakIt->GetBreakIter()->getScriptType( rText, nPos ); nPos = (xub_StrLen)pBreakIt->GetBreakIter()->endOfScript( rText, nPos, nScript ); - aScriptChgLst.Insert( nPos, aScriptChgLst.Count() ); - aScriptLst.Insert( nScript, aScriptLst.Count() ); + aScriptChgLst.push_back( nPos ); + aScriptLst.push_back( nScript ); } } @@ -1995,9 +1996,8 @@ void HTMLEndPosLst::Insert( const SfxPoolItem& rItem, if( bDependsOnScript ) { - sal_uInt16 nScriptChgs = aScriptChgLst.Count(); xub_StrLen nPos = nStart; - for( sal_uInt16 i=0; i < nScriptChgs; i++ ) + for( size_t i=0; i < aScriptChgLst.size(); i++ ) { xub_StrLen nChgPos = aScriptChgLst[i]; if( nPos >= nChgPos ) @@ -2080,8 +2080,8 @@ sal_uInt16 HTMLEndPosLst::GetScriptAtPos( xub_StrLen nPos , { sal_uInt16 nRet = CSS1_OUTMODE_ANY_SCRIPT; - sal_uInt16 nScriptChgs = aScriptChgLst.Count(); - sal_uInt16 i=0; + size_t nScriptChgs = aScriptChgLst.size(); + size_t i=0; while( i < nScriptChgs && nPos >= aScriptChgLst[i] ) i++; ASSERT( i < nScriptChgs, "script list is to short" ); diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx index 32234b7929..a60fd36daf 100644 --- a/sw/source/filter/html/htmlfldw.cxx +++ b/sw/source/filter/html/htmlfldw.cxx @@ -305,7 +305,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pFld, } // Inhalt des Feldes ausgeben - String const sExpand( pFld->ExpandField(rWrt.pDoc->IsClipBoard()) ); + String const sExpand( pFld->ExpandField(true) ); sal_Bool bNeedsCJKProcessing = sal_False; if( sExpand.Len() ) { diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx index e11a5cdf43..7e07c5835b 100644 --- a/sw/source/filter/html/htmlfly.cxx +++ b/sw/source/filter/html/htmlfly.cxx @@ -1835,10 +1835,10 @@ void SwHTMLWriter::CollectLinkTargets() const SwTxtINetFmt* pTxtAttr; const SwTxtNode* pTxtNd; - USHORT n, nMaxItems = pDoc->GetAttrPool().GetItemCount( RES_TXTATR_INETFMT ); + sal_uInt32 n, nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_INETFMT ); for( n = 0; n < nMaxItems; ++n ) { - if( 0 != (pINetFmt = (SwFmtINetFmt*)pDoc->GetAttrPool().GetItem( + if( 0 != (pINetFmt = (SwFmtINetFmt*)pDoc->GetAttrPool().GetItem2( RES_TXTATR_INETFMT, n ) ) && 0 != ( pTxtAttr = pINetFmt->GetTxtINetFmt()) && 0 != ( pTxtNd = pTxtAttr->GetpTxtNode() ) && @@ -1849,10 +1849,10 @@ void SwHTMLWriter::CollectLinkTargets() } const SwFmtURL *pURL; - nMaxItems = pDoc->GetAttrPool().GetItemCount( RES_URL ); + nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_URL ); for( n = 0; n < nMaxItems; ++n ) { - if( 0 != (pURL = (SwFmtURL*)pDoc->GetAttrPool().GetItem( + if( 0 != (pURL = (SwFmtURL*)pDoc->GetAttrPool().GetItem2( RES_URL, n ) ) ) { AddLinkTarget( pURL->GetURL() ); diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 707b62c2cf..910b1bcdd6 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -166,7 +166,7 @@ void SwHTMLParser::ConnectImageMaps() } -/* */ +/* */ void SwHTMLParser::SetAnchorAndAdjustment( sal_Int16 eVertOri, sal_Int16 eHoriOri, @@ -302,12 +302,11 @@ void SwHTMLParser::RegisterFlyFrm( SwFrmFmt *pFlyFmt ) SURROUND_THROUGHT == pFlyFmt->GetSurround().GetSurround() ) { aMoveFlyFrms.Insert( pFlyFmt, aMoveFlyFrms.Count() ); - aMoveFlyCnts.Insert( pPam->GetPoint()->nContent.GetIndex(), - aMoveFlyCnts.Count() ); + aMoveFlyCnts.push_back( pPam->GetPoint()->nContent.GetIndex() ); } } -/* */ +/* */ void SwHTMLParser::GetDefaultScriptType( ScriptType& rType, String& rTypeStr ) const @@ -319,7 +318,7 @@ void SwHTMLParser::GetDefaultScriptType( ScriptType& rType, rTypeStr = GetScriptTypeString( pHeaderAttrs ); } -/* */ +/* */ void SwHTMLParser::InsertImage() { @@ -816,7 +815,7 @@ IMAGE_SETEVENT: InsertBookmark( aId ); } -/* */ +/* */ void SwHTMLParser::InsertBodyOptions() { @@ -1047,7 +1046,7 @@ void SwHTMLParser::InsertBodyOptions() InsertBookmark( aId ); } -/* */ +/* */ void SwHTMLParser::NewAnchor() { @@ -1268,7 +1267,7 @@ void SwHTMLParser::EndAnchor() EndTag( HTML_ANCHOR_OFF ); } -/* */ +/* */ void SwHTMLParser::InsertBookmark( const String& rName ) { @@ -1324,7 +1323,7 @@ BOOL SwHTMLParser::HasCurrentParaBookmarks( BOOL bIgnoreStack ) const return bHasMarks; } -/* */ +/* */ void SwHTMLParser::StripTrailingPara() { diff --git a/sw/source/filter/html/makefile.mk b/sw/source/filter/html/makefile.mk index b99cc67894..495a415d02 100644 --- a/sw/source/filter/html/makefile.mk +++ b/sw/source/filter/html/makefile.mk @@ -71,7 +71,9 @@ SLOFILES = \ $(SLO)$/SwAppletImpl.obj \ EXCEPTIONSFILES = \ + $(SLO)$/htmlatr.obj \ $(SLO)$/htmlfld.obj \ + $(SLO)$/htmlgrin.obj \ $(SLO)$/htmlplug.obj \ $(SLO)$/htmlsect.obj \ $(SLO)$/swhtml.obj \ diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index a15300b76c..6da1f4d4f1 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -2881,7 +2881,7 @@ void SwHTMLParser::_SetAttr( BOOL bChkEnd, BOOL bBeforeTable, pFrmFmt->MakeFrms(); aMoveFlyFrms.Remove( n, 1 ); - aMoveFlyCnts.Remove( n, 1 ); + aMoveFlyCnts.erase( aMoveFlyCnts.begin() + n ); } } while( aFields.Count() ) diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index 7f5fb3cdbe..caacc864a9 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -406,8 +406,8 @@ class SwHTMLParser : public SfxHTMLParser, public SwClient _HTMLAttrs aParaAttrs; // vorlauefige Absatz-Attribute _HTMLAttrTable aAttrTab; // "offene" Attribute _HTMLAttrContexts aContexts;// der aktuelle Attribut/Token-Kontext - SwHTMLFrmFmts aMoveFlyFrms;// Fly-Frames, deren Anker verschoben wird - SvXub_StrLens aMoveFlyCnts;// und deren Content-Positionen + SwHTMLFrmFmts aMoveFlyFrms;// Fly-Frames, the anchor is moved + SvXub_StrLens aMoveFlyCnts;// and the Content-Positions SwApplet_Impl *pAppletImpl; // das aktuelle Applet diff --git a/sw/source/filter/rtf/makefile.mk b/sw/source/filter/rtf/makefile.mk index 2ff764d730..a81164487a 100644 --- a/sw/source/filter/rtf/makefile.mk +++ b/sw/source/filter/rtf/makefile.mk @@ -46,18 +46,17 @@ CDEFS=$(CDEFS) -Dmydebug EXCEPTIONSFILES= \ $(SLO)$/rtffly.obj \ $(SLO)$/rtfnum.obj \ + $(SLO)$/rtftbl.obj \ $(SLO)$/swparrtf.obj \ - $(SLO)$/wrtrtf.obj + $(SLO)$/rtffld.obj SLOFILES = \ - $(SLO)$/rtfatr.obj \ $(SLO)$/rtffld.obj \ $(SLO)$/rtffly.obj \ $(SLO)$/rtfnum.obj \ $(SLO)$/rtftbl.obj \ - $(SLO)$/swparrtf.obj \ - $(SLO)$/wrtrtf.obj + $(SLO)$/swparrtf.obj # --- Tagets ------------------------------------------------------- diff --git a/sw/source/filter/rtf/rtfatr.cxx b/sw/source/filter/rtf/rtfatr.cxx deleted file mode 100644 index 4a3f53ad81..0000000000 --- a/sw/source/filter/rtf/rtfatr.cxx +++ /dev/null @@ -1,4356 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sw.hxx" -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ - -/* - * Dieses File enthaelt alle Ausgabe-Funktionen des RTF-Writers; - * fuer alle Nodes, Attribute, Formate und Chars. - */ -#include <hintids.hxx> - -#include <com/sun/star/i18n/ScriptType.hdl> -#include <vcl/cvtgrf.hxx> -#include <svl/urihelper.hxx> -#include <svl/stritem.hxx> -#include <svtools/rtfkeywd.hxx> -#include <svl/whiter.hxx> -#include <svtools/rtfout.hxx> -#include <svl/itemiter.hxx> -#include <editeng/fontitem.hxx> -#include <editeng/hyznitem.hxx> -#include <editeng/tstpitem.hxx> -#include <editeng/lspcitem.hxx> -#include <editeng/langitem.hxx> -#include <editeng/keepitem.hxx> -#include <editeng/udlnitem.hxx> -#include <editeng/shaditem.hxx> -#include <editeng/cmapitem.hxx> -#include <editeng/brshitem.hxx> -#include <editeng/protitem.hxx> -#include <editeng/opaqitem.hxx> -#include <editeng/ulspitem.hxx> -#include <editeng/prntitem.hxx> -#include <editeng/colritem.hxx> -#include <editeng/escpitem.hxx> -#include <editeng/fhgtitem.hxx> -#include <editeng/spltitem.hxx> -#include <editeng/adjitem.hxx> -#include <editeng/lrspitem.hxx> -#include <editeng/boxitem.hxx> -#include <editeng/crsditem.hxx> -#include <editeng/cntritem.hxx> -#include <editeng/postitem.hxx> -#include <editeng/shdditem.hxx> -#include <editeng/wghtitem.hxx> -#include <editeng/wrlmitem.hxx> -#include <editeng/emphitem.hxx> -#include <editeng/twolinesitem.hxx> -#include <editeng/charscaleitem.hxx> -#include <editeng/charrotateitem.hxx> -#include <editeng/charreliefitem.hxx> -#include <svx/xoutbmp.hxx> -#include <editeng/paravertalignitem.hxx> -#include <editeng/hngpnctitem.hxx> -#include <editeng/scriptspaceitem.hxx> -#include <editeng/forbiddenruleitem.hxx> -#include <editeng/frmdiritem.hxx> -#include <editeng/charhiddenitem.hxx> -#include <unotools/charclass.hxx> -#include <reffld.hxx> -#include <frmatr.hxx> -#include <charatr.hxx> -#include <fmtfsize.hxx> -#include <fmtpdsc.hxx> -#include <fmtfld.hxx> -#include <fmtflcnt.hxx> -#include <fmtftn.hxx> -#include <fchrfmt.hxx> -#include <fmtautofmt.hxx> -#include <fmtcntnt.hxx> -#include <fmthdft.hxx> -#include <fmtclds.hxx> -#include <txtftn.hxx> -#include <fmtsrnd.hxx> -#include <fmtanchr.hxx> -#include <charfmt.hxx> -#include <fmtinfmt.hxx> -#include <txtinet.hxx> -#include <doc.hxx> -#include <docary.hxx> -#include <ndtxt.hxx> -#include <pam.hxx> -#include <paratr.hxx> -#include <fldbas.hxx> // fuer SwField ... -#include <wrtrtf.hxx> -#include <rtf.hxx> // fuer SwPictureType -#include <ndgrf.hxx> -#include <grfatr.hxx> -#include <docufld.hxx> -#include <flddat.hxx> -#include <pagedesc.hxx> // fuer SwPageDesc ... -#include <swtable.hxx> // fuer SwPageDesc ... -#include <docsh.hxx> -#include <swrect.hxx> -#include <section.hxx> -#include <wrtswtbl.hxx> -#include <htmltbl.hxx> -#include <fmtclbl.hxx> -#include <breakit.hxx> -#include <fmtruby.hxx> -#include <txtatr.hxx> -#include <fltini.hxx> -#include <fmtrowsplt.hxx> - -/* - * um nicht immer wieder nach einem Update festzustellen, das irgendwelche - * Hint-Ids dazugekommen sind, wird hier definiert, die Groesse der Tabelle - * definiert und mit der akt. verglichen. Bei unterschieden wird der - * Compiler schon meckern. - * - * diese Section und die dazugeherigen Tabellen muessen in folgenden Files - * gepflegt werden: rtf\rtfatr.cxx, sw6\sw6atr.cxx, w4w\w4watr.cxx - */ -#if !defined(UNX) && !defined(MSC) && !defined(PPC) && !defined(CSET) && !defined(__MWERKS__) && !defined(WTC) && !defined(__MINGW32__) && !defined(OS2) - -#define ATTRFNTAB_SIZE 130 -#if ATTRFNTAB_SIZE != POOLATTR_END - POOLATTR_BEGIN -#error Attribut-Tabelle ist ungueltigt. Wurden neue Hint-IDs zugefuegt ?? -#endif - -#ifdef FORMAT_TABELLE -// da sie nicht benutzt wird! -#define FORMATTAB_SIZE 7 -#if FORMATTAB_SIZE != RES_FMT_END - RES_FMT_BEGIN -#error Format-Tabelle ist ungueltigt. Wurden neue Hint-IDs zugefuegt ?? -#endif -#endif - -#define NODETAB_SIZE 3 -#if NODETAB_SIZE != RES_NODE_END - RES_NODE_BEGIN -#error Node-Tabelle ist ungueltigt. Wurden neue Hint-IDs zugefuegt ?? -#endif - -#endif - -#ifdef WNT -// ueber xoutbmp.hxx wird das winuser.h angezogen. Dort gibt es ein -// define GetProp das mit unserem SvxEscapement kollidiert! -#undef GetProp -#endif - - -using namespace com::sun::star; - -//----------------------------------------------------------------------- - -static Writer& OutRTF_SwFmtCol( Writer& rWrt, const SfxPoolItem& rHt ); - -//----------------------------------------------------------------------- - -SvStream& OutComment( Writer& rWrt, const sal_Char* pStr ) -{ - return (rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << pStr); -} - -SvStream& OutComment( Writer& rWrt, const char* pStr, BOOL bSetFlag ) -{ - // setze Flag, damit bei der Ausgabe von Attributen zu erkennen, - // ob ueberhaupt etwas ausgegeben wurde. - ((SwRTFWriter&)rWrt).bOutFmtAttr = bSetFlag; - return (rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << pStr); -} - -Writer& OutRTF_AsByteString( Writer& rWrt, const String& rStr, rtl_TextEncoding eEncoding) -{ - ByteString sOutStr( rStr, eEncoding ); - rWrt.Strm() << sOutStr.GetBuffer(); - return rWrt; -} - -void OutRTF_SfxItemSet( SwRTFWriter& rWrt, const SfxItemSet& rSet, - BOOL bDeep ) -{ - bool bFrameDirOut=false; - bool bAdjustOut=false; - // erst die eigenen Attribute ausgeben - SvPtrarr aAsian( 0, 5 ), aCmplx( 0, 5 ), aLatin( 0, 5 ); - - const SfxItemPool& rPool = *rSet.GetPool(); - SfxWhichIter aIter( rSet ); - const SfxPoolItem* pItem; - FnAttrOut pOut; - USHORT nWhich = aIter.FirstWhich(); - while( nWhich ) - { - if( SFX_ITEM_SET == rSet.GetItemState( nWhich, bDeep, &pItem )) - { - pOut = aRTFAttrFnTab[ nWhich - RES_CHRATR_BEGIN]; - if( pOut && - ( *pItem != rPool.GetDefaultItem( nWhich ) - || ( rSet.GetParent() && - *pItem != rSet.GetParent()->Get( nWhich ) ) - || ( rWrt.GetAttrSet() && - *pItem != rWrt.GetAttrSet()->Get( nWhich ) ) - ) ) - ; - else - pOut = 0; - } - else if( !bDeep ) - pOut = 0; - else if( 0 != ( pItem = rPool.GetPoolDefaultItem( nWhich )) ) - pOut = aRTFAttrFnTab[ nWhich - RES_CHRATR_BEGIN]; - else - pOut = 0; - - if (!pOut && bDeep) - { - switch( nWhich ) - { - case RES_CHRATR_FONTSIZE: - case RES_CHRATR_CJK_FONTSIZE: - case RES_CHRATR_CTL_FONTSIZE: - case RES_CHRATR_LANGUAGE: - case RES_CHRATR_CJK_LANGUAGE: - case RES_CHRATR_CTL_LANGUAGE: - pItem = &rPool.GetDefaultItem( nWhich ); - pOut = aRTFAttrFnTab[ nWhich - RES_CHRATR_BEGIN]; - break; - default: - break; - } - } - - if( pOut ) - { - void* pVoidItem = (void*)pItem; - switch( nWhich ) - { - case RES_CHRATR_FONT: - case RES_CHRATR_FONTSIZE: - case RES_CHRATR_LANGUAGE: - case RES_CHRATR_POSTURE: - case RES_CHRATR_WEIGHT: - aLatin.Insert( pVoidItem, aLatin.Count() ); - pOut = 0; - break; - - case RES_CHRATR_CJK_FONT: - case RES_CHRATR_CJK_FONTSIZE: - case RES_CHRATR_CJK_LANGUAGE: - case RES_CHRATR_CJK_POSTURE: - case RES_CHRATR_CJK_WEIGHT: - aAsian.Insert( pVoidItem, aAsian.Count() ); - pOut = 0; - break; - - case RES_CHRATR_CTL_FONT: - case RES_CHRATR_CTL_FONTSIZE: - case RES_CHRATR_CTL_LANGUAGE: - case RES_CHRATR_CTL_POSTURE: - case RES_CHRATR_CTL_WEIGHT: - aCmplx.Insert( pVoidItem, aCmplx.Count() ); - pOut = 0; - break; - - case RES_FRAMEDIR: - bFrameDirOut=true; - break; - case RES_PARATR_ADJUST: - bAdjustOut=true; - break; - } - } - - if (pOut) - (*pOut)( rWrt, *pItem ); - nWhich = aIter.NextWhich(); - } - - //If rtlpar set and no following alignment. And alignment is not rtl then - //output alignment - if (bFrameDirOut && !bAdjustOut && !rWrt.pFlyFmt && !rWrt.bOutPageDesc) - { - pOut = aRTFAttrFnTab[ static_cast< USHORT >(RES_PARATR_ADJUST) - RES_CHRATR_BEGIN]; - if (pOut) - (*pOut)(rWrt, rSet.Get(RES_PARATR_ADJUST)); - } - if (rWrt.pFlyFmt && !rWrt.bOutPageDesc && !bFrameDirOut) - { - pOut = aRTFAttrFnTab[ static_cast< USHORT >(RES_FRAMEDIR) - RES_CHRATR_BEGIN]; - if (pOut) - (*pOut)(rWrt, rSet.Get(RES_FRAMEDIR)); - } - - if (aAsian.Count() || aCmplx.Count() || aLatin.Count()) - { - SvPtrarr* aArr[4]; - switch (rWrt.GetCurrScriptType()) - { - case i18n::ScriptType::LATIN: - aArr[ 0 ] = &aCmplx; - aArr[ 1 ] = &aAsian; - aArr[ 2 ] = &aLatin; - aArr[ 3 ] = &aLatin; - break; - - case i18n::ScriptType::ASIAN: - aArr[ 0 ] = &aCmplx; - aArr[ 1 ] = &aLatin; - aArr[ 2 ] = &aLatin; - aArr[ 3 ] = &aAsian; - break; - - case i18n::ScriptType::COMPLEX: - aArr[ 0 ] = &aLatin; - aArr[ 1 ] = &aLatin; - aArr[ 2 ] = &aAsian; - aArr[ 3 ] = &aCmplx; - break; - - default: - return ; - } - - //The final entry is the one that is actually in use - //so it uses e.g. \b \i \fs, the others are not in - //use and so are "associated". Both asian and western - //are ltr runs, with asian being the dbch varient - //and western being the loch/hich varient - bool bOutLTOR = true; - bool bLowLTOR = false; - for( int nArrCnt = 0; nArrCnt < 4; ++nArrCnt ) - { - SvPtrarr* pCurArr = aArr[ nArrCnt ]; - if (pCurArr->Count()) - { - bool bInUse = (aArr[nArrCnt] == aArr[3]); - rWrt.SetAssociatedFlag(!bInUse); - if (pCurArr == &aLatin) - { - if (bOutLTOR) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LTRCH; - bOutLTOR = false; - } - - if (bLowLTOR) - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LOCH; - else - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_HICH; - bLowLTOR = true; - } - } - else if( pCurArr == &aAsian ) - { - if( bOutLTOR ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LTRCH; - bOutLTOR = false; - } - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_DBCH; - } - else - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_RTLCH; - - for (USHORT n = 0; n < pCurArr->Count(); ++n) - { - pItem = (const SfxPoolItem*)(*pCurArr)[ n ]; - pOut = aRTFAttrFnTab[ pItem->Which() - RES_CHRATR_BEGIN]; - (*pOut)( rWrt, *pItem ); - } - } - } - } -} - -// fuer die Formate muesste eine einzige Ausgabe-Funktion genuegen ! -/* - * Formate wie folgt ausgeben: - * - gebe alle Attribute vom Format aus - */ - -bool SwFmtToSet(SwRTFWriter& rWrt, const SwFmt& rFmt, SfxItemSet &rSet) -{ - bool bOutItemSet = true; - rSet.SetParent(rFmt.GetAttrSet().GetParent()); - - switch( rFmt.Which() ) - { - case RES_CONDTXTFMTCOLL: - case RES_TXTFMTCOLL: - { - USHORT nId = rWrt.GetId( (const SwTxtFmtColl&)rFmt ); - if (0 == nId ) - return false; // Default-TextStyle nicht ausgeben !! - - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_S; - rWrt.OutULong( nId ); - rWrt.bOutFmtAttr = TRUE; -// BYTE nLvl = ((const SwTxtFmtColl&)rFmt).GetOutlineLevel(); //#outline level,zhaojianwei -// if( MAXLEVEL > nLvl ) -// { - if(((const SwTxtFmtColl&)rFmt).IsAssignedToListLevelOfOutlineStyle()) - { - int nLvl = ((const SwTxtFmtColl&)rFmt).GetAssignedOutlineStyleLevel(); //<-end,zhaojianwei - USHORT nNumId = rWrt.GetNumRuleId( - *rWrt.pDoc->GetOutlineNumRule() ); - if( USHRT_MAX != nNumId ) - { - BYTE nWWLvl = 8 >= nLvl ? static_cast<BYTE>(nLvl) : 8; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LS; - rWrt.OutULong( nNumId ); - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_ILVL; rWrt.OutULong( nWWLvl ); - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_OUTLINELEVEL; rWrt.OutULong( nWWLvl ); - if( nWWLvl != nLvl ) // RTF-kennt nur 9 Ebenen - { - OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_SOUTLVL ); - rWrt.OutULong( nLvl ) << '}'; - } - } - - const SwNumFmt* pNFmt = &rWrt.pDoc->GetOutlineNumRule()->Get( static_cast<USHORT>(nLvl) ); - if( pNFmt->GetAbsLSpace() ) - { - SfxItemSet aSet( *rFmt.GetAttrSet().GetPool(), - rFmt.GetAttrSet().GetRanges() ); - aSet.SetParent( &rFmt.GetAttrSet() ); - SvxLRSpaceItem aLR( (SvxLRSpaceItem&)aSet.Get( RES_LR_SPACE ) ); - - aLR.SetTxtLeft( aLR.GetTxtLeft() + pNFmt->GetAbsLSpace() ); - aLR.SetTxtFirstLineOfst( pNFmt->GetFirstLineOffset() ); - - aSet.Put(aLR); - rSet.Put(aSet); - bOutItemSet = false; - } - } - } - break; - case RES_CHRFMT: - { - USHORT nId = rWrt.GetId( (const SwCharFmt&)rFmt ); - if (0 == nId) - return false; // Default-CharStyle nicht ausgeben !! - - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_CS; - rWrt.OutULong( nId ); - rWrt.bOutFmtAttr = TRUE; - } - break; - -// case RES_GRFFMTCOLL: -// ????? - } - - if (bOutItemSet) - rSet.Put(rFmt.GetAttrSet()); - - return true; -} - -Writer& OutRTF_SwFmt(Writer& rWrt, const SwFmt& rFmt) -{ - SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt; - - SfxItemSet aSet(*rFmt.GetAttrSet().GetPool(), - rFmt.GetAttrSet().GetRanges() ); - if (SwFmtToSet(rRTFWrt, rFmt, aSet)) - OutRTF_SfxItemSet(rRTFWrt, aSet, TRUE); - - return rWrt; -} - -void OutRTF_SwFlyFrmFmt( SwRTFWriter& rRTFWrt ) -{ - // ist der aktuelle Absatz in einem freifliegenden Rahmen ? Dann - // muessen noch die Attribute dafuer ausgegeben werden. - ASSERT( rRTFWrt.pFlyFmt, "wo ist das Fly-Format?" ); - - if( rRTFWrt.bOutFmtAttr ) - { - rRTFWrt.Strm() << ' '; - rRTFWrt.bOutFmtAttr = false; - } - // gebe erstmal alle RTF-Spezifischen Attribute aus - rRTFWrt.bRTFFlySyntax = TRUE; - OutRTF_SwFmt( rRTFWrt, *rRTFWrt.pFlyFmt ); - - // dann gebe alle eigenen Attribute aus - { - // dazu erzeuge einen temp strstream, um festzustellen ob es - // ueberhaupt eigene Attribute gibt ! - SvMemoryStream aTmpStrm; - SvStream* pSaveStrm = &rRTFWrt.Strm(); - rRTFWrt.SetStream( &aTmpStrm ); - - rRTFWrt.bRTFFlySyntax = false; - OutRTF_SwFmt( rRTFWrt, *rRTFWrt.pFlyFmt ); - - rRTFWrt.SetStream( pSaveStrm ); // Stream-Pointer wieder zurueck - - if ( aTmpStrm.GetEndOfData() ) // gibt es SWG spezifische Attribute? - { - aTmpStrm.Seek( 0L ); - rRTFWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << aTmpStrm << '}'; - } - } -// rRTFWrt.pFlyFmt = 0; // wieder zuruecksetzen !! -} - -/* Ausgabe der Nodes */ - -/* - * Ausgabe der Texte-Attribute: - * Die Text-Attribute sind in einem VarArray nach ihren Start-Positionen - * sortiert. Fuer den RTF-Writer ist aber auch das Ende von Bedeutung. - * Darum die Idee, sobald im SwpHints-Array ein Attribut mit der Start- - * Position gefunden wurde, in einem Sortierten-Array die Endposition - * zu speichern. Sobald der Writer die Position erreicht hat, wird die - * schliessende Klammer ausgegeben und die Position aus dem Sort.Array - * geloescht. - * 15.3.93: Es reicht leider nicht aus nur Start und End zuspeichern, denn - * im SwpHints Array stehen sie nicht nach Ende sortiert, so dass - * Attribute die falsche schliessende Klammer bekommen. (z.B - * Bold von 0..3, dann folgt Underline von 0..4. Dann bekommt Underline - * die schliessende Klammer von Bold !!) - * Also muessen erst alle Attribute einer Position gesammelt, nach - * Ende sortiert und dann erst ausgegeben werden. - */ - -SV_DECL_PTRARR( SfxPoolItems, SfxPoolItem*, 4, 4 ) -class RTFEndPosLst; - -class SttEndPos -{ - // falls mehrere Attribute den gleichen Bereich umspannen, sammeln - SfxPoolItems aArr; - xub_StrLen nStart, nEnd; - - SttEndPos( const SttEndPos & rSEPos ); - -public: - SttEndPos( const SfxPoolItem& rAttr, xub_StrLen nStt, xub_StrLen nEnd ); - ~SttEndPos(); - - xub_StrLen GetStart() const { return nStart; } - xub_StrLen GetEnd() const { return nEnd; } - - const SfxPoolItems& GetAttrs() const { return aArr; } - void AddAttr( const SfxPoolItem& rAttr ); - BOOL HasScriptChange() const; -}; - - -SV_DECL_PTRARR_DEL( _EndPosLst, SttEndPos*, 5, 5 ) -SV_IMPL_PTRARR( _EndPosLst, SttEndPos* ) - -class RTFEndPosLst : private _EndPosLst -{ - const SwTxtNode& rNode; - SwRTFWriter& rWrt; - RTFEndPosLst* pOldPosLst; - xub_StrLen nCurPos; - USHORT nCurScript; - -public: - using _EndPosLst::Count; - using _EndPosLst::operator[]; - using _EndPosLst::DeleteAndDestroy; - - RTFEndPosLst( SwRTFWriter& rWrt, const SwTxtNode& rNd, xub_StrLen nStart ); - ~RTFEndPosLst(); - - USHORT GetCurScript() const { return nCurScript; } - BOOL MatchScriptToId( USHORT nId ) const; - int Insert( const SfxPoolItem& rAttr, xub_StrLen nStt, xub_StrLen nEnd ); - - void OutAttrs( xub_StrLen nStrPos ); - void EndAttrs( xub_StrLen nStrPos ); - void OutScriptChange( xub_StrLen nStrPos ); - - const SfxPoolItem* HasItem( USHORT nWhich ) const; - const SfxPoolItem& GetItem( USHORT nWhich ) const; - void OutFontAttrs(const SfxPoolItem &rItem); - void OutFontAttrs(USHORT nScript, bool bRTL); - - SfxItemPool& GetPool() {return *rNode.GetSwAttrSet().GetPool(); } -}; - - -SttEndPos::SttEndPos( const SfxPoolItem& rAttr, - xub_StrLen nStt, xub_StrLen nEd ) - : nStart( nStt ), nEnd( nEd ) -{ - AddAttr( rAttr ); -} - -SttEndPos::~SttEndPos() -{ - for( USHORT n = 0, nCount = aArr.Count(); n < nCount; ++n ) - if( RES_FLTRATTR_BEGIN <= aArr[ n ]->Which() ) - delete aArr[ n ]; -} - -BOOL SttEndPos::HasScriptChange() const -{ - for( USHORT n = 0, nCount = aArr.Count(); n < nCount; ++n ) - if( RES_FLTR_SCRIPTTYPE == aArr[ n ]->Which() ) - return TRUE; - return FALSE; -} - -void SttEndPos::AddAttr( const SfxPoolItem& rAttr ) -{ - const SfxPoolItem* pI = &rAttr; - aArr.Insert(pI, aArr.Count()); -} - -RTFEndPosLst::RTFEndPosLst(SwRTFWriter& rWriter, const SwTxtNode& rNd, - xub_StrLen nStart) - : rNode(rNd), rWrt(rWriter), nCurPos(STRING_NOTFOUND) -{ - pOldPosLst = rWrt.pCurEndPosLst; - rWrt.pCurEndPosLst = this; - - using namespace sw::util; - CharRuns aCharRuns(GetPseudoCharRuns(rNd, nStart)); - cCharRunIter aEnd = aCharRuns.end(); - xub_StrLen nSttPos = nStart; - for (cCharRunIter aI = aCharRuns.begin(); aI != aEnd; ++aI) - { - if (nSttPos != aI->mnEndPos) - { - SfxPoolItem* pChg = new SfxUInt32Item(RES_FLTR_SCRIPTTYPE, - (sal_uInt32(aI->mnScript) << 16) | static_cast<sal_uInt32>(aI->mbRTL)); - Insert(*pChg, nSttPos, aI->mnEndPos); - nSttPos = aI->mnEndPos; - } - } -} - -RTFEndPosLst::~RTFEndPosLst() -{ - rWrt.pCurEndPosLst = pOldPosLst; -} - -int RTFEndPosLst::Insert( const SfxPoolItem& rAttr, xub_StrLen nStt, - xub_StrLen nEnd ) -{ - if (rAttr.Which() == RES_TXTATR_INETFMT) - return false; - - if( nStt == nEnd ) - return false; - - USHORT nPos; - for( nPos = 0; nPos < Count(); ++nPos ) - { - SttEndPos* pTmp = GetObject( nPos ); - if( pTmp->GetStart() == nStt && pTmp->GetEnd() == nEnd ) - { - pTmp->AddAttr( rAttr ); - return false; // schon vorhanden - } - if( nEnd < pTmp->GetEnd() ) - { - SttEndPos* pNew = new SttEndPos( rAttr, nStt, nEnd ); - _EndPosLst::C40_INSERT( SttEndPos, pNew, nPos ); - return TRUE; - } - } - - SttEndPos* pNew = new SttEndPos( rAttr, nStt, nEnd ); - _EndPosLst::C40_INSERT( SttEndPos, pNew, nPos ); - return TRUE; -} - -void RTFEndPosLst::OutScriptChange( xub_StrLen nStrPos ) -{ - SttEndPos* pStt; - for( USHORT n = 0, nEnd = Count(); n < nEnd; ++n ) - if( nStrPos == (pStt = GetObject( n ))->GetStart()) - { - if( pStt->HasScriptChange() ) - OutAttrs( nStrPos ); - break; - } -} - -void RTFEndPosLst::OutAttrs( xub_StrLen nStrPos ) -{ - SttEndPos* pStt; - nCurPos = nStrPos; - for( USHORT n = Count(); n ; ) - if( nStrPos == (pStt = (*this)[ --n ])->GetStart() ) - { - rWrt.Strm() << '{'; - for( USHORT i = 0; i < pStt->GetAttrs().Count(); ++i ) - { - const SfxPoolItem* pItem = pStt->GetAttrs()[i]; - if( RES_FLTR_SCRIPTTYPE == pItem->Which() ) - OutFontAttrs(*pItem); - else - Out( aRTFAttrFnTab, *pItem, rWrt ); - } - } - - nCurPos = STRING_NOTFOUND; -} - -//Just a little decoding hack for the RES_FLTR_SCRIPTTYPE thing -void RTFEndPosLst::OutFontAttrs(const SfxPoolItem &rItem) -{ - sal_uInt32 nValue = ((const SfxUInt32Item&)rItem).GetValue(); - sal_uInt16 nScript = static_cast<sal_uInt16>(nValue >> 16); - bool bBiDi = nValue & 0x1; - OutFontAttrs(nScript, bBiDi); -} - -void RTFEndPosLst::OutFontAttrs(USHORT nScript, bool bRTL) -{ - // script change, write the correct attributes: - // start first with the Fontname - - rWrt.bOutFmtAttr = TRUE; - nCurScript = nScript; - rWrt.SetCurrScriptType( nScript ); - rWrt.SetAssociatedFlag(false); - - // the font MUST be at the first position !!! - static const USHORT aLatinIds[] = - { - RES_CHRATR_FONT, - RES_CHRATR_FONTSIZE, RES_CHRATR_LANGUAGE, - RES_CHRATR_POSTURE, RES_CHRATR_WEIGHT, - 0 - }; - static const USHORT aAsianIds[] = - { - RES_CHRATR_CJK_FONT, - RES_CHRATR_CJK_FONTSIZE, RES_CHRATR_CJK_LANGUAGE, - RES_CHRATR_CJK_POSTURE, RES_CHRATR_CJK_WEIGHT, - 0 - }; - static const USHORT aCmplxIds[] = - { - RES_CHRATR_CTL_FONT, - RES_CHRATR_CTL_FONTSIZE, RES_CHRATR_CTL_LANGUAGE, - RES_CHRATR_CTL_POSTURE, RES_CHRATR_CTL_WEIGHT, - 0 - }; - - /* - You would have thought that - rWrt.Strm() << (bRTL ? OOO_STRING_SVTOOLS_RTF_RTLCH : OOO_STRING_SVTOOLS_RTF_LTRCH); would be sufficent here , - but looks like word needs to see the other directional token to be - satisified that all is kosher, otherwise it seems in ver 2003 to go and - semi-randomlyly stick strike through about the place. Perhaps - strikethrough is some ms developers "something is wrong signal" debugging - code that we're triggering ? - */ - if (bRTL) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LTRCH; - rWrt.Strm() << ' '; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_RTLCH; - } - else - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_RTLCH; - rWrt.Strm() << ' '; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LTRCH; - } - - // size/weight/posture optional - const USHORT* pIdArr = 0; - ByteString sOut; - switch (nScript) - { - default: //fall through - ASSERT(pIdArr, "unknown script, strange"); - case i18n::ScriptType::LATIN: - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LOCH; - pIdArr = aLatinIds; - break; - case i18n::ScriptType::ASIAN: - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_DBCH; - pIdArr = aAsianIds; - break; - case i18n::ScriptType::COMPLEX: - pIdArr = aCmplxIds; - break; - } - - for (const USHORT* pId = pIdArr; *pId; ++pId) - { - if (FnAttrOut pOut = aRTFAttrFnTab[ *pId - RES_CHRATR_BEGIN]) - { - const SfxPoolItem* pItem = HasItem(*pId); - if (!pItem) - pItem = &GetPool().GetDefaultItem(*pId); - (*pOut)(rWrt, *pItem); - } - } -} - -void RTFEndPosLst::EndAttrs( xub_StrLen nStrPos ) -{ - xub_StrLen nClipStart=STRING_MAXLEN; - bool bClosed=false; - SttEndPos* pSEPos; - while( 0 != Count() && 0 != (pSEPos = GetObject( 0 )) && - ( STRING_MAXLEN == nStrPos || nStrPos == pSEPos->GetEnd() )) - { - const SfxPoolItems& rAttrs = pSEPos->GetAttrs(); - for( USHORT nAttr = rAttrs.Count(); nAttr; ) - { - switch( rAttrs[ --nAttr ]->Which() ) - { - case RES_TXTATR_CJK_RUBY: - rWrt.Strm() << ")}{" << OOO_STRING_SVTOOLS_RTF_FLDRSLT << " }}"; - break; - } - } - - rWrt.Strm() << '}'; // end of all attributes from this position - if (pSEPos->GetStart() < nClipStart) - nClipStart = pSEPos->GetStart(); - bClosed=true; - DeleteAndDestroy( 0, 1 ); - } - - if (bClosed) - { - //If there are open ranges whose start is before this point, and whose - //start is after the cliping start then they have been closed whether - //we wanted this or not. So accept that fact and then restart then - //again - USHORT nSize = Count(); - while (nSize > 0) - { - pSEPos = GetObject(--nSize); - if ( pSEPos->GetStart() < nStrPos && - pSEPos->GetStart() >= nClipStart) - { - rWrt.Strm() << '}'; - } - } - - nSize = Count(); - USHORT n = 0; - while (n < nSize) - { - SttEndPos* pStt = (*this)[n++]; - if (pStt->GetStart() < nStrPos && pStt->GetStart() >= nClipStart) - { - rWrt.Strm() << '{'; - for( USHORT i = 0; i < pStt->GetAttrs().Count(); ++i ) - { - const SfxPoolItem* pItem = pStt->GetAttrs()[i]; - if( RES_FLTR_SCRIPTTYPE == pItem->Which() ) - OutFontAttrs(*pItem); - else - Out( aRTFAttrFnTab, *pItem, rWrt ); - } - } - } - } -} - -BOOL RTFEndPosLst::MatchScriptToId( USHORT nWhich ) const -{ - BOOL bRet = false; - switch( nWhich ) - { - case RES_CHRATR_FONT: - case RES_CHRATR_FONTSIZE: - case RES_CHRATR_LANGUAGE: - case RES_CHRATR_POSTURE: - case RES_CHRATR_WEIGHT: - bRet = nCurScript == i18n::ScriptType::LATIN; - break; - case RES_CHRATR_CJK_FONT: - case RES_CHRATR_CJK_FONTSIZE: - case RES_CHRATR_CJK_LANGUAGE: - case RES_CHRATR_CJK_POSTURE: - case RES_CHRATR_CJK_WEIGHT: - bRet = nCurScript == i18n::ScriptType::ASIAN; - break; - case RES_CHRATR_CTL_FONT: - case RES_CHRATR_CTL_FONTSIZE: - case RES_CHRATR_CTL_LANGUAGE: - case RES_CHRATR_CTL_POSTURE: - case RES_CHRATR_CTL_WEIGHT: - bRet = nCurScript == i18n::ScriptType::COMPLEX; - break; - } - return bRet; -} - -const SfxPoolItem& RTFEndPosLst::GetItem( USHORT nWhich ) const -{ - const SfxPoolItem* pItem = HasItem( nWhich ); - if( !pItem ) - pItem = &rNode.GetSwAttrSet().GetPool()->GetDefaultItem( nWhich ); - return *pItem; -} - -const SfxPoolItem* RTFEndPosLst::HasItem( USHORT nWhich ) const -{ - const SfxPoolItem* pItem; - if( RES_TXTATR_END > nWhich ) - { - // it's a character/text attribute so look into the item array - for( USHORT n = Count(); n; ) - { - SttEndPos* pTmp = GetObject( --n ); - for( USHORT i = pTmp->GetAttrs().Count(); i; ) - { - pItem = pTmp->GetAttrs()[ --i ]; - if( pItem->Which() == nWhich ) - return pItem; - - // look into the charfmt? - if( RES_TXTATR_CHARFMT == pItem->Which() && - ((SwFmtCharFmt*) pItem)->GetCharFmt() && - SFX_ITEM_SET == ((SwFmtCharFmt*) pItem)->GetCharFmt()-> - GetItemState( nWhich, TRUE, &pItem )) - return pItem; - } - } - } - - if( SFX_ITEM_SET != rNode.GetSwAttrSet().GetItemState( - nWhich, TRUE, &pItem )) - pItem = 0; - return pItem; -} - -const SfxPoolItem& SwRTFWriter::GetItem( USHORT nWhich ) const -{ - if( pCurEndPosLst ) - return pCurEndPosLst->GetItem( nWhich ); - if( pAttrSet ) - return pAttrSet->Get( nWhich ); - - return pDoc->GetAttrPool().GetDefaultItem( nWhich ); -} - -static void OutSvxFrmDir(SwRTFWriter& rRTFWrt, const SfxPoolItem& rHt ) -{ - // write it only for pasgedesc's - not for frames - SvxFrameDirectionItem aItem((const SvxFrameDirectionItem&)rHt); - USHORT nVal = 0; - const sal_Char* pStr = 0; - bool bRTL = false; - - if (rRTFWrt.pFlyFmt) - aItem.SetValue(rRTFWrt.TrueFrameDirection(*rRTFWrt.pFlyFmt)); - - switch (aItem.GetValue()) - { - case FRMDIR_ENVIRONMENT: - ASSERT(0, "Not expected to see FRMDIR_ENVIRONMENT here"); - break; - case FRMDIR_VERT_TOP_RIGHT: - nVal = 1; - pStr = OOO_STRING_SVTOOLS_RTF_FRMTXTBRLV; - break; - case FRMDIR_HORI_RIGHT_TOP: - bRTL = true; -// nVal = 3; -// A val of three isn't working as expected in word :-( so leave it -// as normal ltr 0 textflow with rtl sect property, neither does -// the frame textflow -// pStr = OOO_STRING_SVTOOLS_RTF_FRMTXTBRL; - break; - case FRMDIR_VERT_TOP_LEFT: - nVal = 4; - pStr = OOO_STRING_SVTOOLS_RTF_FRMTXLRTBV; - break; - } - - if( rRTFWrt.pFlyFmt && rRTFWrt.bRTFFlySyntax && pStr ) - { - rRTFWrt.Strm() << pStr; - rRTFWrt.bOutFmtAttr = TRUE; - } - else if( rRTFWrt.bOutPageDesc) - { - if (nVal) - { - rRTFWrt.Strm() << OOO_STRING_SVTOOLS_RTF_STEXTFLOW; - rRTFWrt.OutULong( nVal ); - } - if (bRTL) - rRTFWrt.Strm() << OOO_STRING_SVTOOLS_RTF_RTLSECT; - rRTFWrt.bOutFmtAttr = TRUE; - } - else if (!rRTFWrt.pFlyFmt && !rRTFWrt.bOutPageDesc) - { - rRTFWrt.Strm() << (bRTL ? OOO_STRING_SVTOOLS_RTF_RTLPAR : OOO_STRING_SVTOOLS_RTF_LTRPAR); - rRTFWrt.bOutFmtAttr = TRUE; - } -} - -void OutRTF_SwRTL(SwRTFWriter& rWrt, const SwTxtNode *pNd) -{ - if (!pNd) - return; - SvxFrameDirection eDir = FRMDIR_ENVIRONMENT; - if (const SvxFrameDirectionItem* pItem = (const SvxFrameDirectionItem*) - pNd->GetSwAttrSet().GetItem(RES_FRAMEDIR)) - { - eDir = static_cast<SvxFrameDirection>(pItem->GetValue()); - } - if (eDir == FRMDIR_ENVIRONMENT) - { - SwPosition aPos(*pNd); - eDir = - static_cast<SvxFrameDirection>(rWrt.pDoc->GetTextDirection(aPos)); - } - OutSvxFrmDir(rWrt, SvxFrameDirectionItem(eDir, RES_FRAMEDIR)); -} - -static Writer& OutRTF_SwTxtINetFmt( Writer& rWrt, const SfxPoolItem& rHt ) -{ - const SwFmtINetFmt& rURL = (const SwFmtINetFmt&)rHt; - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - if( rURL.GetValue().Len() ) - { - rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_FIELD << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE - << OOO_STRING_SVTOOLS_RTF_FLDINST << " HYPERLINK "; - - String sURL( rURL.GetValue() ); - if( INET_MARK_TOKEN != sURL.GetChar(0) ) - { - INetURLObject aTmp( URIHelper::simpleNormalizedMakeRelative(rWrt.GetBaseURL(), - sURL)); - - - sURL = aTmp.GetURLNoMark( INetURLObject::DECODE_UNAMBIGUOUS); -/* if( INET_PROT_FILE == aTmp.GetProtocol() ) - { - // WW97 wollen keine FILE-URL haben, sondern einen normalen - // Dateinamen. Aber ab WW2000 kennen sie FileURLs. - sURL = aTmp.GetFull(); - } -*/ rWrt.Strm() << '\"'; - RTFOutFuncs::Out_String( rWrt.Strm(), sURL, rRTFWrt.eCurrentEncoding, - rRTFWrt.bWriteHelpFmt ) << "\" "; - sURL = aTmp.GetMark(); - } - - if( sURL.Len() ) - { - rWrt.Strm() << "\\\\l \""; - sURL.Erase( 0, 1 ); - RTFOutFuncs::Out_String( rWrt.Strm(), sURL, rRTFWrt.eCurrentEncoding, - rRTFWrt.bWriteHelpFmt ) << "\" "; - } - - if( rURL.GetTargetFrame().Len() ) - { - rWrt.Strm() << "\\\\t \""; - RTFOutFuncs::Out_String( rWrt.Strm(), rURL.GetTargetFrame(), - rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ) << "\" "; - } - - rWrt.Strm() << "}{" << OOO_STRING_SVTOOLS_RTF_FLDRSLT << ' '; - rRTFWrt.bOutFmtAttr = false; - - // und dann noch die Attributierung ausgeben - const SwCharFmt* pFmt; - const SwTxtINetFmt* pTxtAtr = rURL.GetTxtINetFmt(); - if( pTxtAtr && 0 != ( pFmt = pTxtAtr->GetCharFmt() )) - OutRTF_SwFmt( rWrt, *pFmt ); - } - return rWrt; -} - -void HandleHyperlinks(Writer& rWrt, const SwpHints* pTxtAttrs, xub_StrLen nPos ) -{ - USHORT nCount = pTxtAttrs ? pTxtAttrs->Count() : 0; - for(USHORT i = 0; i < nCount; ++i ) - { - const SwTxtAttr* pHt = (*pTxtAttrs)[i]; - const SfxPoolItem &rItem = pHt->GetAttr(); - if (rItem.Which() == RES_TXTATR_INETFMT) - { - const xub_StrLen* pEnd; - if (nPos == *pHt->GetStart()) - OutRTF_SwTxtINetFmt(rWrt, rItem); - if (0 != ( pEnd = pHt->GetEnd() ) && nPos == *pEnd) - { - // Hyperlinks werden als Felder geschrieben, aber der - // "FieldResult" // steht als Text im TextNode. Also muss bei - // diesen Attributen am // Ende 2 Klammern stehen! - rWrt.Strm() << "}}"; - } - } - } -} - -static Writer& OutRTF_SwTxtNode( Writer& rWrt, SwCntntNode& rNode ) -{ - SwTxtNode * pNd = &((SwTxtNode&)rNode); - SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt; - xub_StrLen nStrPos = rRTFWrt.pCurPam->GetPoint()->nContent.GetIndex(); - RTFEndPosLst aEndPosLst( rRTFWrt, *pNd, nStrPos ); - USHORT nAttrPos = 0; - - const String& rStr = pNd->GetTxt(); - xub_StrLen nEnde = rStr.Len(); - if( rRTFWrt.pCurPam->GetPoint()->nNode == rRTFWrt.pCurPam->GetMark()->nNode ) - nEnde = Min( nEnde, rRTFWrt.pCurPam->GetMark()->nContent.GetIndex() ); - - int bNewFmts = rRTFWrt.GetAttrSet() != &pNd->GetSwAttrSet(); - if( bNewFmts ) - { - // harte Attributierung am Node und am Vorgaenger ? - const SfxItemSet* pNdSet = pNd->GetpSwAttrSet(); - if( pNdSet && rRTFWrt.GetAttrSet() && rRTFWrt.bAutoAttrSet && - pNdSet->GetParent() == rRTFWrt.GetAttrSet()->GetParent() && - pNdSet->Count() == rRTFWrt.GetAttrSet()->Count() ) - { - // die beiden Parents sind gleich, dann teste doch mal die - // Attribute im Set - - int bEqual = TRUE; - if( pNdSet->Count() ) - { - SfxItemIter aIter( *rRTFWrt.GetAttrSet() ); - const SfxPoolItem *pItem, *pCurr = aIter.GetCurItem(); - while( TRUE ) - { - if( SFX_ITEM_SET != pNdSet->GetItemState( pCurr->Which(), - false, &pItem ) || *pItem != *pCurr ) - { - bEqual = false; - break; - } - - if( aIter.IsAtEnd() ) - break; - pCurr = aIter.NextItem(); - } - } - if (bEqual) - bNewFmts = false; - } - rRTFWrt.SetAttrSet( &pNd->GetSwAttrSet() ); - rRTFWrt.bAutoAttrSet = 0 != pNdSet; - } - - // Flag zuruecksetzen, damit nach der Ausgabe der Collection - // getestet werden kann, ob noch ein Blank auszugeben ist - rRTFWrt.bOutFmtAttr = false; - - // in der Ausgabe eines Flys? Dann vorm ausgeben der AbsatzAttribute - // den Format-Pointer auf 0 setzen! - const SwFlyFrmFmt* pSaveFmt = rRTFWrt.pFlyFmt; - - SfxItemSet aMergedSet(rRTFWrt.pDoc->GetAttrPool(), POOLATTR_BEGIN, - POOLATTR_END-1); - bool bDeep = false; - - if( rRTFWrt.bWriteAll ) - { - rRTFWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PARD << OOO_STRING_SVTOOLS_RTF_PLAIN << ' '; // alle Attribute zuruecksetzen - if( rRTFWrt.bOutTable ) - rRTFWrt.Strm() << OOO_STRING_SVTOOLS_RTF_INTBL; - - // ist der aktuelle Absatz in einem freifliegenden Rahmen ? Dann - // muessen noch die Attribute dafuer ausgegeben werden. - if( pSaveFmt ) - { - OutRTF_SwFlyFrmFmt( rRTFWrt ); - rRTFWrt.pFlyFmt = 0; - } - - rRTFWrt.OutListNum( *pNd ); - OutRTF_SwRTL(rRTFWrt, pNd); - SwFmtToSet(rRTFWrt, pNd->GetAnyFmtColl(), aMergedSet); - bDeep = true; - } - else if( !rRTFWrt.bWriteAll && rRTFWrt.bFirstLine ) - { - OutRTF_SwRTL(rRTFWrt, pNd); - SwFmtToSet(rRTFWrt, pNd->GetAnyFmtColl(), aMergedSet); - bDeep = true; - } - - // gibt es harte Attributierung ? - if( bNewFmts && pNd->HasSwAttrSet()) - { - rRTFWrt.pFlyFmt = 0; - - const SfxItemSet& rNdSet = pNd->GetSwAttrSet(); - - const SwNumRule* pRule = pNd->GetNumRule(); - // --> OD 2008-03-19 #refactorlists# - if ( pRule && pNd->IsInList() ) - // <-- - { - // --> OD 2008-03-18 #refactorlists# - ASSERT( pNd->GetActualListLevel() >= 0 && pNd->GetActualListLevel() < MAXLEVEL, - "<OutRTF_SwTxtNode(..)> - text node does not have valid list level. Serious defect -> please inform OD" ); - // <-- - BYTE nLvl = static_cast< BYTE >(pNd->GetActualListLevel()); - const SwNumFmt* pFmt = pRule->GetNumFmt( nLvl ); - if( !pFmt ) - pFmt = &pRule->Get( nLvl ); - - SfxItemSet aSet( rNdSet ); - SvxLRSpaceItem aLR( (SvxLRSpaceItem&)rNdSet.Get( RES_LR_SPACE ) ); - - aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetAbsLSpace() ); - if( MAXLEVEL > pNd->GetActualListLevel() ) - aLR.SetTxtFirstLineOfst( pFmt->GetFirstLineOffset() ); - else - aSet.ClearItem( RES_PARATR_NUMRULE ); - aSet.Put( aLR ); - aMergedSet.Put(aSet); - } - else - aMergedSet.Put(rNdSet); - } - - SwTxtNode *txtNode=rNode.GetTxtNode(); - if (txtNode!=NULL && !txtNode->IsNumbered()) - { - aMergedSet.ClearItem(RES_PARATR_NUMRULE); - } - OutRTF_SfxItemSet(rRTFWrt, aMergedSet, bDeep); - - rRTFWrt.pFlyFmt = pSaveFmt; - - rRTFWrt.bTxtAttr = true; - // erstmal den Start berichtigen. D.h. wird nur ein Teil vom Satz - // ausgegeben, so muessen auch da die Attribute stimmen!! - const SwTxtAttr * pHt = 0; - USHORT nCntAttr = pNd->HasHints() ? pNd->GetSwpHints().Count() : 0; - if( nCntAttr && nStrPos > *( pHt = pNd->GetSwpHints()[ 0 ] )->GetStart() ) - { - // Ok, es gibt vorher Attribute, die ausgegeben werden muessen - do { - nAttrPos++; - if( RES_TXTATR_FIELD == pHt->Which() ) // Felder nicht - continue; // ausgeben - - if( pHt->GetEnd() ) - { - xub_StrLen nHtEnd = *pHt->GetEnd(), nHtStt = *pHt->GetStart(); - if( !rRTFWrt.bWriteAll && nHtEnd <= nStrPos ) - continue; - - // leere Hints am Anfang nicht beachten, oder ?? - if( nHtEnd == nHtStt ) - continue; - - // Attribut in die Liste aufnehemen - if( !rRTFWrt.bWriteAll ) - { - if( nHtStt < nStrPos ) nHtStt = nStrPos; - if( nHtEnd >= nEnde ) nHtEnd = nEnde; - } - aEndPosLst.Insert( pHt->GetAttr(), nHtStt, nHtEnd ); - continue; - // aber nicht ausgeben, das erfolgt spaeter !! - } - Out( aRTFAttrFnTab, pHt->GetAttr(), rRTFWrt ); - - } while( nAttrPos < nCntAttr && nStrPos > - *( pHt = pNd->GetSwpHints()[ nAttrPos ] )->GetStart() ); - - // dann gebe mal alle gesammelten Attribute von der String-Pos aus - aEndPosLst.OutAttrs( nStrPos ); - } - - if( rRTFWrt.bOutFmtAttr && - ( nAttrPos < nCntAttr ? *pHt->GetStart() != nStrPos : TRUE )) - rRTFWrt.Strm() << ' '; - - // das Flag gibt an, ob das SwTxtFld am Ende vom Absatz steht. Denn - // dann ist vor dem Absatzumbruch die schliessende Klammer auszugeben - xub_StrLen nChrCnt = 0; - for( ; nStrPos <= nEnde; nStrPos++ ) - { - rRTFWrt.bOutFmtAttr = false; - if( nStrPos != nEnde && aEndPosLst.Count() ) - aEndPosLst.EndAttrs( nStrPos ); - - // versuche nach ungefaehr 255 Zeichen eine neue Zeile zu beginnen - if( nChrCnt != ( nStrPos & 0xff00 )) - { - rWrt.Strm() << SwRTFWriter::sNewLine; - nChrCnt = nStrPos & 0xff00; - } - - if( nAttrPos < nCntAttr && *pHt->GetStart() == nStrPos - && nStrPos != nEnde ) - { - do { - BOOL bEmpty = false; - if( pHt->GetEnd() ) - { - if (false == (bEmpty = *pHt->GetEnd() == nStrPos)) - { - aEndPosLst.Insert( pHt->GetAttr(), nStrPos, - *pHt->GetEnd() ); - continue; - } - rRTFWrt.Strm() << '{'; - } - Out( aRTFAttrFnTab, pHt->GetAttr(), rRTFWrt ); - if( bEmpty ) - { - rRTFWrt.Strm() << '}'; - rRTFWrt.bOutFmtAttr = false; - } - } while( ++nAttrPos < nCntAttr && nStrPos == - *( pHt = pNd->GetSwpHints()[ nAttrPos ] )->GetStart() ); - - // dann gebe mal alle gesammelten Attribute von der String-Pos aus - aEndPosLst.OutAttrs( nStrPos ); - - } - else - aEndPosLst.OutScriptChange( nStrPos ); - - HandleHyperlinks(rWrt, pNd->GetpSwpHints(), nStrPos); - - if( rRTFWrt.bOutFmtAttr ) - rRTFWrt.Strm() << ' '; - - rRTFWrt.OutBookmarks( nStrPos ); - - rRTFWrt.OutRedline( nStrPos); - - if (nStrPos != nEnde) - { - RTFOutFuncs::Out_String(rWrt.Strm(), String(rStr.GetChar(nStrPos)), - rRTFWrt.eCurrentEncoding, rRTFWrt.bWriteHelpFmt); - } - } - - rRTFWrt.bTxtAttr = false; - - // noch eine schliesende Klammer da ?? - if( aEndPosLst.Count() ) - aEndPosLst.EndAttrs( USHRT_MAX ); - - // wenn bis zum Ende vom Node, dann auch das AbsatzEnde ausgeben - if( rRTFWrt.pCurPam->GetMark()->nNode.GetIndex() == - rRTFWrt.pCurPam->GetPoint()->nNode.GetIndex() ) - { - if( pNd->Len() != rRTFWrt.pCurPam->GetMark()->nContent.GetIndex() ) - return rWrt; - - if( rRTFWrt.bOutTable ) - { - rRTFWrt.Strm() << SwRTFWriter::sNewLine; - return rWrt; - } - } - - rRTFWrt.Strm() << SwRTFWriter::sNewLine << OOO_STRING_SVTOOLS_RTF_PAR << ' '; - return rRTFWrt; -} - -bool IsEMF(const sal_uInt8 *pGraphicAry, unsigned long nSize) -{ - if (pGraphicAry && (nSize > 0x2c )) - { - // check the magic number - if ( - (pGraphicAry[0x28] == 0x20 ) && (pGraphicAry[0x29] == 0x45) && - (pGraphicAry[0x2a] == 0x4d ) && (pGraphicAry[0x2b] == 0x46) - ) - { - //emf detected - return true; - } - } - return false; -} - -bool StripMetafileHeader(const sal_uInt8 *&rpGraphicAry, unsigned long &rSize) -{ - if (rpGraphicAry && (rSize > 0x22)) - { - if ( - (rpGraphicAry[0] == 0xd7) && (rpGraphicAry[1] == 0xcd) && - (rpGraphicAry[2] == 0xc6) && (rpGraphicAry[3] == 0x9a) - ) - { // we have to get rid of the metafileheader - rpGraphicAry += 22; - rSize -= 22; - return true; - } - } - return false; -} - -void ExportPICT(const Size &rOrig, const Size &rRendered, const Size &rMapped, - const SwCropGrf &rCr, const char *pBLIPType, const sal_uInt8 *pGraphicAry, - unsigned long nSize, SwRTFWriter &rWrt) -{ - bool bIsWMF = (const char *)pBLIPType == (const char *)OOO_STRING_SVTOOLS_RTF_WMETAFILE ? true : false; - if (pBLIPType && nSize && pGraphicAry) - { - rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_PICT; - - long nXCroppedSize = rOrig.Width()-(rCr.GetLeft() + rCr.GetRight()); - long nYCroppedSize = rOrig.Height()-(rCr.GetTop() + rCr.GetBottom()); - /* #127543#: Graphic with a zero height or width, typically copied from webpages, caused - crashes. */ - if( !nXCroppedSize ) - nXCroppedSize = 100; - if( !nYCroppedSize ) - nYCroppedSize = 100; - - //Given the original size and taking cropping into account - //first, how much has the original been scaled to get the - //final rendered size - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICSCALEX; - rWrt.OutLong((100 * rRendered.Width()) / nXCroppedSize); - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICSCALEY; - rWrt.OutLong((100 * rRendered.Height()) / nYCroppedSize); - - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICCROPL; - rWrt.OutLong(rCr.GetLeft()); - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICCROPR; - rWrt.OutLong(rCr.GetRight()); - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICCROPT; - rWrt.OutLong(rCr.GetTop()); - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICCROPB; - rWrt.OutLong(rCr.GetBottom()); - - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICW; - rWrt.OutLong(rMapped.Width()); - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICH; - rWrt.OutLong(rMapped.Height()); - - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICWGOAL; - rWrt.OutLong(rOrig.Width()); - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICHGOAL; - rWrt.OutLong(rOrig.Height()); - - rWrt.Strm() << pBLIPType; - if (bIsWMF) - { - rWrt.OutLong(8); - StripMetafileHeader(pGraphicAry, nSize); - } - rWrt.Strm() << SwRTFWriter::sNewLine; - - sal_uInt32 nBreak = 0; - for (sal_uInt32 nI = 0; nI < nSize; ++nI) - { - ByteString sNo = ByteString::CreateFromInt32(pGraphicAry[nI], 16); - if (sNo.Len() < 2) - rWrt.Strm() << '0'; - rWrt.Strm() << sNo.GetBuffer(); - if (++nBreak == 64) - { - rWrt.Strm() << SwRTFWriter::sNewLine; - nBreak = 0; - } - } - - rWrt.Strm() << '}'; - } -} - -static Writer& OutRTF_SwGrfNode(Writer& rWrt, SwCntntNode & rNode) -{ - SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt; - SwGrfNode &rNd = (SwGrfNode&)rNode; - - // ist der aktuelle Absatz in einem freifliegenden Rahmen ? Dann - // muessen noch die Attribute dafuer ausgegeben werden. - if (rRTFWrt.pFlyFmt && !ExportAsInline(*rRTFWrt.pFlyFmt)) - OutRTF_SwFlyFrmFmt(rRTFWrt); //"classic" positioning and size export - -#if 1 - SvMemoryStream aStream; - const sal_uInt8* pGraphicAry = 0; - sal_uInt32 nSize = 0; - - Graphic aGraphic(rNd.GetGrf()); - - // If there is no graphic there is not much point in parsing it - if(aGraphic.GetType()==GRAPHIC_NONE) - return rRTFWrt; - - GfxLink aGraphicLink; - const sal_Char* pBLIPType = 0; - if (aGraphic.IsLink()) - { - aGraphicLink = aGraphic.GetLink(); - nSize = aGraphicLink.GetDataSize(); - pGraphicAry = aGraphicLink.GetData(); - switch (aGraphicLink.GetType()) - { - case GFX_LINK_TYPE_NATIVE_JPG: - pBLIPType = OOO_STRING_SVTOOLS_RTF_JPEGBLIP; - break; - case GFX_LINK_TYPE_NATIVE_PNG: - pBLIPType = OOO_STRING_SVTOOLS_RTF_PNGBLIP; - case GFX_LINK_TYPE_NATIVE_WMF: - pBLIPType = - IsEMF(pGraphicAry, nSize) ? OOO_STRING_SVTOOLS_RTF_EMFBLIP : OOO_STRING_SVTOOLS_RTF_WMETAFILE; - break; - default: - break; - } - } - - GraphicType eGraphicType = aGraphic.GetType(); - if (!pGraphicAry) - { - if (ERRCODE_NONE == GraphicConverter::Export(aStream, aGraphic, - (eGraphicType == GRAPHIC_BITMAP) ? CVT_PNG : CVT_WMF)) - { - pBLIPType = (eGraphicType == GRAPHIC_BITMAP) ? - OOO_STRING_SVTOOLS_RTF_PNGBLIP : OOO_STRING_SVTOOLS_RTF_WMETAFILE; - aStream.Seek(STREAM_SEEK_TO_END); - nSize = aStream.Tell(); - pGraphicAry = (sal_uInt8*)aStream.GetData(); - } - } - - Size aMapped(eGraphicType == GRAPHIC_BITMAP ? aGraphic.GetSizePixel() : aGraphic.GetPrefSize()); - - const SwCropGrf &rCr = (const SwCropGrf &)rNd.GetAttr(RES_GRFATR_CROPGRF); - - //Get original size in twips - Size aSize(sw::util::GetSwappedInSize(rNd)); - Size aRendered(aSize); - if (rRTFWrt.pFlyFmt) - { - const SwFmtFrmSize& rS = rRTFWrt.pFlyFmt->GetFrmSize(); - aRendered.Width() = rS.GetWidth(); - aRendered.Height() = rS.GetHeight(); - } - - /* - If the graphic is not of type WMF then we will have to store two - graphics, one in the native format wrapped in shppict, and the other in - the wmf format wrapped in nonshppict, so as to keep wordpad happy. If its - a wmf already then we don't need any such wrapping - */ - bool bIsWMF = (const sal_Char*)pBLIPType == (const sal_Char*)OOO_STRING_SVTOOLS_RTF_WMETAFILE ? true : false; - if (!bIsWMF) - OutComment(rRTFWrt, OOO_STRING_SVTOOLS_RTF_SHPPICT); - - if (pBLIPType) - ExportPICT(aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, rRTFWrt); - else - { - aStream.Seek(0); - GraphicConverter::Export(aStream, aGraphic, CVT_WMF); - pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE; - aStream.Seek(STREAM_SEEK_TO_END); - nSize = aStream.Tell(); - pGraphicAry = (sal_uInt8*)aStream.GetData(); - - ExportPICT(aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, - rRTFWrt); - } - - if (!bIsWMF) - { - rRTFWrt.Strm() << '}' << '{' << OOO_STRING_SVTOOLS_RTF_NONSHPPICT; - - aStream.Seek(0); - GraphicConverter::Export(aStream, aGraphic, CVT_WMF); - pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE; - aStream.Seek(STREAM_SEEK_TO_END); - nSize = aStream.Tell(); - pGraphicAry = (sal_uInt8*)aStream.GetData(); - - ExportPICT(aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, - rRTFWrt); - - rRTFWrt.Strm() << '}'; - } - - - rRTFWrt.Strm() << SwRTFWriter::sNewLine; -#else - rRTFWrt.Strm() << "{{"; - - // damit die eigenen Grafik-Attribute nach der PICT / import Anweisung - // stehen, muessen die am Anfang ausgegeben werden. - rRTFWrt.bOutFmtAttr = false; - OutRTF_SwFmt( rRTFWrt, *pNd->GetFmtColl() ); - - if( rRTFWrt.bOutFmtAttr ) // wurde ueberhaupt ein Attrribut - rRTFWrt.Strm() << "}{"; // ausgegeben ?? - - String aGrfNm; - const SwMirrorGrf& rMirror = pNd->GetSwAttrSet().GetMirrorGrf(); - if( !pNd->IsLinkedFile() || RES_MIRROR_GRAPH_DONT != rMirror.GetValue() ) - { - USHORT nErr = 1; - // Grafik als File-Referenz speichern (als JPEG-Grafik speichern) - // but only if we save into a file and have a URL - if( rWrt.GetOrigFileName() ) - { - aGrfNm = *rWrt.GetOrigFileName(); - pNd->SwapIn( TRUE ); - ULONG nFlags = XOUTBMP_USE_NATIVE_IF_POSSIBLE; - switch( rMirror.GetValue() ) - { - case RES_MIRROR_GRAPH_VERT: nFlags = XOUTBMP_MIRROR_HORZ; break; - case RES_MIRROR_GRAPH_HOR: nFlags = XOUTBMP_MIRROR_VERT; break; - case RES_MIRROR_GRAPH_BOTH: - nFlags = XOUTBMP_MIRROR_VERT | XOUTBMP_MIRROR_HORZ; - break; - } - - Size aMM100Size; - Size* pMM100Size = 0; - if( rRTFWrt.pFlyFmt ) - { - const SwFmtFrmSize& rSize = rRTFWrt.pFlyFmt->GetFrmSize(); - aMM100Size = OutputDevice::LogicToLogic( rSize.GetSize(), - MapMode( MAP_TWIP ), MapMode( MAP_100TH_MM )); - pMM100Size = &aMM100Size; - } - - nErr = XOutBitmap::WriteGraphic( pNd->GetGrf(), aGrfNm, - String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "JPG" )), - nFlags, pMM100Size ); - } - if( nErr ) // fehlerhaft, da ist nichts auszugeben - { - rRTFWrt.Strm() << "}}"; - return rWrt; - } - } - else - pNd->GetFileFilterNms( &aGrfNm, 0 ); - - // MIB->JP: Warum erst AbsToRel und dann das URL-Objekt? So - // kommt bei relativierbaren URLs als Protokoll "unknown" raus. - // Ist das Absicht? - aGrfNm = INetURLObject::AbsToRel( aGrfNm, INetURLObject::WAS_ENCODED, - INetURLObject::DECODE_UNAMBIGUOUS); - INetURLObject aUrl( aGrfNm ); - if( aUrl.GetProtocol() == INET_PROT_FILE ) - aGrfNm = aUrl.PathToFileName(); - - // Bitmap als File-Referenz speichern - rRTFWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FIELD << OOO_STRING_SVTOOLS_RTF_FLDPRIV; - OutComment( rRTFWrt, OOO_STRING_SVTOOLS_RTF_FLDINST ) << "{\\\\import "; - RTFOutFuncs::Out_String( rWrt.Strm(), aGrfNm, rRTFWrt.eDefaultEncoding, - rRTFWrt.bWriteHelpFmt ); - rRTFWrt.Strm() << "}}{" << OOO_STRING_SVTOOLS_RTF_FLDRSLT << " }}"; - rRTFWrt.Strm() << '}' << SwRTFWriter::sNewLine; -#endif - return rRTFWrt; -} - -static Writer& OutRTF_SwOLENode( Writer& rWrt, SwCntntNode & /*rNode*/ ) -{ - SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt; - - // ist der aktuelle Absatz in einem freifliegenden Rahmen ? Dann - // muessen noch die Attribute dafuer ausgegeben werden. - if( rRTFWrt.pFlyFmt ) - OutRTF_SwFlyFrmFmt( rRTFWrt ); - - rWrt.Strm() << SwRTFWriter::sNewLine << OOO_STRING_SVTOOLS_RTF_PAR; - return rWrt; -} - -static void OutTBLBorderLine(SwRTFWriter& rWrt, const SvxBorderLine* pLine, - const sal_Char* pStr) -{ - ByteString sLineStr; - if( pLine->GetInWidth() ) - { - // doppelte Linie - sLineStr = OOO_STRING_SVTOOLS_RTF_BRDRDB; - switch( pLine->GetInWidth() ) - { - case DEF_LINE_WIDTH_0: - ( sLineStr += OOO_STRING_SVTOOLS_RTF_BRDRW ) += "15"; - break; - case DEF_LINE_WIDTH_1: - ( sLineStr += OOO_STRING_SVTOOLS_RTF_BRDRW ) += "30"; - break; - case DEF_LINE_WIDTH_2: - case DEF_LINE_WIDTH_3: - ( sLineStr += OOO_STRING_SVTOOLS_RTF_BRDRW ) += "45"; - break; - } - } - else - { - // einfache Linie - if( DEF_LINE_WIDTH_1 >= pLine->GetOutWidth() ) - (( sLineStr = OOO_STRING_SVTOOLS_RTF_BRDRS ) += OOO_STRING_SVTOOLS_RTF_BRDRW ) += - ByteString::CreateFromInt32( pLine->GetOutWidth() ); - else - (( sLineStr = OOO_STRING_SVTOOLS_RTF_BRDRTH ) += OOO_STRING_SVTOOLS_RTF_BRDRW ) += - ByteString::CreateFromInt32( pLine->GetOutWidth() / 2 ); - } - - rWrt.Strm() << pStr << sLineStr.GetBuffer() << OOO_STRING_SVTOOLS_RTF_BRDRCF; - rWrt.OutULong( rWrt.GetId( pLine->GetColor() ) ); -} - -static void OutBorderLine(SwRTFWriter& rWrt, const SvxBorderLine* pLine, - const sal_Char* pStr, USHORT nDist) -{ - OutTBLBorderLine(rWrt, pLine, pStr); - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_BRSP; - rWrt.OutULong( nDist ); -} - -static void OutSwTblBorder(SwRTFWriter& rWrt, const SvxBoxItem& rBox, - const SvxBoxItem *pDefault) -{ - static const USHORT aBorders[] = - { - BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT - }; -#ifdef __MINGW32__ - static const char* aBorderNames[] __attribute__((section(".data"))) = -#else - static const char* aBorderNames[] = -#endif - { - OOO_STRING_SVTOOLS_RTF_CLBRDRT, OOO_STRING_SVTOOLS_RTF_CLBRDRL, OOO_STRING_SVTOOLS_RTF_CLBRDRB, OOO_STRING_SVTOOLS_RTF_CLBRDRR - }; - //Yes left and top are swapped with eachother for cell padding! Because - //that's what the thunderingly annoying rtf export/import word xp does. -#ifdef __MINGW32__ - static const char* aCellPadNames[] __attribute__((section(".data"))) = -#else - static const char* aCellPadNames[] = -#endif - { - OOO_STRING_SVTOOLS_RTF_CLPADL, OOO_STRING_SVTOOLS_RTF_CLPADT, OOO_STRING_SVTOOLS_RTF_CLPADB, OOO_STRING_SVTOOLS_RTF_CLPADR - }; -#ifdef __MINGW32__ - static const char* aCellPadUnits[] __attribute__((section(".data"))) = -#else - static const char* aCellPadUnits[] = -#endif - { - OOO_STRING_SVTOOLS_RTF_CLPADFL, OOO_STRING_SVTOOLS_RTF_CLPADFT, OOO_STRING_SVTOOLS_RTF_CLPADFB, OOO_STRING_SVTOOLS_RTF_CLPADFR - }; - for (int i = 0; i < 4; ++i) - { - if (const SvxBorderLine* pLn = rBox.GetLine(aBorders[i])) - OutTBLBorderLine(rWrt, pLn, aBorderNames[i]); - if (!pDefault || pDefault->GetDistance(aBorders[i]) != - rBox.GetDistance(aBorders[i])) - { - rWrt.Strm() << aCellPadUnits[i]; - rWrt.OutULong(3); - rWrt.Strm() << aCellPadNames[i]; - rWrt.OutULong(rBox.GetDistance(aBorders[i])); - } - } -} - -static void OutSwTblBackground( SwRTFWriter& rWrt, const SvxBrushItem& rBack ) -{ - if( !rBack.GetColor().GetTransparency() ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CLCBPAT; - rWrt.OutULong( rWrt.GetId( rBack.GetColor() ) ); - } -} - - -Writer& OutRTF_SwTblNode(Writer& rWrt, const SwTableNode & rNode) -{ - SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt; - const SwTable& rTbl = rNode.GetTable(); - SwTwips nPageSize = 0, nTblOffset = 0; - const bool bNewTableModel = rTbl.IsNewModel(); - -/* -//!!!!!!!!!!!!! for clipboard create any view if the table is complex !!! - if( rTbl.IsTblComplex() ) - { - // then we have to create any layout - SFX_APP()->CreateViewFrame( *xDocSh, 0, TRUE ); - } -*/ - - const SwFrmFmt *pFmt = rTbl.GetFrmFmt(); - ASSERT(pFmt, "Impossible"); - { - Point aPt; - SwRect aRect( pFmt->FindLayoutRect( false, &aPt )); - if( aRect.IsEmpty() ) - { - // dann besorge mal die Seitenbreite ohne Raender !! - const SwFrmFmt* pFrmFmt = rRTFWrt.pFlyFmt ? rRTFWrt.pFlyFmt : - const_cast<const SwDoc *>(rWrt.pDoc) - ->GetPageDesc(0).GetPageFmtOfNode(rNode, false); - - aRect = pFrmFmt->FindLayoutRect( TRUE ); - if( 0 == ( nPageSize = aRect.Width() )) - { - const SvxLRSpaceItem& rLR = pFrmFmt->GetLRSpace(); - nPageSize = pFrmFmt->GetFrmSize().GetWidth() - - rLR.GetLeft() - rLR.GetRight(); - } - } - else - nPageSize = aRect.Width(); - } - - SwTwips nTblSz = pFmt->GetFrmSize().GetWidth(); - - ByteString aTblAdjust( OOO_STRING_SVTOOLS_RTF_TRQL ); - switch (pFmt->GetHoriOrient().GetHoriOrient()) - { - case text::HoriOrientation::CENTER: - aTblAdjust = OOO_STRING_SVTOOLS_RTF_TRQC; - break; - case text::HoriOrientation::RIGHT: - aTblAdjust = OOO_STRING_SVTOOLS_RTF_TRQR; - break; - case text::HoriOrientation::NONE: - case text::HoriOrientation::LEFT_AND_WIDTH: - { - const SvxLRSpaceItem& rLRSp = pFmt->GetLRSpace(); - nTblOffset = rLRSp.GetLeft(); - nPageSize -= (nTblOffset + rLRSp.GetRight()); - aTblAdjust += OOO_STRING_SVTOOLS_RTF_TRLEFT; - aTblAdjust += ByteString::CreateFromInt32( nTblOffset ); - } - break; - default: - break; - } - - if (rRTFWrt.TrueFrameDirection(*pFmt) == FRMDIR_HORI_RIGHT_TOP) - aTblAdjust += OOO_STRING_SVTOOLS_RTF_RTLROW; - - // ist die Tabelle wesentlich (PageSize + 10%) groesser als die Seite, - // dann sind die Box-Breiten relative Angaben. - BOOL bRelBoxSize = TRUE /*ALWAYS relativ (nPageSize + ( nPageSize / 10 )) < nTblSz*/; - - SwWriteTable* pTableWrt; - const SwHTMLTableLayout *pLayout = rTbl.GetHTMLTableLayout(); - if( pLayout && pLayout->IsExportable() ) - pTableWrt = new SwWriteTable( pLayout ); - else - pTableWrt = new SwWriteTable(rTbl.GetTabLines(), (USHORT)nPageSize, - (USHORT)nTblSz, false); - - // rCols are the array of all cols of the table - const SwWriteTableCols& rCols = pTableWrt->GetCols(); - USHORT nColCnt = rCols.Count(); - SwWriteTableCellPtr* pBoxArr = new SwWriteTableCellPtr[ nColCnt ]; - USHORT* pRowSpans = new USHORT[ nColCnt ]; - memset( pBoxArr, 0, sizeof( pBoxArr[0] ) * nColCnt ); - memset( pRowSpans, 0, sizeof( pRowSpans[0] ) * nColCnt ); - const SwWriteTableRows& rRows = pTableWrt->GetRows(); - for( USHORT nLine = 0; nLine < rRows.Count(); ++nLine ) - { - USHORT nBox; - - const SwWriteTableRow *pRow = rRows[ nLine ]; - const SwWriteTableCells& rCells = pRow->GetCells(); - - BOOL bFixRowHeight = false; - - USHORT nBoxes = rCells.Count(); - if (nColCnt < nBoxes) - nBoxes = nColCnt; - - for( nColCnt = 0, nBox = 0; nBox < rCells.Count() && nColCnt < nBoxes; ++nColCnt ) - { - SwWriteTableCell* pCell = rCells[ nBox ]; - const bool bProcessCoveredCell = bNewTableModel && 0 == pCell->GetRowSpan(); - - if( !pRowSpans[ nColCnt ] || bProcessCoveredCell ) - { - // set new BoxPtr - nBox++; - pBoxArr[ nColCnt ] = pCell; - if ( !bProcessCoveredCell ) - pRowSpans[ nColCnt ] = pCell->GetRowSpan(); - for( USHORT nCellSpan = pCell->GetColSpan(), nCS = 1; - nCS < nCellSpan; ++nCS, ++nColCnt ) - { - ASSERT( nColCnt+1 < rCols.Count(), "More colspan than columns" ); - if( nColCnt+1 < rCols.Count() ) // robust against wrong colspans - { - pBoxArr[ nColCnt+1 ] = pBoxArr[ nColCnt ]; - pRowSpans[ nColCnt+1 ] = pRowSpans[ nColCnt ]; - } - } - } - if( 1 != pRowSpans[ nColCnt ] && !bNewTableModel ) - bFixRowHeight = TRUE; - } - - for( ; nColCnt < rCols.Count() && pRowSpans[ nColCnt ]; ++nColCnt ) - bFixRowHeight = TRUE; - - nColCnt = rCols.Count(); // A wrong cellspan-value could cause a nColCnt > rCols.Count() - - // Start Tabellendefinition - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TROWD << aTblAdjust.GetBuffer(); - - if( rTbl.GetRowsToRepeat() > nLine ) - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TRHDR; - - const SwTableLine* pLine = pBoxArr[ 0 ]->GetBox()->GetUpper(); - // Zeilenhoehe ausgeben - long nHeight = 0; - if( bFixRowHeight && rWrt.pDoc->GetRootFrm() ) - { - nHeight = -pRow->GetPos(); //neg. => abs. height! - if( nLine ) - nHeight += rRows[ nLine - 1 ]->GetPos(); - } - else - { - const SwFmtFrmSize& rLSz = pLine->GetFrmFmt()->GetFrmSize(); - if( ATT_VAR_SIZE != rLSz.GetHeightSizeType() && rLSz.GetHeight() ) - nHeight = ATT_MIN_SIZE == rLSz.GetHeightSizeType() - ? rLSz.GetHeight() - : -rLSz.GetHeight(); - } - - //The rtf default is to allow a row to break, so if we are not - //splittable export TRKEEP - const SwFrmFmt *pLineFmt = pLine ? pLine->GetFrmFmt() : 0; - if (!pLineFmt || pLineFmt->GetRowSplit().GetValue() == 0) - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TRKEEP; - - if( nHeight ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TRRH; - rWrt.OutLong( nHeight ); - } - - const SvxBoxItem *pDefaultBox = 0; - if (nColCnt) - { - pDefaultBox = &(pBoxArr[0]->GetBox()->GetFrmFmt()->GetBox()); - - static const USHORT aBorders[] = - { - BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT - }; -#ifdef __MINGW32__ - static const char* aRowPadNames[] __attribute__((section(".data"))) = -#else - static const char* aRowPadNames[] = -#endif - { - OOO_STRING_SVTOOLS_RTF_TRPADDT, OOO_STRING_SVTOOLS_RTF_TRPADDL, OOO_STRING_SVTOOLS_RTF_TRPADDB, OOO_STRING_SVTOOLS_RTF_TRPADDR - }; - static const char* aRowPadUnits[] = - { - OOO_STRING_SVTOOLS_RTF_TRPADDFT, OOO_STRING_SVTOOLS_RTF_TRPADDFL, OOO_STRING_SVTOOLS_RTF_TRPADDFB, OOO_STRING_SVTOOLS_RTF_TRPADDFR - }; - for (int i = 0; i < 4; ++i) - { - rWrt.Strm() << aRowPadUnits[i]; - rWrt.OutULong(3); - rWrt.Strm() << aRowPadNames[i]; - rWrt.OutULong(pDefaultBox->GetDistance(aBorders[i])); - } - } - - // Breite der Boxen ausgeben - SwTwips nSz = 0, nCalc; - for( nBox = 0; nBox < nColCnt; ++nBox ) - { - SwWriteTableCell* pCell = pBoxArr[ nBox ]; - if( (nBox && pBoxArr[ nBox-1 ] == pBoxArr[ nBox ]) || (pCell == NULL) ) - continue; - - const SwFrmFmt& rFmt = *pCell->GetBox()->GetFrmFmt(); - if( 1 < pCell->GetRowSpan() || 0 == pCell->GetRowSpan() ) - rWrt.Strm() << ( pCell->GetRowSpan() == pRowSpans[ nBox ] - ? OOO_STRING_SVTOOLS_RTF_CLVMGF - : OOO_STRING_SVTOOLS_RTF_CLVMRG ); - - const SfxPoolItem* pItem; - if (SFX_ITEM_SET == rFmt.GetAttrSet().GetItemState(RES_BOX, TRUE, - &pItem)) - { - OutSwTblBorder(rRTFWrt, (SvxBoxItem&)*pItem, pDefaultBox); - } - -// RTF kennt Schattierung in unserem Sinne nicht! -// if( SFX_ITEM_SET == pBoxFmt->GetAttrSet().GetItemState( -// RES_SHADOW, TRUE, &pItem ) ) -// OutSwTblShadow( rRTFWrt, *pItem ); - - if( SFX_ITEM_SET == rFmt.GetAttrSet().GetItemState( - RES_BACKGROUND, TRUE, &pItem ) - || 0 != ( pItem = pCell->GetBackground() ) - || 0 != ( pItem = pRow->GetBackground() ) ) - OutSwTblBackground( rRTFWrt, (SvxBrushItem&)*pItem ); - - if( SFX_ITEM_SET == rFmt.GetAttrSet().GetItemState( - RES_VERT_ORIENT, TRUE, &pItem ) ) - switch( ((SwFmtVertOrient*)pItem)->GetVertOrient() ) - { - case text::VertOrientation::CENTER: rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CLVERTALC; break; - case text::VertOrientation::BOTTOM: rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CLVERTALB; break; - default: rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CLVERTALT; break; - } - - const SwFmtFrmSize& rLSz = rFmt.GetFrmSize(); - nSz += rLSz.GetWidth(); - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CELLX; - - nCalc = nSz; - if( bRelBoxSize ) - { - nCalc *= nPageSize; - nCalc /= nTblSz; - } - rWrt.OutLong( nTblOffset + nCalc ); - } - - // Inhalt der Boxen ausgeben - rWrt.Strm() << SwRTFWriter::sNewLine << OOO_STRING_SVTOOLS_RTF_PARD << OOO_STRING_SVTOOLS_RTF_INTBL; - for( nBox = 0; nBox < nBoxes; ++nBox ) - { - SwWriteTableCell * pCell = pBoxArr[nBox]; - - if( (nBox && pBoxArr[ nBox-1 ] == pBoxArr[ nBox ]) || pCell == NULL) - continue; - - if( pCell->GetRowSpan() == pRowSpans[ nBox ] ) - { - // new Box - const SwStartNode* pSttNd = pCell->GetBox()->GetSttNd(); - RTFSaveData aSaveData( rRTFWrt, - pSttNd->GetIndex()+1, pSttNd->EndOfSectionIndex() ); - rRTFWrt.bOutTable = TRUE; - rRTFWrt.Out_SwDoc( rRTFWrt.pCurPam ); - } - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CELL; - } - - // das wars mit der Line - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_ROW << OOO_STRING_SVTOOLS_RTF_PARD << ' '; - - for( nBox = 0; nBox < nColCnt; ++nBox ) - --pRowSpans[ nBox ]; - } - - delete pTableWrt; - delete[] pBoxArr; - delete[] pRowSpans; - - // Pam hinter die Tabelle verschieben - rRTFWrt.pCurPam->GetPoint()->nNode = *rNode.EndOfSectionNode(); - rRTFWrt.SetAttrSet( 0 ); - - return rWrt; -} - -Writer& OutRTF_SwSectionNode( Writer& rWrt, SwSectionNode& rNode ) -{ - SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt; - const SwSection& rSect = rNode.GetSection(); - - // folgt dahinter noch ein SectionNode? Dann wird erst die innere - // Section aktiv. Hier wird die Verschachtelung aufgebrochen, weil - // RTF das nicht kennt - BOOL bPgDscWrite = false; - { - SwNodeIndex aIdx( rNode, 1 ); - const SwNode& rNd = aIdx.GetNode(); - if( rNd.IsSectionNode() /*&& CONTENT_SECTION == - aIdx.GetNode().GetSectionNode()->GetSection().GetType()*/ ) - return rWrt; - - // falls als erstes Position ein Content- oder Tabellen-Node steht, - // dann kann dieser einen PageDesc gesetzt haben und der muss vor - // der Bereichsbeschreibung geschrieben werden! - // Umgekehrt muss im OutBreaks dann - if( rNd.IsCntntNode() ) - { - bPgDscWrite = rRTFWrt.OutBreaks( ((SwCntntNode&)rNd).GetSwAttrSet() ); - rRTFWrt.bIgnoreNextPgBreak = TRUE; - } - else if( rNd.IsTableNode() ) - { - bPgDscWrite = rRTFWrt.OutBreaks( ((SwTableNode&)rNd).GetTable(). - GetFrmFmt()->GetAttrSet() ); - rRTFWrt.bIgnoreNextPgBreak = TRUE; - } - } - - -// if( CONTENT_SECTION == rSect.GetType() ) - { - // als fortlaufenden Abschnittwechsel heraus schreiben - if( !bPgDscWrite ) - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_SECT << OOO_STRING_SVTOOLS_RTF_SBKNONE; - //JP 19.03.99 - es muss fuer den Import auf jedenfall das Cols - // Token geschrieben werden. Sonst kann nicht erkannt - // werden, wann ein PageDesc & eine Section gueltig ist - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_COLS << '1'; - rRTFWrt.bOutFmtAttr = TRUE; - const SfxPoolItem* pItem; - const SwFrmFmt *pFmt = rSect.GetFmt(); - ASSERT(pFmt, "Impossible"); - const SfxItemSet& rSet = pFmt->GetAttrSet(); - if( SFX_ITEM_SET == rSet.GetItemState( RES_COL, false, &pItem )) - OutRTF_SwFmtCol( rWrt, *pItem ); - else - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_COLS << '1' << OOO_STRING_SVTOOLS_RTF_COLSX; - rWrt.OutULong(709); - } - - if( SFX_ITEM_SET == rSet.GetItemState( RES_COLUMNBALANCE, - false, &pItem ) && ((SwFmtNoBalancedColumns*)pItem)->GetValue() ) - OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_BALANCEDCOLUMN ) << '}'; - - if (FRMDIR_HORI_RIGHT_TOP == rRTFWrt.TrueFrameDirection(*pFmt)) - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_RTLSECT; - else - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LTRSECT; - - rWrt.Strm() << SwRTFWriter::sNewLine; - } - - return rWrt; -} - - -/* File CHRATR.HXX: */ - -static Writer& OutRTF_SwFont( Writer& rWrt, const SfxPoolItem& rHt ) -{ - /* trage den Font in die Font-Liste vom Writer ein und gebe hier nur - * die entsprechende Nummer aus. Der Font wird spaeter ueber diese - * Tabelle im RTF-Dokument referenziert. - */ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - - if( !rRTFWrt.bTxtAttr || - ( rRTFWrt.GetEndPosLst() && - rRTFWrt.GetEndPosLst()->MatchScriptToId( rHt.Which() ) )) - { - rRTFWrt.bOutFmtAttr = true; - const SvxFontItem&rFont = (const SvxFontItem&)rHt; - bool bAssoc = rRTFWrt.IsAssociatedFlag(); - /* - #109522# - Word is a bit of a silly bugger of a program when its comes to symbol - font useage. If a symbol font is actually being used, i.e. exported - here with bTxtAttr true then both AF and F must be set to the same - value - */ - if (rRTFWrt.bTxtAttr && (rFont.GetCharSet() == RTL_TEXTENCODING_SYMBOL)) - { - const sal_Char* pCmd = !bAssoc ? OOO_STRING_SVTOOLS_RTF_AF : OOO_STRING_SVTOOLS_RTF_F; - rWrt.Strm() << pCmd; - } - const sal_Char* pCmd = bAssoc ? OOO_STRING_SVTOOLS_RTF_AF : OOO_STRING_SVTOOLS_RTF_F; - rWrt.Strm() << pCmd; - rWrt.OutULong(rRTFWrt.GetId(rFont)); - rRTFWrt.eCurrentEncoding = rtl_getTextEncodingFromWindowsCharset(sw::ms::rtl_TextEncodingToWinCharset(rFont.GetCharSet())); - } - return rWrt; -} - -static Writer& OutRTF_SwPosture( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - - if( !rRTFWrt.bTxtAttr || - ( rRTFWrt.GetEndPosLst() && - rRTFWrt.GetEndPosLst()->MatchScriptToId( rHt.Which() ) )) - { - if (rRTFWrt.IsAssociatedFlag() && rHt.Which() == RES_CHRATR_CJK_POSTURE) - { - /* - #i21422# - Sadly in word rtf we can't retain CJK italic when we are not - exporting asian text as it doesn't have a seperate italic for - western and asian. - */ - return rWrt; - } - - const FontItalic nPosture = ((const SvxPostureItem&)rHt).GetPosture(); - int bTxtOut = rRTFWrt.bTxtAttr && ITALIC_NONE == nPosture; - if( ITALIC_NORMAL == nPosture || bTxtOut ) - { - rRTFWrt.bOutFmtAttr = TRUE; - const sal_Char* pCmd = rRTFWrt.IsAssociatedFlag() ? OOO_STRING_SVTOOLS_RTF_AI : OOO_STRING_SVTOOLS_RTF_I; - rWrt.Strm() << pCmd; - } - if( bTxtOut ) - rWrt.Strm() << '0'; // wieder abschalten - } - return rWrt; -} - - -static Writer& OutRTF_SwWeight( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - if( !rRTFWrt.bTxtAttr || - ( rRTFWrt.GetEndPosLst() && - rRTFWrt.GetEndPosLst()->MatchScriptToId( rHt.Which() ) )) - { - if (rRTFWrt.IsAssociatedFlag() && rHt.Which() == RES_CHRATR_CJK_WEIGHT) - { - /* - #i21422# - Sadly in word rtf we can't retain CJK bold when we are not - exporting asian text as it doesn't have a seperate bold for western - and asian. - */ - return rWrt; - } - - const FontWeight nBold = ((const SvxWeightItem&)rHt).GetWeight(); - int bTxtOut = rRTFWrt.bTxtAttr && WEIGHT_NORMAL == nBold; - if( WEIGHT_BOLD == nBold || bTxtOut ) - { - rRTFWrt.bOutFmtAttr = TRUE; - const sal_Char* pCmd = rRTFWrt.IsAssociatedFlag() ? OOO_STRING_SVTOOLS_RTF_AB : OOO_STRING_SVTOOLS_RTF_B; - rWrt.Strm() << pCmd; - } - if( bTxtOut ) - rWrt.Strm() << '0'; - } - return rWrt; -} - -static Writer& OutRTF_SwEmphasisMark( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - const sal_Char* pStr; - switch( ((const SvxEmphasisMarkItem&)rHt).GetEmphasisMark()) - { - case EMPHASISMARK_NONE: pStr = OOO_STRING_SVTOOLS_RTF_ACCNONE; break; - case EMPHASISMARK_SIDE_DOTS: pStr = OOO_STRING_SVTOOLS_RTF_ACCCOMMA; break; - default: pStr = OOO_STRING_SVTOOLS_RTF_ACCDOT; break; - } - - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << pStr; - return rWrt; -} - -static Writer& OutRTF_SwTwoInOne( Writer& rWrt, const SfxPoolItem& rHt ) -{ - if( ((SvxTwoLinesItem&)rHt).GetValue() ) - { - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - - sal_Unicode cStart = ((SvxTwoLinesItem&)rHt).GetStartBracket(); - sal_Unicode cEnd = ((SvxTwoLinesItem&)rHt).GetStartBracket(); - - USHORT nType; - if( !cStart && !cEnd ) - nType = 0; - else if( '{' == cStart || '}' == cEnd ) - nType = 4; - else if( '<' == cStart || '>' == cEnd ) - nType = 3; - else if( '[' == cStart || ']' == cEnd ) - nType = 2; - else // all other kind of brackets - nType = 1; - - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TWOINONE; - rWrt.OutULong( nType ); - rRTFWrt.bOutFmtAttr = TRUE; - } - return rWrt; -} - -static Writer& OutRTF_SwCharRotate( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_HORZVERT; - rWrt.OutLong( ((SvxCharRotateItem&)rHt).IsFitToLine() ? 1 : 0 ); - return rWrt; -} -static Writer& OutRTF_SwCharScaleW( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CHARSCALEX; - rWrt.OutLong( ((SvxCharScaleWidthItem&)rHt).GetValue() ); - return rWrt; -} - -static Writer& OutRTF_SwCharRelief(Writer& rWrt, const SfxPoolItem& rHt) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - const SvxCharReliefItem& rAttr = (const SvxCharReliefItem&)rHt; - const sal_Char* pStr; - switch (rAttr.GetValue()) - { - case RELIEF_EMBOSSED: - pStr = OOO_STRING_SVTOOLS_RTF_EMBO; - break; - case RELIEF_ENGRAVED: - pStr = OOO_STRING_SVTOOLS_RTF_IMPR; - break; - default: - pStr = 0; - break; - } - - if (pStr) - { - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << pStr; - } - return rWrt; -} - - -static Writer& OutRTF_SwChrBckgrnd( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - const SvxBrushItem& rBack = (const SvxBrushItem&)rHt; - if( !rBack.GetColor().GetTransparency() ) - { - ByteString sOut( OOO_STRING_SVTOOLS_RTF_CHCBPAT ); - sOut += ByteString::CreateFromInt32( - rRTFWrt.GetId( rBack.GetColor() )); - - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << sOut.GetBuffer(); - } - return rWrt; -} - -static Writer& OutRTF_SwShadowed( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - const BOOL bShadow = ((const SvxShadowedItem&)rHt).GetValue(); - int bTxtOut = rRTFWrt.bTxtAttr && !bShadow; - if( bShadow || bTxtOut ) - { - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_SHAD; - } - if( bTxtOut ) - rWrt.Strm() << '0'; - return rWrt; -} - - - -static Writer& OutRTF_SwContour( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - const BOOL bContour = ((const SvxContourItem&)rHt).GetValue(); - int bTxtOut = rRTFWrt.bTxtAttr && !bContour; - if( bContour || bTxtOut ) - { - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_OUTL; - } - if( bTxtOut ) - rWrt.Strm() << '0'; - return rWrt; -} - -static Writer& OutRTF_SwCrossedOut( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - const FontStrikeout nStrike = ((const SvxCrossedOutItem&)rHt).GetStrikeout(); - int bTxtOut = rRTFWrt.bTxtAttr && STRIKEOUT_NONE == nStrike; - - if( (STRIKEOUT_NONE != nStrike && STRIKEOUT_DONTKNOW != nStrike) || bTxtOut ) - { - rRTFWrt.bOutFmtAttr = TRUE; - if( STRIKEOUT_DOUBLE == nStrike ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_STRIKED; - if( !bTxtOut ) - rWrt.Strm() << '1'; - } - else - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_STRIKE; - } - if( bTxtOut ) - rWrt.Strm() << '0'; - return rWrt; -} - - - -static Writer& OutRTF_SwCaseMap( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - switch( ((const SvxCaseMapItem&)rHt).GetValue() ) - { - case SVX_CASEMAP_KAPITAELCHEN: - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_SCAPS; - break; - - case SVX_CASEMAP_VERSALIEN: - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CAPS; - break; - - case SVX_CASEMAP_NOT_MAPPED: - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CAPS << '0' << OOO_STRING_SVTOOLS_RTF_SCAPS << '0'; // beide aus !! - break; - - default: - return rWrt; - } - - rRTFWrt.bOutFmtAttr = TRUE; - return rWrt; -} - - -static Writer& OutRTF_SwUnderline( Writer& rWrt, const SfxPoolItem& rHt ) -{ - const char* pStr = 0; - switch( ((const SvxUnderlineItem&)rHt).GetLineStyle() ) - { - case UNDERLINE_SINGLE: - pStr = OOO_STRING_SVTOOLS_RTF_UL; - break; - case UNDERLINE_DOUBLE: - pStr = OOO_STRING_SVTOOLS_RTF_ULDB; - break; - case UNDERLINE_NONE: - pStr = OOO_STRING_SVTOOLS_RTF_ULNONE; - break; - case UNDERLINE_DOTTED: - pStr = OOO_STRING_SVTOOLS_RTF_ULD; - break; - case UNDERLINE_DASH: - pStr = OOO_STRING_SVTOOLS_RTF_ULDASH; - break; - case UNDERLINE_DASHDOT: - pStr = OOO_STRING_SVTOOLS_RTF_ULDASHD; - break; - case UNDERLINE_DASHDOTDOT: - pStr = OOO_STRING_SVTOOLS_RTF_ULDASHDD; - break; - case UNDERLINE_BOLD: - pStr = OOO_STRING_SVTOOLS_RTF_ULTH; - break; - case UNDERLINE_WAVE: - pStr = OOO_STRING_SVTOOLS_RTF_ULWAVE; - break; - case UNDERLINE_BOLDDOTTED: - pStr = OOO_STRING_SVTOOLS_RTF_ULTHD; - break; - case UNDERLINE_BOLDDASH: - pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASH; - break; - case UNDERLINE_LONGDASH: - pStr = OOO_STRING_SVTOOLS_RTF_ULLDASH; - break; - case UNDERLINE_BOLDLONGDASH: - pStr = OOO_STRING_SVTOOLS_RTF_ULTHLDASH; - break; - case UNDERLINE_BOLDDASHDOT: - pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASHD; - break; - case UNDERLINE_BOLDDASHDOTDOT: - pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASHDD; - break; - case UNDERLINE_BOLDWAVE: - pStr = OOO_STRING_SVTOOLS_RTF_ULHWAVE; - break; - case UNDERLINE_DOUBLEWAVE: - pStr = OOO_STRING_SVTOOLS_RTF_ULULDBWAVE; - break; - default: - break; - } - - if( pStr ) - { - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - - if( UNDERLINE_SINGLE == ((const SvxUnderlineItem&)rHt).GetLineStyle() - && ((SvxWordLineModeItem&)rRTFWrt.GetItem( - RES_CHRATR_WORDLINEMODE )).GetValue() ) - pStr = OOO_STRING_SVTOOLS_RTF_ULW; - - rRTFWrt.Strm() << pStr; - rRTFWrt.bOutFmtAttr = TRUE; - - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_ULC; - rWrt.OutULong( rRTFWrt.GetId(((const SvxUnderlineItem&)rHt).GetColor()) ); - - } - - return rWrt; -} - - - -static Writer& OutRTF_SwOverline( Writer& rWrt, const SfxPoolItem& rHt ) -{ - const char* pStr = 0; - switch( ((const SvxOverlineItem&)rHt).GetLineStyle() ) - { - case UNDERLINE_SINGLE: - pStr = OOO_STRING_SVTOOLS_RTF_OL; - break; - case UNDERLINE_DOUBLE: - pStr = OOO_STRING_SVTOOLS_RTF_OLDB; - break; - case UNDERLINE_NONE: - pStr = OOO_STRING_SVTOOLS_RTF_OLNONE; - break; - case UNDERLINE_DOTTED: - pStr = OOO_STRING_SVTOOLS_RTF_OLD; - break; - case UNDERLINE_DASH: - pStr = OOO_STRING_SVTOOLS_RTF_OLDASH; - break; - case UNDERLINE_DASHDOT: - pStr = OOO_STRING_SVTOOLS_RTF_OLDASHD; - break; - case UNDERLINE_DASHDOTDOT: - pStr = OOO_STRING_SVTOOLS_RTF_OLDASHDD; - break; - case UNDERLINE_BOLD: - pStr = OOO_STRING_SVTOOLS_RTF_OLTH; - break; - case UNDERLINE_WAVE: - pStr = OOO_STRING_SVTOOLS_RTF_OLWAVE; - break; - case UNDERLINE_BOLDDOTTED: - pStr = OOO_STRING_SVTOOLS_RTF_OLTHD; - break; - case UNDERLINE_BOLDDASH: - pStr = OOO_STRING_SVTOOLS_RTF_OLTHDASH; - break; - case UNDERLINE_LONGDASH: - pStr = OOO_STRING_SVTOOLS_RTF_OLLDASH; - break; - case UNDERLINE_BOLDLONGDASH: - pStr = OOO_STRING_SVTOOLS_RTF_OLTHLDASH; - break; - case UNDERLINE_BOLDDASHDOT: - pStr = OOO_STRING_SVTOOLS_RTF_OLTHDASHD; - break; - case UNDERLINE_BOLDDASHDOTDOT: - pStr = OOO_STRING_SVTOOLS_RTF_OLTHDASHDD; - break; - case UNDERLINE_BOLDWAVE: - pStr = OOO_STRING_SVTOOLS_RTF_OLHWAVE; - break; - case UNDERLINE_DOUBLEWAVE: - pStr = OOO_STRING_SVTOOLS_RTF_OLOLDBWAVE; - break; - default: - break; - } - - if( pStr ) - { - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - if ( rRTFWrt.bNonStandard ) - { - if( UNDERLINE_SINGLE == ((const SvxOverlineItem&)rHt).GetLineStyle() - && ((SvxWordLineModeItem&)rRTFWrt.GetItem( - RES_CHRATR_WORDLINEMODE )).GetValue() ) - pStr = OOO_STRING_SVTOOLS_RTF_OLW; - - rRTFWrt.Strm() << pStr; - rRTFWrt.bOutFmtAttr = TRUE; - - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_OLC; - rWrt.OutULong( rRTFWrt.GetId(((const SvxOverlineItem&)rHt).GetColor()) ); - } - - } - - return rWrt; -} - - - -static Writer& OutRTF_SwLanguage( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - if( !rRTFWrt.bTxtAttr || - ( rRTFWrt.GetEndPosLst() && - rRTFWrt.GetEndPosLst()->MatchScriptToId( rHt.Which() ) )) - { - - rRTFWrt.bOutFmtAttr = TRUE; - const sal_Char* p = RES_CHRATR_CJK_LANGUAGE == rHt.Which() - ? OOO_STRING_SVTOOLS_RTF_LANGFE : OOO_STRING_SVTOOLS_RTF_LANG; - rWrt.Strm() << p; - rWrt.OutULong( ((const SvxLanguageItem&)rHt).GetLanguage() ); - } - return rWrt; -} - - - -static Writer& OutRTF_SwEscapement( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - const SvxEscapementItem& rEsc = (const SvxEscapementItem&)rHt; - const char * pUpDn; - - SwTwips nH = ((SvxFontHeightItem&)rRTFWrt.GetItem( - RES_CHRATR_FONTSIZE )).GetHeight(); - - if( 0 < rEsc.GetEsc() ) - pUpDn = OOO_STRING_SVTOOLS_RTF_UP; - else if( 0 > rEsc.GetEsc() ) - { - pUpDn = OOO_STRING_SVTOOLS_RTF_DN; - nH = -nH; // den negativen Wert herrausrechnen - } - else - return rWrt; - - // prozentuale Veraenderung speichern ! - short nEsc = rEsc.GetEsc(); - short nProp = rEsc.GetProp() * 100; - if( DFLT_ESC_AUTO_SUPER == nEsc ) - { - nEsc = 100 - rEsc.GetProp(); - ++nProp; - } - else if( DFLT_ESC_AUTO_SUB == nEsc ) - { - nEsc = - 100 + rEsc.GetProp(); - ++nProp; - } - - OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_UPDNPROP, TRUE ); - rWrt.OutULong( nProp ) << '}' << pUpDn; - - /* - * berechne aus der akt. FontSize und dem ProzentWert die Verschiebung, - * wobei im RTF File 1/2 Points stehen muessen, waehrend intern - * mit Twips gerechnet wird. - * Formel : (FontSize * 1/20 ) pts x * 2 - * ----------------------- = ------------ - * 100% Escapement - */ - - rWrt.OutULong( ( (long( nEsc ) * nH) + 500L ) / 1000L ); - // 500L zum Aufrunden !! - return rWrt; -} - - - -static Writer& OutRTF_SwSize( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - if( !rRTFWrt.bTxtAttr || - ( rRTFWrt.GetEndPosLst() && - rRTFWrt.GetEndPosLst()->MatchScriptToId( rHt.Which() ) )) - { - if ( - rRTFWrt.IsAssociatedFlag() && - rHt.Which() == RES_CHRATR_CJK_FONTSIZE - ) - { - /* - #i21422# - Sadly in word rtf we can't retain CJK fontsize when we are not - exporting asian text as it doesn't have a seperate fontsize for - western and asian. - */ - return rWrt; - } - - rRTFWrt.bOutFmtAttr = TRUE; - - const sal_Char* pCmd = rRTFWrt.IsAssociatedFlag() ? OOO_STRING_SVTOOLS_RTF_AFS : OOO_STRING_SVTOOLS_RTF_FS; - rWrt.Strm() << pCmd; - rWrt.OutULong( ((const SvxFontHeightItem&)rHt).GetHeight() / 10 ); - } - return rWrt; -} - - - -static Writer& OutRTF_SwColor( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - /* trage die Color in die Color-Liste vom Writer ein und gebe hier nur - * die entsprechende Nummer aus. Die Color wird spaeter ueber diese - * Tabelle im RTF-Dokument referenziert. - */ - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CF; - rWrt.OutULong( rRTFWrt.GetId( ((const SvxColorItem&)rHt).GetValue() )); - return rWrt; -} - -static Writer& OutRTF_SvxCharHiddenItem(Writer& rWrt, const SfxPoolItem& rHt) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - rRTFWrt.bOutFmtAttr = true; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_V; - if (!((const SvxCharHiddenItem&)rHt).GetValue()) - rWrt.OutULong(0); - return rWrt; -} - -extern void sw3io_ConvertToOldField( const SwField* pFld, USHORT& rWhich, - ULONG& rFmt, ULONG nFFVersion ); - -static Writer& OutRTF_SwField( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwFmtFld & rFld = (SwFmtFld&)rHt; - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - - const SwField* pFld = rFld.GetFld(); - - ByteString aFldStt( '{' ); - ((((aFldStt += OOO_STRING_SVTOOLS_RTF_FIELD) += '{' ) += OOO_STRING_SVTOOLS_RTF_IGNORE) += OOO_STRING_SVTOOLS_RTF_FLDINST) += ' '; - switch( pFld->GetTyp()->Which() ) - { - case RES_COMBINED_CHARS: - { - /* - We need a font size to fill in the defaults, if these are overridden - (as they generally are) by character properties then those properties - win. - - The fontsize that is used in MS for determing the defaults is always - the CJK fontsize even if the text is not in that language, in OOo the - largest fontsize used in the field is the one we should take, but - whatever we do, word will actually render using the fontsize set for - CJK text. Nevertheless we attempt to guess whether the script is in - asian or western text based up on the first character and use the - font size of that script as our default. - */ - const String& rFldPar1 = pFld->GetPar1(); - USHORT nScript; - if( pBreakIt->GetBreakIter().is() ) - nScript = pBreakIt->GetBreakIter()->getScriptType( rFldPar1, 0); - else - nScript = i18n::ScriptType::ASIAN; - - long nHeight = ((SvxFontHeightItem&)rRTFWrt.GetItem( - GetWhichOfScript(RES_CHRATR_FONTSIZE, nScript ))).GetHeight(); - nHeight = (nHeight + 10) / 20; //Font Size in points; - - /* - Divide the combined char string into its up and down part. Get the - font size and fill in the defaults as up == half the font size and - down == a fifth the font size - */ - xub_StrLen nAbove = (rFldPar1.Len()+1)/2; - rWrt.Strm() << aFldStt.GetBuffer() << "EQ \\\\o (\\\\s\\\\up "; - rWrt.OutLong( nHeight/2 ) << '('; - RTFOutFuncs::Out_String( rWrt.Strm(), rFldPar1.Copy(0,nAbove), - rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ); - rWrt.Strm() << "), \\\\s\\\\do "; - rWrt.OutLong( nHeight/5 ) << '('; - RTFOutFuncs::Out_String( rWrt.Strm(), rFldPar1.Copy( nAbove ), - rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ) - << "))"; - } - break; - - case RES_DBFLD: - aFldStt += "MERGEFIELD "; - // kein break !! - case RES_USERFLD: - rWrt.Strm() << aFldStt.GetBuffer(); - RTFOutFuncs::Out_String( rWrt.Strm(), pFld->GetTyp()->GetName(), - rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ); - break; - case RES_GETREFFLD: - { - BYTE nFldTyp = 0; - rWrt.Strm() << aFldStt.GetBuffer() << " REF "; - const SwGetRefField& rRFld = *(SwGetRefField*)pFld; - switch( pFld->GetSubType() ) - { - case REF_SETREFATTR: - case REF_BOOKMARK: - RTFOutFuncs::Out_String( rWrt.Strm(), rRFld.GetSetRefName(), - rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ); - nFldTyp = 3; - break; - } - - if( nFldTyp ) - { - switch( pFld->GetFormat() ) - { - case REF_PAGE_PGDESC: - case REF_PAGE: - rWrt.Strm() << "SEITEN"; - nFldTyp = 37; - break; - case REF_UPDOWN: - rWrt.Strm() << " \\p"; - nFldTyp = 3; - break; - case REF_CHAPTER: - rWrt.Strm() << " \\n"; - break; - case REF_ONLYNUMBER: - case REF_ONLYCAPTION: - case REF_ONLYSEQNO: - break; - // default: - // case REF_CONTENT: - } - rWrt.Strm() << " \\\\h "; // insert hyperlink - } - } - break; -// case RES_CHAPTERFLD: -// rWrt.Strm() << ' '; -// break; - case RES_PAGENUMBERFLD: - rWrt.Strm() << aFldStt.GetBuffer() << "\\\\page"; - { - char __READONLY_DATA - sNType0[] = "ALPHABETIC", /* CHARS_UPPER_LETTER*/ - sNType1[] = "alphabetic", /* CHARS_LOWER_LETTER*/ - sNType2[] = "ROMAN", /* ROMAN_UPPER */ - sNType3[] = "roman", /* ROMAN_LOWER */ - sNType4[] = "ARABIC"; /* ARABIC */ - - const char* pFmtStr = 0; - switch( pFld->GetFormat() ) - { - case SVX_NUM_CHARS_UPPER_LETTER: - case SVX_NUM_CHARS_UPPER_LETTER_N: pFmtStr = sNType0; break; - case SVX_NUM_CHARS_LOWER_LETTER: - case SVX_NUM_CHARS_LOWER_LETTER_N: pFmtStr = sNType1; break; - case SVX_NUM_ROMAN_UPPER: pFmtStr = sNType2; break; - case SVX_NUM_ROMAN_LOWER: pFmtStr = sNType3; break; - case SVX_NUM_ARABIC: pFmtStr = sNType4; break; - } - - if( pFmtStr ) - rWrt.Strm() << "\\\\* " << pFmtStr; - } - break; - case RES_FILENAMEFLD: - rWrt.Strm() << aFldStt.GetBuffer() << "\\\\filename "; - break; - case RES_DBNAMEFLD: - { - rWrt.Strm() << aFldStt.GetBuffer() << "\\\\data "; - SwDBData aData = rWrt.pDoc->GetDBData(); - String sOut(aData.sDataSource); - sOut += DB_DELIM; - sOut += (String)aData.sCommand; - RTFOutFuncs::Out_String( rWrt.Strm(), sOut, - rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ); - } - break; - case RES_AUTHORFLD: - rWrt.Strm() << aFldStt.GetBuffer() << "\\\\author "; - break; - - case RES_HIDDENTXTFLD: - if( TYP_CONDTXTFLD == ((SwHiddenTxtField*)pFld)->GetSubType() ) - RTFOutFuncs::Out_String( rWrt.Strm(), - pFld->ExpandField(rWrt.pDoc->IsClipBoard()), - rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ); - else - { - rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_V << ' '; - OutRTF_AsByteString( rWrt, pFld->GetPar2(), rRTFWrt.eDefaultEncoding ).Strm() - << '}' << SwRTFWriter::sNewLine; - } - return rWrt; // nicht bis zum Ende, kein RTF-Feld !! - - case RES_DATETIMEFLD: - if (!(pFld->GetSubType() & FIXEDFLD)) - { - USHORT nWhich = RES_DATETIMEFLD; - ULONG nFmt = pFld->GetFormat(); - sw3io_ConvertToOldField(pFld, nWhich, nFmt, SOFFICE_FILEFORMAT_40 ); - if (pFld->GetSubType() & DATEFLD) - { - rWrt.Strm() << aFldStt.GetBuffer() << "\\\\date \\\\@\""; - switch( nFmt ) - { - case DF_SSYS: rWrt.Strm() << "tt.MM.yy"; break; - case DF_LSYS: rWrt.Strm() << "tttt, t. MMMM yyyy"; break; - case DF_SHORT: rWrt.Strm() << "tt.MM.yy"; break; - case DF_SCENT: rWrt.Strm() << "tt.MM.yyyy"; break; - case DF_LMON: rWrt.Strm() << "t. MMM yyyy"; break; - case DF_LMONTH: rWrt.Strm() << "t. MMMM yyyy"; break; - case DF_LDAYMON: rWrt.Strm() << "ttt, t. MMMM yyyy"; break; - case DF_LDAYMONTH: rWrt.Strm() << "tttt, t. MMMM yyyy"; break; - } - } - else - { - rWrt.Strm() << aFldStt.GetBuffer() << "\\\\date \\\\@\""; - switch( nFmt ) - { - case TF_SSMM_24: rWrt.Strm() << "HH:mm"; break; - case TF_SSMM_12: rWrt.Strm() << "hh:mm"; break; // ??? - case TF_SYSTEM: rWrt.Strm() << "HH:mm"; break; - } - } - rWrt.Strm() << '\"'; - break; - } - // Kein break: in default-Zweig laufen! - - default: - { - aFldStt.Erase(); - - // JP 20.07.95: warum nicht das Expandierte rausschreiben ? - sal_Char cCh; - rWrt.Strm().SeekRel(-1); - rWrt.Strm() >> cCh; - if( ' ' != cCh ) // vorweg immer einen Trenner - rWrt.Strm() << ' '; - RTFOutFuncs::Out_String( rWrt.Strm(), - pFld->ExpandField(rWrt.pDoc->IsClipBoard()), - rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ); - } - break; - } - - if( aFldStt.Len() ) - { - rWrt.Strm() << "}{" << OOO_STRING_SVTOOLS_RTF_FLDRSLT << ' '; - RTFOutFuncs::Out_String( rWrt.Strm(), - pFld->ExpandField(rWrt.pDoc->IsClipBoard()), - rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ); - rWrt.Strm() << "}}"; - rRTFWrt.bOutFmtAttr = FALSE; - } - - return rWrt; -} - -static Writer& OutRTF_SwFlyCntnt( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwFrmFmt* pFmt = ((SwFmtFlyCnt&)rHt).GetFrmFmt(); - if (RES_DRAWFRMFMT != pFmt->Which()) - { - ((SwRTFWriter&)rWrt).OutRTFFlyFrms( *((SwFlyFrmFmt*)pFmt) ); - ((SwRTFWriter&)rWrt).bOutFmtAttr = false; - } - return rWrt; -} - -static Writer& OutRTF_SwFtn( Writer& rWrt, const SfxPoolItem& rHt ) -{ - const SwFmtFtn& rFtn = (const SwFmtFtn&)rHt; - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - - do { // middle-check-loop - if( !rFtn.GetTxtFtn() || !rFtn.GetTxtFtn()->GetStartNode() ) - break; // es gibt keine Kopf-/Fusszeile/Fussnote - - // Hole vom Node und vom letzten Node die Position in der Section - ULONG nStart = rFtn.GetTxtFtn()->GetStartNode()->GetIndex()+1, - nEnd = rWrt.pDoc->GetNodes()[ nStart-1 ]->EndOfSectionIndex(); - - // kein Bereich also kein gueltiger Node - if( nStart >= nEnd ) - break; - - rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_SUPER << ' '; - if( !rFtn.GetNumStr().Len() ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CHFTN; - OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_FOOTNOTE ); - if( rFtn.IsEndNote() ) - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FTNALT; - rWrt.Strm() << ' ' << OOO_STRING_SVTOOLS_RTF_CHFTN; - } - else - { - OutRTF_AsByteString( rWrt, rFtn.GetNumStr(), rRTFWrt.eDefaultEncoding ); - OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_FOOTNOTE ); - if( rFtn.IsEndNote() ) - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FTNALT; - rWrt.Strm() << ' '; - OutRTF_AsByteString( rWrt, rFtn.GetNumStr(), rRTFWrt.eDefaultEncoding ); - } - RTFSaveData aSaveData( rRTFWrt, nStart, nEnd ); - // damit kein \par ausgegeben wird !! - rRTFWrt.pCurPam->GetMark()->nContent++; - rRTFWrt.Out_SwDoc( rRTFWrt.pCurPam ); - - rWrt.Strm() << "}}" << SwRTFWriter::sNewLine; - rRTFWrt.bOutFmtAttr = FALSE; - - } while( FALSE ); - return rWrt; -} - -static Writer& OutRTF_SwTxtCharFmt( Writer& rWrt, const SfxPoolItem& rHt ) -{ - const SwFmtCharFmt& rChrFmt = (const SwFmtCharFmt&)rHt; - const SwCharFmt* pFmt = rChrFmt.GetCharFmt(); - - if( pFmt ) - OutRTF_SwFmt( rWrt, *pFmt ); - return rWrt; -} - -static Writer& OutRTF_SwTxtAutoFmt( Writer& rWrt, const SfxPoolItem& rHt ) -{ - const SwFmtAutoFmt& rAutoFmt = (const SwFmtAutoFmt&)rHt; - const boost::shared_ptr<SfxItemSet> pSet = rAutoFmt.GetStyleHandle(); - - if( pSet.get() ) - { - SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt; - OutRTF_SfxItemSet( rRTFWrt, *pSet.get(), FALSE ); - } - return rWrt; -} - -static Writer& OutRTF_SwTxtRuby( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - const SwFmtRuby& rRuby = (const SwFmtRuby&)rHt; - const SwTxtRuby* pRubyTxt = rRuby.GetTxtRuby(); - const SwTxtNode* pNd; - - if( !pRubyTxt || 0 == (pNd = pRubyTxt->GetpTxtNode() )) - return rWrt; - - sal_Char cDirective = 0, cJC = '0'; - switch( rRuby.GetAdjustment() ) - { - case 0: cJC = '3'; cDirective = 'l'; break; - case 2: cJC = '4'; cDirective = 'r'; break; - case 3: cJC = '1'; cDirective = 'd'; break; - case 4: cJC = '2'; cDirective = 'd'; break; - case 1: break; //defaults to 0 - default: - ASSERT( FALSE, "Unhandled Ruby justication code" ); - break; - } - - /* - MS needs to know the name and size of the font used in the ruby item, - but we coud have written it in a mixture of asian and western - scripts, and each of these can be a different font and size than the - other, so we make a guess based upon the first character of the text, - defaulting to asian. - */ - USHORT nScript; - if( pBreakIt->GetBreakIter().is() ) - nScript = pBreakIt->GetBreakIter()->getScriptType( rRuby.GetText(), 0); - else - nScript = i18n::ScriptType::ASIAN; - - const SwCharFmt* pFmt = pRubyTxt->GetCharFmt(); - const SvxFontItem *pFont; - long nHeight; - - if( pFmt ) - { - const SwAttrSet& rSet = pFmt->GetAttrSet(); - pFont = &(const SvxFontItem&)rSet.Get( GetWhichOfScript( - RES_CHRATR_FONT, nScript )); - - nHeight = ((SvxFontHeightItem&)rSet.Get( - GetWhichOfScript( RES_CHRATR_FONTSIZE, nScript ))).GetHeight(); - } - else - { - /*Get document defaults if no formatting on ruby text*/ - const SfxItemPool *pPool = pNd->GetSwAttrSet().GetPool(); - pFont = &(const SvxFontItem&)pPool->GetDefaultItem( - GetWhichOfScript( RES_CHRATR_FONT, nScript )); - - nHeight = ((SvxFontHeightItem&)pPool->GetDefaultItem( - GetWhichOfScript( RES_CHRATR_FONTSIZE, nScript ))).GetHeight(); - } - ( nHeight += 5 ) /= 10; - - // don't change " EQ " to any other without changing the code in RTFFLD.CXX - rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_FIELD << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_FLDINST - << " EQ \\\\* jc" << cJC - << " \\\\* \"Font:"; - RTFOutFuncs::Out_String( rWrt.Strm(), pFont->GetFamilyName(), - rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ); - rWrt.Strm() << "\" \\\\* hps"; - rWrt.OutLong( nHeight ); - rWrt.Strm() << " \\\\o"; - if( cDirective ) - rWrt.Strm() << "\\\\a" << cDirective; - rWrt.Strm() << "(\\\\s\\\\up "; - - if( pBreakIt->GetBreakIter().is() ) - nScript = pBreakIt->GetBreakIter()->getScriptType( pNd->GetTxt(), - *pRubyTxt->GetStart() ); - else - nScript = i18n::ScriptType::ASIAN; - - const SwAttrSet& rSet = pNd->GetSwAttrSet(); - nHeight = ((SvxFontHeightItem&)rSet.Get( - GetWhichOfScript( RES_CHRATR_FONTSIZE, nScript ))).GetHeight(); - (nHeight += 10) /= 20-1; - rWrt.OutLong( nHeight ) << '('; - - if( pFmt ) - { - rWrt.Strm() << '{'; - OutRTF_SwFmt( rWrt, *pFmt ); - if( rRTFWrt.bOutFmtAttr ) - rWrt.Strm() << ' '; - } - RTFOutFuncs::Out_String( rWrt.Strm(), rRuby.GetText(), - rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ); - if( pFmt ) - rWrt.Strm() << '}'; - - rWrt.Strm() << "),"; - rRTFWrt.bOutFmtAttr = FALSE; - - return rWrt; -} - - -/* File FRMATR.HXX */ - -static Writer& OutRTF_SwFrmSize( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - const SwFmtFrmSize& rSz = (const SwFmtFrmSize&)rHt; - if( rRTFWrt.pFlyFmt ) // wird das FlyFrmFmt ausgegeben ? - { - if( !rRTFWrt.bRTFFlySyntax ) - return rWrt; - - if( rSz.GetWidth() ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_ABSW; - rWrt.OutLong( rSz.GetWidth() ); - rRTFWrt.bOutFmtAttr = TRUE; - } - - if( rSz.GetHeight() ) - { - long nH = rSz.GetHeight(); - if( ATT_FIX_SIZE == rSz.GetHeightSizeType() ) - nH = -nH; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_ABSH; - rWrt.OutLong( nH ); - rRTFWrt.bOutFmtAttr = TRUE; - } - } - else if( rRTFWrt.bOutPageDesc ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PGWSXN; - rWrt.OutLong( rSz.GetWidth() ); - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PGHSXN; - rWrt.OutLong( rSz.GetHeight() ); - rRTFWrt.bOutFmtAttr = TRUE; - } - return rWrt; -} - -static Writer& OutRTF_SwFmtLRSpace( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - const SvxLRSpaceItem & rLR = (const SvxLRSpaceItem&) rHt; - if( !rRTFWrt.pFlyFmt ) - { - if( rRTFWrt.bOutPageDesc ) - { - if( rLR.GetLeft() ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_MARGLSXN; - rWrt.OutLong( rLR.GetLeft() ); - rRTFWrt.bOutFmtAttr = TRUE; - } - if( rLR.GetRight() ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_MARGRSXN; - rWrt.OutLong( rLR.GetRight() ); - rRTFWrt.bOutFmtAttr = TRUE; - } - } - else - { - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LI; - rWrt.OutLong( rLR.GetTxtLeft() ) << OOO_STRING_SVTOOLS_RTF_RI; - rWrt.OutLong( rLR.GetRight() ); - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LIN; - rWrt.OutLong( rLR.GetTxtLeft() ) << OOO_STRING_SVTOOLS_RTF_RIN; - rWrt.OutLong( rLR.GetRight() ); - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FI; - rWrt.OutLong( rLR.GetTxtFirstLineOfst() ); - } - } - else if( rLR.GetLeft() == rLR.GetRight() && rRTFWrt.bRTFFlySyntax ) - { - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_DFRMTXTX; - rWrt.OutLong( rLR.GetLeft() ); - } - return rWrt; -} - -static Writer& OutRTF_SwFmtULSpace( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - const SvxULSpaceItem & rUL = (const SvxULSpaceItem&) rHt; - if( rRTFWrt.pFlyFmt ) - { - if( rUL.GetUpper() == rUL.GetLower() && rRTFWrt.bRTFFlySyntax ) - { - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_DFRMTXTY; - rWrt.OutLong( rUL.GetLower() ); - } - } - else - { - const char* p; - USHORT nValue = rUL.GetUpper(); - if( rRTFWrt.bOutPageDesc ) - { - p = OOO_STRING_SVTOOLS_RTF_MARGTSXN; - if( !rRTFWrt.bOutPageDescTbl ) - { - SwRect aRect; - const SwFmtHeader* pHdr; - if( SFX_ITEM_SET == rRTFWrt.pAktPageDesc->GetMaster(). - GetItemState( RES_HEADER, FALSE, - (const SfxPoolItem**)&pHdr ) && pHdr->IsActive() ) - { - aRect = pHdr->GetHeaderFmt()->FindLayoutRect( FALSE ); - if( aRect.Height() ) - nValue = nValue + static_cast< USHORT >(aRect.Height()); - else - { - const SwFmtFrmSize& rSz = pHdr->GetHeaderFmt()->GetFrmSize(); - if( ATT_VAR_SIZE != rSz.GetHeightSizeType() ) - nValue = nValue + static_cast< USHORT >(rSz.GetHeight()); - else - nValue = nValue + 274; // defaulten fuer 12pt Schrift - nValue = nValue + pHdr->GetHeaderFmt()->GetULSpace().GetLower(); - } - } - } - } - else - p = OOO_STRING_SVTOOLS_RTF_SB; - - if( rRTFWrt.bOutPageDesc || nValue ) - { - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << p; - rWrt.OutLong( nValue ); - } - - - nValue = rUL.GetLower(); - if( rRTFWrt.bOutPageDesc ) - { - p = OOO_STRING_SVTOOLS_RTF_MARGBSXN; - if( !rRTFWrt.bOutPageDescTbl ) - { - SwRect aRect; - const SwFmtFooter* pFtr; - if( SFX_ITEM_SET == rRTFWrt.pAktPageDesc->GetMaster(). - GetItemState( RES_FOOTER, FALSE, - (const SfxPoolItem**)&pFtr ) && pFtr->IsActive() ) - { - aRect = pFtr->GetFooterFmt()->FindLayoutRect( FALSE ); - if( aRect.Height() ) - nValue = nValue + static_cast< USHORT >(aRect.Height()); - else - { - const SwFmtFrmSize& rSz = pFtr->GetFooterFmt()->GetFrmSize(); - if( ATT_VAR_SIZE != rSz.GetHeightSizeType() ) - nValue = nValue + static_cast< USHORT >(rSz.GetHeight()); - else - nValue += 274; // defaulten fuer 12pt Schrift - nValue = nValue + pFtr->GetFooterFmt()->GetULSpace().GetUpper(); - } - } - } - } - else - p = OOO_STRING_SVTOOLS_RTF_SA; - - if( rRTFWrt.bOutPageDesc || nValue ) - { - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << p; - rWrt.OutLong( nValue ); - } - } - return rWrt; -} - -// Header-Footer werden auch vom RTF-Writer direkt gerufen, also kein static! - - -Writer& OutRTF_SwFmtHeader( Writer& rWrt, const SfxPoolItem& rHt ) -{ - const SwFmtHeader& rHd = (const SwFmtHeader&)rHt; - if( !rHd.IsActive() ) // nicht aktiv, dann nichts weiter ausgeben - return rWrt; - - // hole einen Node zu dem Request - SwStartNode *pSttNode = 0; - const SwFmtCntnt& rCntnt = rHd.GetHeaderFmt()->GetCntnt(); - if( rCntnt.GetCntntIdx() ) - pSttNode = rCntnt.GetCntntIdx()->GetNode().GetStartNode(); - - do { // middle-check-loop - if( !pSttNode ) - break; // es gibt keine Kopf-/Fusszeile/Fussnote - - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - - // Hole vom Node und vom letzten Node die Position in der Section - ULONG nStart = pSttNode->GetIndex() + 1, - nEnd = pSttNode->EndOfSectionIndex(); - - // kein Bereich also kein gueltiger Node - if( nStart >= nEnd ) - break; - ASSERT( rRTFWrt.pAktPageDesc, "Header-Attribut ohne PageDesc" ); - - const sal_Char * pHdNm = OOO_STRING_SVTOOLS_RTF_HEADER; - rWrt.Strm() << pHdNm << 'y'; - if( rRTFWrt.bOutPageDescTbl ) - { - // hole die Ober-/Unterkanten vom Header - const SvxULSpaceItem& rUL = rHd.GetHeaderFmt()->GetULSpace(); - const SvxLRSpaceItem& rLR = rHd.GetHeaderFmt()->GetLRSpace(); - const SwFmtFrmSize& rSz = rHd.GetHeaderFmt()->GetFrmSize(); - - rWrt.OutLong( rUL.GetUpper() ); - OutComment( rWrt, pHdNm ) << "yb"; - rWrt.OutLong( rUL.GetLower() ) << pHdNm << "xl"; - rWrt.OutLong( rLR.GetLeft() ) << pHdNm << "xr"; - rWrt.OutLong( rLR.GetRight() ) << pHdNm << "yh"; - rWrt.OutLong( ATT_FIX_SIZE == rSz.GetHeightSizeType() - ? -rSz.GetHeight() - : rSz.GetHeight() ) << '}'; - } - else - rWrt.OutLong( rRTFWrt.pAktPageDesc->GetMaster(). - GetULSpace().GetUpper() ); - - // wird nicht die PageDesc-Tabelle ausgegeben und gibt es einen - // Nachfolger, dann handelt es sich um die "1.Seite" nach RTF. - sal_Char cTyp = 0; - if( rRTFWrt.pAktPageDesc->GetFollow() && - rRTFWrt.pAktPageDesc->GetFollow() != rRTFWrt.pAktPageDesc ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TITLEPG; //i13107 - cTyp = 'f'; // dann FirstPage-Header - } - else if( !rRTFWrt.pAktPageDesc->IsHeaderShared() ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FACINGP; //i13107 - cTyp = rRTFWrt.bOutLeftHeadFoot ? 'l' : 'r'; - } - - rWrt.Strm() << '{'<< pHdNm; - if( cTyp ) rWrt.Strm() << cTyp; - rWrt.Strm() << ' '; - - { - RTFSaveData aSaveData( rRTFWrt, nStart, nEnd ); - rRTFWrt.Out_SwDoc( rRTFWrt.pCurPam ); - } - - rWrt.Strm() << '}' << SwRTFWriter::sNewLine; - - } while( FALSE ); - return rWrt; -} -// Header-Footer werden auch vom RTF-Writer direkt gerufen, also kein static! - - -Writer& OutRTF_SwFmtFooter( Writer& rWrt, const SfxPoolItem& rHt ) -{ - const SwFmtFooter& rFt = (const SwFmtFooter&)rHt; - if( !rFt.IsActive() ) // nicht aktiv, dann nichts weiter ausgeben - return rWrt; - - SwStartNode *pSttNode = 0; - const SwFmtCntnt& rCntnt = rFt.GetFooterFmt()->GetCntnt(); - if( rCntnt.GetCntntIdx() ) - pSttNode = rCntnt.GetCntntIdx()->GetNode().GetStartNode(); - - do { // middle-check-loop - if( !pSttNode ) - break; // es gibt keine Kopf-/Fusszeile/Fussnote - - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - - // Hole vom Node und vom letzten Node die Position in der Section - ULONG nStart = pSttNode->GetIndex()+1, - nEnd = pSttNode->EndOfSectionIndex(); - - // kein Bereich also kein gueltiger Node - if( nStart >= nEnd ) - break; - ASSERT( rRTFWrt.pAktPageDesc, "Footer-Attribut ohne PageDesc" ); - - const sal_Char * pFtNm = OOO_STRING_SVTOOLS_RTF_FOOTER; - rWrt.Strm() << pFtNm << 'y'; - if( rRTFWrt.bOutPageDescTbl ) - { - // hole die Ober-/Unterkanten vom Footer - const SvxULSpaceItem& rUL = rFt.GetFooterFmt()->GetULSpace(); - const SvxLRSpaceItem& rLR = rFt.GetFooterFmt()->GetLRSpace(); - const SwFmtFrmSize& rSz = rFt.GetFooterFmt()->GetFrmSize(); - - rWrt.OutLong( rUL.GetLower() ); - OutComment( rWrt, pFtNm ) << "yt"; - rWrt.OutLong( rUL.GetUpper() ) << pFtNm << "xl"; - rWrt.OutLong( rLR.GetLeft() ) << pFtNm << "xr"; - rWrt.OutLong( rLR.GetRight() ) << pFtNm << "yh"; - rWrt.OutLong( ATT_FIX_SIZE == rSz.GetHeightSizeType() - ? -rSz.GetHeight() - : rSz.GetHeight() ) << '}'; - } - else - rWrt.OutLong( rRTFWrt.pAktPageDesc->GetMaster(). - GetULSpace().GetLower() ); - - // wird nicht die PageDesc-Tabelle ausgegeben und gibt es einen - // Nachfolger, dann handelt es sich um die "1.Seite" nach RTF. - sal_Char cTyp = 0; - if( !rRTFWrt.bOutPageDesc && rRTFWrt.pAktPageDesc->GetFollow() && - rRTFWrt.pAktPageDesc->GetFollow() != rRTFWrt.pAktPageDesc ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TITLEPG; //i13107 - cTyp = 'f'; // dann FirstPage-Header - } - else if( !rRTFWrt.pAktPageDesc->IsFooterShared() ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FACINGP; //i13107 - cTyp = rRTFWrt.bOutLeftHeadFoot ? 'l' : 'r'; - } - - rWrt.Strm() << '{'<< pFtNm; - if( cTyp ) rWrt.Strm() << cTyp; - rWrt.Strm() << ' '; - - { - RTFSaveData aSaveData( rRTFWrt, nStart, nEnd ); - rRTFWrt.Out_SwDoc( rRTFWrt.pCurPam ); - } - - rWrt.Strm() << '}' << SwRTFWriter::sNewLine; - - } while( FALSE ); - return rWrt; -} - -static Writer& OutRTF_SwFmtPrint( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - if( !rRTFWrt.bRTFFlySyntax && !((const SvxPrintItem&)rHt).GetValue() ) - { - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYPRINT; - } - return rWrt; -} - - -static Writer& OutRTF_SwFmtOpaque( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - if( !rRTFWrt.bRTFFlySyntax && !((const SvxOpaqueItem&)rHt).GetValue() ) - { - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYOPAQUE; - } - return rWrt; -} - - -static Writer& OutRTF_SwFmtProtect( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - if( !rRTFWrt.bRTFFlySyntax ) - { - const SvxProtectItem & rFlyProtect = (const SvxProtectItem&) rHt; - RTFProtect aP( rFlyProtect.IsCntntProtected(), - rFlyProtect.IsSizeProtected(), - rFlyProtect.IsPosProtected() ); - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYPRTCTD; - rWrt.OutULong( aP.GetValue() ); - } - return rWrt; -} - - -static Writer& OutRTF_SwFmtSurround( Writer& rWrt, const SfxPoolItem& rHt ) -{ - const SwFmtSurround& rFlySurround = (const SwFmtSurround&) rHt; - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - if( rRTFWrt.bRTFFlySyntax ) - { - if( SURROUND_NONE == rFlySurround.GetSurround() ) - { - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_NOWRAP; - } - } - else - { - SwSurround eSurround = rFlySurround.GetSurround(); - BOOL bGold = SURROUND_IDEAL == eSurround; - if( bGold ) - eSurround = SURROUND_PARALLEL; - RTFSurround aMC( bGold, static_cast< BYTE >(eSurround) ); - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYMAINCNT; - rWrt.OutULong( aMC.GetValue() ); - rRTFWrt.bOutFmtAttr = TRUE; - } - return rWrt; -} - -static Writer& OutRTF_SwFmtVertOrient ( Writer& rWrt, const SfxPoolItem& rHt ) -{ - const SwFmtVertOrient& rFlyVert = (const SwFmtVertOrient&) rHt; - RTFVertOrient aVO( static_cast< USHORT >(rFlyVert.GetVertOrient()), static_cast< USHORT >(rFlyVert.GetRelationOrient()) ); - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - - if( rRTFWrt.bRTFFlySyntax && rRTFWrt.pFlyFmt ) - { - rRTFWrt.bOutFmtAttr = TRUE; - const char* pOrient; - RndStdIds eAnchor = rRTFWrt.pFlyFmt->GetAnchor().GetAnchorId(); - sal_Int16 eOrient = rFlyVert.GetRelationOrient(); - if (FLY_AT_PAGE == eAnchor) - { - if( text::RelOrientation::PAGE_FRAME == eOrient || text::RelOrientation::FRAME == eOrient ) - pOrient = OOO_STRING_SVTOOLS_RTF_PVPG; - else - pOrient = OOO_STRING_SVTOOLS_RTF_PVMRG; - } - else - pOrient = OOO_STRING_SVTOOLS_RTF_PVPARA; - rWrt.Strm() << pOrient; - - switch (rFlyVert.GetVertOrient()) - { - case text::VertOrientation::TOP: - case text::VertOrientation::LINE_TOP: - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_POSYT; - break; - case text::VertOrientation::BOTTOM: - case text::VertOrientation::LINE_BOTTOM: - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_POSYB; - break; - case text::VertOrientation::CENTER: - case text::VertOrientation::LINE_CENTER: - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_POSYC; - break; - case text::VertOrientation::NONE: - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_POSY; - rWrt.OutULong(rFlyVert.GetPos()); - break; - default: - break; - } - } - else if( !rRTFWrt.bRTFFlySyntax ) - { - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYVERT; - rWrt.OutULong( aVO.GetValue() ); - } - - return rWrt; -} - -static Writer& OutRTF_SwFmtHoriOrient( Writer& rWrt, const SfxPoolItem& rHt ) -{ - const SwFmtHoriOrient& rFlyHori = (const SwFmtHoriOrient&) rHt; - RTFHoriOrient aHO( static_cast< USHORT >(rFlyHori.GetHoriOrient()), - static_cast< USHORT >(rFlyHori.GetRelationOrient()) ); - - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - if( rRTFWrt.bRTFFlySyntax && rRTFWrt.pFlyFmt ) - { - rRTFWrt.bOutFmtAttr = TRUE; - const char* pS; - RndStdIds eAnchor = rRTFWrt.pFlyFmt->GetAnchor().GetAnchorId(); - sal_Int16 eOrient = rFlyHori.GetRelationOrient(); - if (FLY_AT_PAGE == eAnchor) - { - if( text::RelOrientation::PAGE_FRAME == eOrient || text::RelOrientation::FRAME == eOrient ) - pS = OOO_STRING_SVTOOLS_RTF_PHPG; - else - pS = OOO_STRING_SVTOOLS_RTF_PHMRG; - } - else - pS = OOO_STRING_SVTOOLS_RTF_PHCOL; - rWrt.Strm() << pS; - - pS = 0; - switch(rFlyHori.GetHoriOrient()) - { - case text::HoriOrientation::RIGHT: - pS = rFlyHori.IsPosToggle() ? OOO_STRING_SVTOOLS_RTF_POSXO : OOO_STRING_SVTOOLS_RTF_POSXR; - break; - case text::HoriOrientation::LEFT: - pS = rFlyHori.IsPosToggle() ? OOO_STRING_SVTOOLS_RTF_POSXI : OOO_STRING_SVTOOLS_RTF_POSXL; - break; - case text::HoriOrientation::CENTER: - pS = OOO_STRING_SVTOOLS_RTF_POSXC; - break; - case text::HoriOrientation::NONE: - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_POSX; - rWrt.OutULong( rFlyHori.GetPos() ); - break; - default: - break; - } - if (pS) - rWrt.Strm() << pS; - } - else - { - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYHORZ; - rWrt.OutULong( aHO.GetValue() ); - } - return rWrt; -} - -static Writer& OutRTF_SwFmtAnchor( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - if( !rRTFWrt.bRTFFlySyntax ) - { - const SwFmtAnchor& rAnchor = (const SwFmtAnchor&) rHt; - USHORT nId = static_cast< USHORT >(rAnchor.GetAnchorId()); - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYANCHOR; - rWrt.OutULong( nId ); - rRTFWrt.bOutFmtAttr = TRUE; - switch( nId ) - { - case FLY_AT_PAGE: - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYPAGE; - rWrt.OutULong( rAnchor.GetPageNum() ); - break; - case FLY_AT_PARA: - case FLY_AS_CHAR: - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYCNTNT; - break; - } - } - return rWrt; -} - - - -static Writer& OutRTF_SwFmtBackground( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - // wird das FlyFrmFmt ausgegeben, dann Background nur ausgeben, wenn - // RTF-Syntax gesetzt ist ! - if( !rRTFWrt.pFlyFmt || !rRTFWrt.bRTFFlySyntax ) - { - const SvxBrushItem& rBack = (const SvxBrushItem&)rHt; - if( !rBack.GetColor().GetTransparency() ) - { - ByteString sOut( OOO_STRING_SVTOOLS_RTF_CBPAT ); - sOut += ByteString::CreateFromInt32( - rRTFWrt.GetId( rBack.GetColor() )); - - if( rRTFWrt.pFlyFmt || rRTFWrt.bOutPageDesc ) - { - rWrt.Strm() << '{' << sOut.GetBuffer() << '}'; - } - else - { - rRTFWrt.bOutFmtAttr = TRUE; - rWrt.Strm() << sOut.GetBuffer(); - } - } - } - return rWrt; -} - - -static Writer& OutRTF_SwFmtShadow( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - // wird das FlyFrmFmt ausgegeben, dann Schatten nur ausgeben, wenn - // nicht RTF-Syntax gesetzt ist ! - if( rRTFWrt.pFlyFmt && rRTFWrt.bRTFFlySyntax ) - return rWrt; - - const SvxShadowItem& rShadow = (const SvxShadowItem&)rHt; - // FALSE wegen schliessender Klammer !! - OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_SHADOW, FALSE ); - rWrt.OutULong( rShadow.GetLocation() ) << OOO_STRING_SVTOOLS_RTF_SHDWDIST; - rWrt.OutULong( rShadow.GetWidth() ) << OOO_STRING_SVTOOLS_RTF_SHDWSTYLE; - const Color& rColor = rShadow.GetColor(); - rWrt.OutULong( rColor.GetTransparency() ? SW_SV_BRUSH_NULL : SW_SV_BRUSH_SOLID ); - rWrt.OutULong( rRTFWrt.GetId( rColor ) ) << OOO_STRING_SVTOOLS_RTF_SHDWFCOL; - rWrt.OutULong( 0 ) << '}'; - return rWrt; -} - - -static void OutBorderLine( SwRTFWriter& rWrt, const SvxBorderLine* pLine, - const char* pStr ) -{ - rWrt.Strm() << pStr << OOO_STRING_SVTOOLS_RTF_BRDLNCOL; - rWrt.OutULong( rWrt.GetId( pLine->GetColor() ) ) << OOO_STRING_SVTOOLS_RTF_BRDLNIN; - rWrt.OutULong( pLine->GetInWidth() ) << OOO_STRING_SVTOOLS_RTF_BRDLNOUT; - rWrt.OutULong( pLine->GetOutWidth() ) << OOO_STRING_SVTOOLS_RTF_BRDLNDIST; - rWrt.OutULong( pLine->GetDistance() ); -} - - -static Writer& OutRTF_SwFmtBox( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - - const SvxBoxItem& rBox = (const SvxBoxItem&)rHt; - - static USHORT __READONLY_DATA aBorders[] = { - BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT }; - static const sal_Char* __READONLY_DATA aBorderNames[] = { - OOO_STRING_SVTOOLS_RTF_BRDRT, OOO_STRING_SVTOOLS_RTF_BRDRL, OOO_STRING_SVTOOLS_RTF_BRDRB, OOO_STRING_SVTOOLS_RTF_BRDRR }; - - USHORT nDist = rBox.GetDistance(); - - // wird das FlyFrmFmt ausgegeben, dann Border nur ausgeben, wenn - // nicht RTF-Syntax gesetzt ist! - if( rRTFWrt.pFlyFmt && rRTFWrt.bRTFFlySyntax ) - { -/* -RTF kennt keine Rahmen Umrandung! - // die normale RTF-Definition - if( rBox.GetTop() && rBox.GetBottom() && - rBox.GetLeft() && rBox.GetRight() && - *rBox.GetTop() == *rBox.GetBottom() && - *rBox.GetTop() == *rBox.GetLeft() && - *rBox.GetTop() == *rBox.GetRight() ) - OutBorderLine( rRTFWrt, rBox.GetTop(), OOO_STRING_SVTOOLS_RTF_BOX, nDist ); - else - { - OUT_BRDLINE( rBox.GetTop(), OOO_STRING_SVTOOLS_RTF_BRDRT, nDist ); - OUT_BRDLINE( rBox.GetBottom(), OOO_STRING_SVTOOLS_RTF_BRDRB, nDist ); - OUT_BRDLINE( rBox.GetLeft(), OOO_STRING_SVTOOLS_RTF_BRDRL, nDist ); - OUT_BRDLINE( rBox.GetRight(), OOO_STRING_SVTOOLS_RTF_BRDRR, nDist ); - } -*/ - return rWrt; - } - else if( !rRTFWrt.pFlyFmt ) - { - // erst die normale RTF-Definition, dann unsere eigene - if( rBox.GetTop() && rBox.GetBottom() && - rBox.GetLeft() && rBox.GetRight() && - *rBox.GetTop() == *rBox.GetBottom() && - *rBox.GetTop() == *rBox.GetLeft() && - *rBox.GetTop() == *rBox.GetRight() && - nDist == rBox.GetDistance( BOX_LINE_TOP ) && - nDist == rBox.GetDistance( BOX_LINE_LEFT ) && - nDist == rBox.GetDistance( BOX_LINE_BOTTOM ) && - nDist == rBox.GetDistance( BOX_LINE_RIGHT )) - OutBorderLine( rRTFWrt, rBox.GetTop(), OOO_STRING_SVTOOLS_RTF_BOX, nDist ); - else - { - const USHORT* pBrd = aBorders; - const sal_Char** pBrdNms = (const sal_Char**)aBorderNames; - for(int i = 0; i < 4; ++i, ++pBrd, ++pBrdNms) - { - if (const SvxBorderLine* pLn = rBox.GetLine(*pBrd)) - { - OutBorderLine(rRTFWrt, pLn, *pBrdNms, - rBox.GetDistance(*pBrd)); - } - } - } - } - - const USHORT* pBrd = aBorders; - const sal_Char** pBrdNms = (const sal_Char**)aBorderNames; - for( int i = 0; i < 4; ++i, ++pBrd, ++pBrdNms ) - { - const SvxBorderLine* pLn = rBox.GetLine( *pBrd ); - if( pLn ) - { - rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE; - OutBorderLine( rRTFWrt, pLn, *pBrdNms ); - rWrt.Strm() << '}' << OOO_STRING_SVTOOLS_RTF_BRSP; - rWrt.OutULong( rBox.GetDistance( *pBrd )); - } - } - - rRTFWrt.bOutFmtAttr = FALSE; - return rWrt; -} - -static Writer& OutRTF_SwFmtCol( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = ((SwRTFWriter&)rWrt); - if( rRTFWrt.pFlyFmt && rRTFWrt.bRTFFlySyntax ) - return rWrt; - - const SwFmtCol& rCol = (const SwFmtCol&)rHt; - const SwColumns& rColumns = rCol.GetColumns(); - - USHORT nCols = rColumns.Count(); - if( 1 < nCols ) - { - // dann besorge mal die Seitenbreite ohne Raender !! - const SwFrmFmt* pFmt; - - if( rRTFWrt.pFlyFmt ) - pFmt = rRTFWrt.pFlyFmt; - else if( rRTFWrt.pAktPageDesc ) - pFmt = &rRTFWrt.pAktPageDesc->GetMaster(); - else - pFmt = &const_cast<const SwDoc *>(rWrt.pDoc) - ->GetPageDesc(0).GetMaster(); - - const SvxLRSpaceItem& rLR = pFmt->GetLRSpace(); - - USHORT nPageSize = static_cast< USHORT >( pFmt->GetFrmSize().GetWidth() - - rLR.GetLeft() - rLR.GetRight() ); - - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_COLS; - rWrt.OutLong( nCols ); - - if( rCol.IsOrtho() ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_COLSX; - rWrt.OutLong( rCol.GetGutterWidth( TRUE ) ); - } - else - for( USHORT n = 0; n < nCols; ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_COLNO; - rWrt.OutLong( n+1 ); - - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_COLW; - rWrt.OutLong( rCol.CalcPrtColWidth( n, nPageSize ) ); - if( ++n != nCols ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_COLSR; - rWrt.OutLong( rColumns[ n-1 ]->GetRight() + - rColumns[ n ]->GetLeft() ); - } - } - ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE; - } - return rWrt; -} - -static Writer& OutRTF_SvxFmtKeep( Writer& rWrt, const SfxPoolItem& rHt ) -{ - const SvxFmtKeepItem& rItem = (const SvxFmtKeepItem&)rHt; - if( rItem.GetValue() ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_KEEPN; - ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE; - } - return rWrt; -} - -static Writer& OutRTF_SvxFrmDir( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = ((SwRTFWriter&)rWrt); - if (rRTFWrt.pFlyFmt || rRTFWrt.bOutPageDesc) - OutSvxFrmDir(rRTFWrt, rHt); - return rWrt; -} - -/* File GRFATR.HXX */ - -static Writer& OutRTF_SwMirrorGrf( Writer& rWrt, const SfxPoolItem& rHt ) -{ - const SwMirrorGrf & rMirror = (const SwMirrorGrf&)rHt; - if( RES_MIRROR_GRAPH_DONT == rMirror.GetValue() ) - return rWrt; - - ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_GRFMIRROR; - rWrt.OutULong( rMirror.GetValue() ); - return rWrt; -} - -static Writer& OutRTF_SwCropGrf( Writer& rWrt, const SfxPoolItem& rHt ) -{ - const SwCropGrf & rCrop = (const SwCropGrf&)rHt; - ByteString aStr; - if( rCrop.GetLeft() ) - ( aStr += OOO_STRING_SVTOOLS_RTF_PICCROPL ) += - ByteString::CreateFromInt32( (short)rCrop.GetLeft() ); - if( rCrop.GetRight() ) - ( aStr += OOO_STRING_SVTOOLS_RTF_PICCROPR ) += - ByteString::CreateFromInt32( (short)rCrop.GetRight() ); - if( rCrop.GetTop() ) - ( aStr += OOO_STRING_SVTOOLS_RTF_PICCROPT ) += - ByteString::CreateFromInt32( (short)rCrop.GetTop() ); - if( rCrop.GetBottom() ) - ( aStr += OOO_STRING_SVTOOLS_RTF_PICCROPB ) += - ByteString::CreateFromInt32( (short)rCrop.GetBottom() ); - if( aStr.Len() ) - { - ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE; - rWrt.Strm() << aStr.GetBuffer(); - } - return rWrt; -} - - - -/* File PARATR.HXX */ - -static Writer& OutRTF_SwLineSpacing( Writer& rWrt, const SfxPoolItem& rHt ) -{ - const SvxLineSpacingItem &rLs = (const SvxLineSpacingItem&)rHt; - - switch (rLs.GetLineSpaceRule()) - { - default: - break; - case SVX_LINE_SPACE_AUTO: - case SVX_LINE_SPACE_FIX: - case SVX_LINE_SPACE_MIN: - { - ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_SL; - sal_Char cMult = '0'; - switch (rLs.GetInterLineSpaceRule()) - { - case SVX_INTER_LINE_SPACE_FIX: - // unser Durchschuss gibt es aber nicht in WW - also wie - // kommt man an die MaxLineHeight heran? - rWrt.OutLong((short)rLs.GetInterLineSpace()); - break; - case SVX_INTER_LINE_SPACE_PROP: - rWrt.OutLong((240L * rLs.GetPropLineSpace()) / 100L); - cMult = '1'; - break; - default: - if (SVX_LINE_SPACE_FIX == rLs.GetLineSpaceRule()) - rWrt.Strm() << '-'; - rWrt.OutLong( rLs.GetLineHeight() ); - break; - } - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_SLMULT << cMult; - } - break; - } - return rWrt; -} - -static Writer& OutRTF_SwAdjust( Writer& rWrt, const SfxPoolItem& rHt ) -{ - const SvxAdjustItem & rAdjust = ((const SvxAdjustItem&)rHt); - ByteString aAttr( "\\q" ); - switch( rAdjust.GetAdjust() ) - { - case SVX_ADJUST_LEFT: aAttr += 'l'; break; - case SVX_ADJUST_RIGHT: aAttr += 'r'; break; - case SVX_ADJUST_BLOCKLINE: - case SVX_ADJUST_BLOCK: aAttr += 'j'; break; - case SVX_ADJUST_CENTER: aAttr += 'c'; break; - - default: - return rWrt; // kein gueltiges Attriut, also returnen - } - ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE; - rWrt.Strm() << aAttr.GetBuffer(); - return rWrt; -} - -static Writer& OutRTF_SvxFmtSplit( Writer& rWrt, const SfxPoolItem& rHt ) -{ - const SvxFmtSplitItem& rItem = (const SvxFmtSplitItem&)rHt; - if( !rItem.GetValue() ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_KEEP; - ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE; - } - return rWrt; -} - -static Writer& OutRTF_SwTabStop( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - const SvxTabStopItem & rTStops = (const SvxTabStopItem&)rHt; - long nOffset = ((SvxLRSpaceItem&)rRTFWrt.GetItem( RES_LR_SPACE )).GetTxtLeft(); - for( USHORT n = 0; n < rTStops.Count(); n++ ) - { - const SvxTabStop & rTS = rTStops[ n ]; - if( SVX_TAB_ADJUST_DEFAULT != rTS.GetAdjustment() ) - { - BOOL bOutDecimal = TRUE; - const char* pFill = 0; - switch( rTS.GetFill() ) - { - case cDfltFillChar: - break; - - case '.': pFill = OOO_STRING_SVTOOLS_RTF_TLDOT; break; - case '_': pFill = OOO_STRING_SVTOOLS_RTF_TLUL; break; - case '-': pFill = OOO_STRING_SVTOOLS_RTF_TLTH; break; - case '=': pFill = OOO_STRING_SVTOOLS_RTF_TLEQ; break; - default: - if( !rRTFWrt.bWriteHelpFmt ) - { - OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_TLSWG, FALSE ); - rWrt.OutULong( (((USHORT)rTS.GetFill()) << 8 ) + - rTS.GetDecimal() ) - << '}'; - bOutDecimal = FALSE; - } - } - if( pFill ) - rWrt.Strm() << pFill; - - if( !rRTFWrt.bWriteHelpFmt && bOutDecimal && - rTS.GetDecimal() != ((SvxTabStopItem&)*GetDfltAttr( - RES_PARATR_TABSTOP ))[ 0 ].GetDecimal() ) - { - OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_TLSWG, FALSE ); - rWrt.OutULong( (((USHORT)rTS.GetFill()) << 8 ) + - rTS.GetDecimal() ) << '}'; - } - - const sal_Char* pAdjStr = 0; - switch (rTS.GetAdjustment()) - { - case SVX_TAB_ADJUST_RIGHT: - pAdjStr = OOO_STRING_SVTOOLS_RTF_TQR; - break; - case SVX_TAB_ADJUST_DECIMAL: - pAdjStr = OOO_STRING_SVTOOLS_RTF_TQDEC; - break; - case SVX_TAB_ADJUST_CENTER: - pAdjStr = OOO_STRING_SVTOOLS_RTF_TQC; - break; - default: - break; - } - if (pAdjStr) - rWrt.Strm() << pAdjStr; - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TX; - rWrt.OutLong(rTS.GetTabPos() + nOffset); - } - } - rRTFWrt.bOutFmtAttr = TRUE; - return rWrt; -} - -static Writer& OutRTF_SwHypenZone( Writer& rWrt, const SfxPoolItem& rHt ) -{ - if( !((SwRTFWriter&)rWrt).bWriteHelpFmt ) - { - const SvxHyphenZoneItem& rAttr = (const SvxHyphenZoneItem&)rHt; - USHORT nFlags = rAttr.IsHyphen() ? 1 : 0; - if( rAttr.IsPageEnd() ) nFlags += 2; - - OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_HYPHEN, FALSE ); - rWrt.OutULong( nFlags ) << OOO_STRING_SVTOOLS_RTF_HYPHLEAD; - rWrt.OutULong( rAttr.GetMinLead() ) << OOO_STRING_SVTOOLS_RTF_HYPHTRAIL; - rWrt.OutULong( rAttr.GetMinTrail() ) << OOO_STRING_SVTOOLS_RTF_HYPHMAX; - rWrt.OutULong( rAttr.GetMaxHyphens() ) << '}'; - } - return rWrt; -} - -static Writer& OutRTF_SwNumRule( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - if( !rRTFWrt.bOutListNumTxt ) - { - const SwNumRuleItem& rAttr = (const SwNumRuleItem&)rHt; - USHORT nId; - if( rAttr.GetValue().Len() && - USHRT_MAX != (nId = rRTFWrt.GetId( rAttr ) )) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LS; - rWrt.OutULong( nId ); - rRTFWrt.bOutFmtAttr = TRUE; - } - } - return rWrt; -} - -static Writer& OutRTF_SwScriptSpace( Writer& rWrt, const SfxPoolItem& rHt ) -{ - if( ((const SvxScriptSpaceItem&)rHt).GetValue() ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_ASPALPHA; - ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE; - } - return rWrt; -} -static Writer& OutRTF_SwHangPunctuation( Writer& rWrt, const SfxPoolItem& rHt ) -{ - if( !((const SvxHangingPunctuationItem&)rHt).GetValue() ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_NOOVERFLOW; - ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE; - } - return rWrt; -} -static Writer& OutRTF_SwForbiddenRule( Writer& rWrt, const SfxPoolItem& rHt ) -{ - if( !((const SvxForbiddenRuleItem&)rHt).GetValue() ) - { - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_NOCWRAP; - ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE; - } - return rWrt; -} - -static Writer& OutRTF_SwFontAlign( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt; - const SvxParaVertAlignItem & rAttr = (const SvxParaVertAlignItem &)rHt; - const char* pStr; - switch ( rAttr.GetValue() ) - { - case SvxParaVertAlignItem::TOP: pStr = OOO_STRING_SVTOOLS_RTF_FAHANG; break; - case SvxParaVertAlignItem::BOTTOM: pStr = OOO_STRING_SVTOOLS_RTF_FAVAR; break; - case SvxParaVertAlignItem::CENTER: pStr = OOO_STRING_SVTOOLS_RTF_FACENTER; break; - case SvxParaVertAlignItem::BASELINE: pStr = OOO_STRING_SVTOOLS_RTF_FAROMAN; break; - -// case SvxParaVertAlignItem::AUTOMATIC: - default: pStr = OOO_STRING_SVTOOLS_RTF_FAAUTO; break; - } - rWrt.Strm() << pStr; - rRTFWrt.bOutFmtAttr = TRUE; - return rWrt; -} - -/* - * lege hier die Tabellen fuer die RTF-Funktions-Pointer auf - * die Ausgabe-Funktionen an. - * Es sind lokale Strukturen, die nur innerhalb der RTF-DLL - * bekannt sein muessen. - */ - -SwAttrFnTab aRTFAttrFnTab = { -/* RES_CHRATR_CASEMAP */ OutRTF_SwCaseMap, -/* RES_CHRATR_CHARSETCOLOR */ 0, -/* RES_CHRATR_COLOR */ OutRTF_SwColor, -/* RES_CHRATR_CONTOUR */ OutRTF_SwContour, -/* RES_CHRATR_CROSSEDOUT */ OutRTF_SwCrossedOut, -/* RES_CHRATR_ESCAPEMENT */ OutRTF_SwEscapement, -/* RES_CHRATR_FONT */ OutRTF_SwFont, -/* RES_CHRATR_FONTSIZE */ OutRTF_SwSize, -/* RES_CHRATR_KERNING */ 0, // NOT USED!! OutRTF_SwKerning, -/* RES_CHRATR_LANGUAGE */ OutRTF_SwLanguage, -/* RES_CHRATR_POSTURE */ OutRTF_SwPosture, -/* RES_CHRATR_PROPORTIONALFONTSIZE*/0, -/* RES_CHRATR_SHADOWED */ OutRTF_SwShadowed, -/* RES_CHRATR_UNDERLINE */ OutRTF_SwUnderline, -/* RES_CHRATR_WEIGHT */ OutRTF_SwWeight, -/* RES_CHRATR_WORDLINEMODE */ 0, // Neu: Wortweises Unter-/Durchstreichen -/* RES_CHRATR_AUTOKERN */ 0, // Neu: Automatisches Pairkerning -/* RES_CHRATR_BLINK */ 0, // Neu: Blinkender Text -/* RES_CHRATR_NOHYPHEN */ 0, // Neu: nicht trennen -/* RES_CHRATR_NOLINEBREAK */ 0, // Neu: nicht umbrechen -/* RES_CHRATR_BACKGROUND */ OutRTF_SwChrBckgrnd, // Neu: Zeichenhintergrund -/* RES_CHRATR_CJK_FONT */ OutRTF_SwFont, -/* RES_CHRATR_CJK_FONTSIZE */ OutRTF_SwSize, -/* RES_CHRATR_CJK_LANGUAGE */ OutRTF_SwLanguage, -/* RES_CHRATR_CJK_POSTURE */ OutRTF_SwPosture, -/* RES_CHRATR_CJK_WEIGHT */ OutRTF_SwWeight, -/* RES_CHRATR_CTL_FONT */ OutRTF_SwFont, -/* RES_CHRATR_CTL_FONTSIZE */ OutRTF_SwSize, -/* RES_CHRATR_CTL_LANGUAGE */ OutRTF_SwLanguage, -/* RES_CHRATR_CTL_POSTURE */ OutRTF_SwPosture, -/* RES_CHRATR_CTL_WEIGHT */ OutRTF_SwWeight, -/* RES_CHRATR_ROTATE */ OutRTF_SwCharRotate, -/* RES_CHRATR_EMPHASIS_MARK */ OutRTF_SwEmphasisMark, -/* RES_CHRATR_TWO_LINES */ OutRTF_SwTwoInOne, -/* RES_CHRATR_SCALEW */ OutRTF_SwCharScaleW, -/* RES_CHRATR_RELIEF */ OutRTF_SwCharRelief, -/* RES_CHRATR_HIDDEN */ OutRTF_SvxCharHiddenItem, -/* RES_CHRATR_OVERLINE */ OutRTF_SwOverline, -/* RES_CHRATR_DUMMY1 */ 0, -/* RES_CHRATR_DUMMY2 */ 0, - -/* RES_TXTATR_REFMARK */ 0, // NOT USED!! OutRTF_SwRefMark, -/* RES_TXTATR_TOXMARK */ 0, // NOT USED!! OutRTF_SwTOXMark, -/* RES_TXTATR_META */ 0, -/* RES_TXTATR_METAFIELD */ 0, -/* RES_TXTATR_AUTOFMT */ OutRTF_SwTxtAutoFmt, -/* RES_TXTATR_INETFMT */ OutRTF_SwTxtINetFmt, -/* RES_TXTATR_CHARFMT */ OutRTF_SwTxtCharFmt, -/* RES_TXTATR_CJK_RUBY */ OutRTF_SwTxtRuby, -/* RES_TXTATR_UNKNOWN_CONTAINER */ 0, -/* RES_TXTATR_DUMMY5 */ 0, - -/* RES_TXTATR_FIELD */ OutRTF_SwField, -/* RES_TXTATR_FLYCNT */ OutRTF_SwFlyCntnt, -/* RES_TXTATR_FTN */ OutRTF_SwFtn, -/* RES_TXTATR_DUMMY4 */ 0, -/* RES_TXTATR_DUMMY3 */ 0, -/* RES_TXTATR_DUMMY1 */ 0, // Dummy: -/* RES_TXTATR_DUMMY2 */ 0, // Dummy: - -/* RES_PARATR_LINESPACING */ OutRTF_SwLineSpacing, -/* RES_PARATR_ADJUST */ OutRTF_SwAdjust, -/* RES_PARATR_SPLIT */ OutRTF_SvxFmtSplit, -/* RES_PARATR_WIDOWS */ 0, // NOT USED!! OutRTF_SwWidows, -/* RES_PARATR_ORPHANS */ 0, // NOT USED!! OutRTF_SwOrphans, -/* RES_PARATR_TABSTOP */ OutRTF_SwTabStop, -/* RES_PARATR_HYPHENZONE*/ OutRTF_SwHypenZone, -/* RES_PARATR_DROP */ 0, -/* RES_PARATR_REGISTER */ 0, // neu: Registerhaltigkeit -/* RES_PARATR_NUMRULE */ OutRTF_SwNumRule, -/* RES_PARATR_SCRIPTSPACE */ OutRTF_SwScriptSpace, -/* RES_PARATR_HANGINGPUNCTUATION */ OutRTF_SwHangPunctuation, -/* RES_PARATR_FORBIDDEN_RULE*/ OutRTF_SwForbiddenRule, -/* RES_PARATR_VERTALIGN */ OutRTF_SwFontAlign, -/* RES_PARATR_SNAPTOGRID*/ 0, // new -/* RES_PARATR_CONNECT_TO_BORDER */ 0, // new -/* RES_PARATR_OUTLINELEVEL */ 0, // new - outlinelevel - -/* RES_PARATR_LIST_ID */ 0, // new -/* RES_PARATR_LIST_LEVEL */ 0, // new -/* RES_PARATR_LIST_ISRESTART */ 0, // new -/* RES_PARATR_LIST_RESTARTVALUE */ 0, // new -/* RES_PARATR_LIST_ISCOUNTED */ 0, // new - -/* RES_FILL_ORDER */ 0, // NOT USED!! OutRTF_SwFillOrder, -/* RES_FRM_SIZE */ OutRTF_SwFrmSize, -/* RES_PAPER_BIN */ 0, // NOT USED!! OutRTF_SwFmtPaperBin, -/* RES_LR_SPACE */ OutRTF_SwFmtLRSpace, -/* RES_UL_SPACE */ OutRTF_SwFmtULSpace, -/* RES_PAGEDESC */ 0, -/* RES_BREAK */ 0, -/* RES_CNTNT */ 0, -/* RES_HEADER */ OutRTF_SwFmtHeader, -/* RES_FOOTER */ OutRTF_SwFmtFooter, -/* RES_PRINT */ OutRTF_SwFmtPrint, -/* RES_OPAQUE */ OutRTF_SwFmtOpaque, -/* RES_PROTECT */ OutRTF_SwFmtProtect, -/* RES_SURROUND */ OutRTF_SwFmtSurround, -/* RES_VERT_ORIENT */ OutRTF_SwFmtVertOrient, -/* RES_HORI_ORIENT */ OutRTF_SwFmtHoriOrient, -/* RES_ANCHOR */ OutRTF_SwFmtAnchor, -/* RES_BACKGROUND */ OutRTF_SwFmtBackground, -/* RES_BOX */ OutRTF_SwFmtBox, -/* RES_SHADOW */ OutRTF_SwFmtShadow, -/* RES_FRMMACRO */ 0, // NOT USED!! OutRTF_SwFmtFrmMacro, -/* RES_COL */ OutRTF_SwFmtCol, -/* RES_KEEP */ OutRTF_SvxFmtKeep, -/* RES_URL */ 0, // URL -/* RES_EDIT_IN_READONLY */ 0, -/* RES_LAYOUT_SPLIT */ 0, -/* RES_FRMATR_DUMMY1 */ 0, // Dummy: -/* RES_FRMATR_DUMMY2 */ 0, // Dummy: -/* RES_AUTO_STYLE */ 0, // Dummy: -/* RES_FRMATR_DUMMY4 */ 0, // Dummy: -/* RES_FRMATR_DUMMY5 */ 0, // Dummy: -/* RES_FRMATR_DUMMY6 */ 0, // Dummy: -/* RES_FRAMEDIR*/ OutRTF_SvxFrmDir, -/* RES_FRMATR_DUMMY8 */ 0, // Dummy: -/* RES_FRMATR_DUMMY9 */ 0, // Dummy: -/* RES_FOLLOW_TEXT_FLOW */ 0, -/* RES_WRAP_INFLUENCE_ON_OBJPOS */ 0, -/* RES_FRMATR_DUMMY2 */ 0, // Dummy: -/* RES_AUTO_STYLE */ 0, // Dummy: -/* RES_FRMATR_DUMMY4 */ 0, // Dummy: -/* RES_FRMATR_DUMMY5 */ 0, // Dummy: - -/* RES_GRFATR_MIRRORGRF */ OutRTF_SwMirrorGrf, -/* RES_GRFATR_CROPGRF */ OutRTF_SwCropGrf, -/* RES_GRFATR_ROTATION */ 0, -/* RES_GRFATR_LUMINANCE */ 0, -/* RES_GRFATR_CONTRAST */ 0, -/* RES_GRFATR_CHANNELR */ 0, -/* RES_GRFATR_CHANNELG */ 0, -/* RES_GRFATR_CHANNELB */ 0, -/* RES_GRFATR_GAMMA */ 0, -/* RES_GRFATR_INVERT */ 0, -/* RES_GRFATR_TRANSPARENCY */ 0, -/* RES_GRFATR_DRWAMODE */ 0, -/* RES_GRFATR_DUMMY1 */ 0, -/* RES_GRFATR_DUMMY2 */ 0, -/* RES_GRFATR_DUMMY3 */ 0, -/* RES_GRFATR_DUMMY4 */ 0, -/* RES_GRFATR_DUMMY5 */ 0, - -/* RES_BOXATR_FORMAT */ 0, -/* RES_BOXATR_FORMULA */ 0, -/* RES_BOXATR_VALUE */ 0, - -/* RES_UNKNOWNATR_CONTAINER */ 0 -}; - -SwNodeFnTab aRTFNodeFnTab = { -/* RES_TXTNODE */ OutRTF_SwTxtNode, -/* RES_GRFNODE */ OutRTF_SwGrfNode, -/* RES_OLENODE */ OutRTF_SwOLENode -}; - -/* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/rtf/rtffly.cxx b/sw/source/filter/rtf/rtffly.cxx index 260762fbf2..d1d8efcac0 100644 --- a/sw/source/filter/rtf/rtffly.cxx +++ b/sw/source/filter/rtf/rtffly.cxx @@ -61,6 +61,7 @@ #include <txtflcnt.hxx> #include <fmtflcnt.hxx> #include <fltini.hxx> +#include <unoframe.hxx> #include <deque> #include <map> #include <utility> @@ -1293,7 +1294,7 @@ void SwRTFParser::InsPicture( const String& rGrfNm, const Graphic* pGrf, aFlySet.Put(aSurroundItem); } - SwFrmFmt* pFlyFmt = pDoc->Insert( *pPam, + SwFlyFrmFmt* pFlyFmt = pDoc->Insert( *pPam, rGrfNm, aEmptyStr, // Name der Graphic !! pGrf, &aFlySet, // Attribute fuer den FlyFrm @@ -1305,6 +1306,26 @@ void SwRTFParser::InsPicture( const String& rGrfNm, const Graphic* pGrf, _SetPictureSize( *pGrfNd, pPos->nNode, (SfxItemSet&)pFlyFmt->GetAttrSet(), pPicType ); + if( pPicType ) + { + PictPropertyNameValuePairs::const_iterator aIt = pPicType->aPropertyPairs.begin(); + PictPropertyNameValuePairs::const_iterator aEnd = pPicType->aPropertyPairs.end(); + while( aIt != aEnd) + { + if( aIt->first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( "wzDescription") )) + { + SwXFrame::GetOrCreateSdrObject( pFlyFmt ); + pDoc->SetFlyFrmDescription( *(pFlyFmt), aIt->second ); + } + else if( aIt->first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( "wzName") )) + { + SwXFrame::GetOrCreateSdrObject( pFlyFmt ); + pDoc->SetFlyFrmTitle( *(pFlyFmt), aIt->second ); + } + ++aIt; + } + } + } if( pGrfAttrSet ) diff --git a/sw/source/filter/rtf/rtfnum.cxx b/sw/source/filter/rtf/rtfnum.cxx index e4702387fa..5da220f0db 100644 --- a/sw/source/filter/rtf/rtfnum.cxx +++ b/sw/source/filter/rtf/rtfnum.cxx @@ -47,7 +47,6 @@ #include <fltini.hxx> #include <swtypes.hxx> #include <swparrtf.hxx> -#include <wrtrtf.hxx> #include <ndtxt.hxx> #include <doc.hxx> #include <docary.hxx> @@ -62,9 +61,6 @@ #define RTF_NUMRULE_NAME "RTF_Num" -SV_IMPL_VARARR( SwListArr, SwListEntry ) - - void lcl_ExpandNumFmts( SwNumRule& rRule ) { // dann noch das NumFormat in alle Ebenen setzen @@ -343,7 +339,7 @@ void SwRTFParser::ReadListTable() if( 1 == nNumOpenBrakets ) { if( aEntry.nListId ) - aListArr.Insert( aEntry, aListArr.Count() ); + aListArr.push_back( aEntry ); aEntry.Clear(); } } @@ -510,7 +506,7 @@ void SwRTFParser::ReadListOverrideTable() if( aEntry.nListId && aEntry.nListNo ) { int nMatch=-1; - for( USHORT n = aListArr.Count(); n; ) + for( size_t n = aListArr.size(); n; ) { if( aListArr[ --n ].nListId == aEntry.nListId) { @@ -529,7 +525,7 @@ void SwRTFParser::ReadListOverrideTable() { aEntry.nListDocPos=aListArr[nMatch2].nListDocPos; aEntry.nListTemplateId=aListArr[nMatch2].nListTemplateId; - aListArr.Insert(aEntry, aListArr.Count()); + aListArr.push_back( aEntry ); } if(pOrigRule) aListArr[nMatch2].nListDocPos = aEntry.nListDocPos; @@ -573,7 +569,7 @@ void SwRTFParser::ReadListOverrideTable() // dann erzeugen wir mal schnell eine Kopie von der NumRule, // denn diese wird jetzt mal kurz veraendert. if( aEntry.nListId ) - for( USHORT n = 0; n < aListArr.Count(); ++n ) + for( size_t n = 0; n < aListArr.size(); ++n ) if( aListArr[ n ].nListId == aEntry.nListId ) { pRule = pDoc->GetNumRuleTbl()[ @@ -590,7 +586,7 @@ void SwRTFParser::ReadListOverrideTable() // <-- pRule->SetAutoRule( FALSE ); nNumLvl = (BYTE)-1; - aListArr.Insert( aEntry, aListArr.Count() ); + aListArr.push_back( aEntry ); break; } @@ -671,11 +667,11 @@ void SwRTFParser::ReadListOverrideTable() // now decrement all position in the listtable, which will // behind the doc-rule position - for( USHORT n = aListArr.Count(); n; ) + for( size_t n = aListArr.size(); n; ) { SwListEntry& rEntry = aListArr[ --n ]; if( rEntry.nListDocPos == nRulePos ) - aListArr.Remove( n ); + aListArr.erase( aListArr.begin()+n ); else if( rEntry.nListDocPos > nRulePos ) --rEntry.nListDocPos; } @@ -699,11 +695,11 @@ SwNumRule* SwRTFParser::GetNumRuleOfListNo( long nListNo, BOOL bRemoveFromList ) { SwNumRule* pRet = 0; SwListEntry* pEntry; - for( USHORT n = aListArr.Count(); n; ) + for( size_t n = aListArr.size(); n; ) if( ( pEntry = &aListArr[ --n ])->nListNo == nListNo ) { if( bRemoveFromList ) - aListArr.Remove( n ); + aListArr.erase( aListArr.begin()+n ); else { pEntry->bRuleUsed = TRUE; @@ -743,14 +739,14 @@ void SwRTFParser::RemoveUnusedNumRules() { SwListEntry* pEntry; SvPtrarr aDelArr; - USHORT n; - for( n = aListArr.Count(); n; ) + size_t n; + for( n = aListArr.size(); n; ) { if( !( pEntry = &aListArr[ --n ])->bRuleUsed ) { // really *NOT* used by anyone else? BOOL unused=TRUE; - for(USHORT j = 0; j < aListArr.Count(); ++j) + for(size_t j = 0; j < aListArr.size(); ++j) { if (aListArr[n].nListNo==aListArr[j].nListNo) unused&=!aListArr[j].bRuleUsed; @@ -847,7 +843,7 @@ SwNumRule *SwRTFParser::ReadNumSecLevel( int nToken ) RTL_CONSTASCII_STRINGPARAM( RTF_NUMRULE_NAME " 1" ))); SwListEntry aEntry( nListNo, 0, pDoc->MakeNumRule( sTmp )); aEntry.nListNo = nListNo; - aListArr.Insert( aEntry, aListArr.Count() ); + aListArr.push_back( aEntry ); pCurRule = pDoc->GetNumRuleTbl()[ aEntry.nListDocPos ]; // --> OD 2008-07-08 #i91400# pCurRule->SetName( pDoc->GetUniqueNumRuleName( &sTmp, FALSE ), *pDoc ); @@ -1129,332 +1125,3 @@ BOOL lcl_IsExportNumRule( const SwNumRule& rRule, BYTE* pEnd = 0 ) *pEnd = nEnd; return nLvl != nEnd; } - -void SwRTFWriter::OutRTFListTab() -{ - ByteString sOverrideList; - USHORT nId = 1, nTmplId = 1, n; - - // prepare the NodeNum to generate the NumString - SwNumberTree::tNumberVector aNumVector; - for( n = 0; n < MAXLEVEL; ++n ) - aNumVector.push_back(n); - BYTE aNumLvlPos[ MAXLEVEL ]; - - if( !pNumRuleTbl ) - BuildNumRuleTbl(); - - for( n = 0; n < pNumRuleTbl->Count(); ++n ) - { - const SwNumRule* pRule = (*pNumRuleTbl)[ n ]; - - // mit der ersten Rule wird auch die ListTable geschrieben - if( !sOverrideList.Len() ) - OutComment( *this, OOO_STRING_SVTOOLS_RTF_LISTTABLE ); - - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LIST << OOO_STRING_SVTOOLS_RTF_LISTTEMPLATEID; - OutULong( nTmplId ); - ByteString sTmp; - - if( pRule->IsContinusNum() ) - Strm() << OOO_STRING_SVTOOLS_RTF_LISTSIMPLE; - - BYTE nLvl, nEnd; - lcl_IsExportNumRule( *pRule, &nEnd ); - - for( nLvl = 0; nLvl < nEnd; ++nLvl ) - { - const SwNumFmt& rFmt = pRule->Get( nLvl ); - Strm() << sNewLine; - if( nLvl > 8 ) // RTF-kennt nur 9 Ebenen - OutComment( *this, OOO_STRING_SVTOOLS_RTF_SOUTLVL ); - - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTLEVEL << OOO_STRING_SVTOOLS_RTF_LEVELNFC; - - USHORT nVal = 0; - switch( rFmt.GetNumberingType() ) - { - case SVX_NUM_ROMAN_UPPER: nVal = 1; break; - case SVX_NUM_ROMAN_LOWER: nVal = 2; break; - case SVX_NUM_CHARS_UPPER_LETTER: - case SVX_NUM_CHARS_UPPER_LETTER_N: nVal = 3; break; - case SVX_NUM_CHARS_LOWER_LETTER: - case SVX_NUM_CHARS_LOWER_LETTER_N: nVal = 4; break; - - case SVX_NUM_BITMAP: - case SVX_NUM_CHAR_SPECIAL: nVal = 23; break; - } - OutLong( nVal ) << OOO_STRING_SVTOOLS_RTF_LEVELJC; - - switch( rFmt.GetNumAdjust() ) - { - case SVX_ADJUST_CENTER: nVal = 1; break; - case SVX_ADJUST_RIGHT: nVal = 2; break; - default: nVal = 0; break; - } - OutLong( nVal ) << OOO_STRING_SVTOOLS_RTF_LEVELSTARTAT; - OutLong( rFmt.GetStart() ) - << OOO_STRING_SVTOOLS_RTF_LEVELFOLLOW << "0{" << OOO_STRING_SVTOOLS_RTF_LEVELTEXT << ' '; - - BOOL bWriteBulletFont = FALSE; - memset( aNumLvlPos, 0, MAXLEVEL ); - if( SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType() || - SVX_NUM_BITMAP == rFmt.GetNumberingType() ) - { - Strm() << "\\'01"; - ByteString sNo( ByteString::CreateFromInt32( rFmt.GetBulletChar())); - Strm() << "\\u" << sNo.GetBuffer() << " ?"; - bWriteBulletFont = TRUE; - } - else if( SVX_NUM_NUMBER_NONE == rFmt.GetNumberingType() ) - { - String sOut( rFmt.GetPrefix() ); sOut += rFmt.GetSuffix(); - if( sOut.Len() ) - { - Strm() << "\\'"; - OutHex( sOut.Len() ); - RTFOutFuncs::Out_String( Strm(), sOut, - eDefaultEncoding, bWriteHelpFmt ); - } - } - else - { - memset( aNumLvlPos, 0, MAXLEVEL ); - BYTE* pLvlPos = aNumLvlPos; - // --> OD 2005-11-18 #128056# - // correction of refactoring done by cws swnumtree: - // - the numbering string has to be restrict to the level - // currently working on. - String sNumStr( pRule->MakeNumString( aNumVector, FALSE, TRUE, nLvl )); - // <-- - - // now search the nums in the string - for( BYTE i = 0; i <= nLvl; ++i ) - { - String sSrch( String::CreateFromInt32( i )); - xub_StrLen nFnd = sNumStr.Search( sSrch ); - if( STRING_NOTFOUND != nFnd ) - { - *pLvlPos = (BYTE)(nFnd + rFmt.GetPrefix().Len() + 1 ); - ++pLvlPos; - sNumStr.SetChar( nFnd, (sal_Unicode)i ); - } - } - - Strm() << "\\'"; - OutHex( sNumStr.Len() + rFmt.GetPrefix().Len() + - rFmt.GetSuffix().Len() ); - - if( rFmt.GetPrefix().Len() ) - RTFOutFuncs::Out_String( Strm(), rFmt.GetPrefix(), - eDefaultEncoding, bWriteHelpFmt ); - - - for( xub_StrLen x = 0; x < sNumStr.Len(); ++x ) - if( sNumStr.GetChar( x ) < 0x20 || - sNumStr.GetChar( x ) > 0xFF ) - { - Strm() << "\\'"; OutHex( sNumStr.GetChar( x ) ); - } - else - Strm() << (sal_Char)sNumStr.GetChar( x ); - - if( rFmt.GetSuffix().Len() ) - RTFOutFuncs::Out_String( Strm(), rFmt.GetSuffix(), - eDefaultEncoding, bWriteHelpFmt ); - } - - // write the levelnumbers - Strm() << ";}{" << OOO_STRING_SVTOOLS_RTF_LEVELNUMBERS; - for( BYTE i = 0; i <= nLvl && aNumLvlPos[ i ]; ++i ) - { - Strm() << "\\'"; OutHex( aNumLvlPos[ i ] ); - } - Strm() << ";}"; - - if( rFmt.GetCharFmt() ) - Out_SfxItemSet( aRTFAttrFnTab, *this, - rFmt.GetCharFmt()->GetAttrSet(), TRUE ); - - if( bWriteBulletFont ) - { - Strm() << OOO_STRING_SVTOOLS_RTF_F; - const Font* pFont = rFmt.GetBulletFont(); - if( !pFont ) - // --> OD 2006-06-27 #b6440955# - pFont = &numfunc::GetDefBulletFont(); - // <-- - OutULong( GetId( *pFont )); - } - - Strm() << OOO_STRING_SVTOOLS_RTF_FI; - OutLong( rFmt.GetFirstLineOffset() ) << OOO_STRING_SVTOOLS_RTF_LI; - OutLong( rFmt.GetAbsLSpace() ); - - Strm() << '}'; - - if( nLvl > 8 ) // RTF-kennt nur 9 Ebenen - Strm() << '}'; - } - - if( !pRule->IsAutoRule() ) - { - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTNAME << ' '; - RTFOutFuncs::Out_String( Strm(), pRule->GetName(), eDefaultEncoding, - bWriteHelpFmt ) << ";}" ; - } - Strm() << OOO_STRING_SVTOOLS_RTF_LISTID; - OutULong( nId ) << '}' << sNewLine; - - sTmp = '{'; - ((((((( sTmp += OOO_STRING_SVTOOLS_RTF_LISTOVERRIDE ) += - OOO_STRING_SVTOOLS_RTF_LISTID ) += ByteString::CreateFromInt32( nId )) += - OOO_STRING_SVTOOLS_RTF_LISTOVERRIDECOUNT ) += '0' ) += - OOO_STRING_SVTOOLS_RTF_LS ) += ByteString::CreateFromInt32( n )) += '}'; - sOverrideList += sTmp; - - ++nId, ++nTmplId; - } - - if( sOverrideList.Len() ) - Strm() << "}{" << OOO_STRING_SVTOOLS_RTF_LISTOVERRIDETABLE - << sOverrideList.GetBuffer() << '}' << sNewLine; -} - -USHORT SwRTFWriter::GetId( const SwNumRuleItem& rItem ) const -{ - USHORT n, nId = USHRT_MAX; - if( !pNumRuleTbl ) - { - SwRTFWriter* pThis = (SwRTFWriter*)this; - pThis->BuildNumRuleTbl(); - } - const String& rNm = rItem.GetValue(); - for( n = pNumRuleTbl->Count(); n; ) - if( (*pNumRuleTbl)[ --n ]->GetName() == rNm ) - { - nId = n; - break; - } - - return nId; -} - -USHORT SwRTFWriter::GetNumRuleId( const SwNumRule& rRule ) -{ - if( !pNumRuleTbl ) - BuildNumRuleTbl(); - SwNumRulePtr pR = (SwNumRulePtr)&rRule; - return pNumRuleTbl->GetPos( pR ); -} - -void SwRTFWriter::BuildNumRuleTbl() -{ - const SwNumRuleTbl& rListTbl = pDoc->GetNumRuleTbl(); - if( !pNumRuleTbl ) - pNumRuleTbl = new SwNumRuleTbl( (BYTE)rListTbl.Count() ); - for( USHORT n = rListTbl.Count()+1; n; ) - { - SwNumRule* pRule; - --n; - if( n == rListTbl.Count() ) - pRule = (SwNumRule*)pDoc->GetOutlineNumRule(); - else - { - pRule = rListTbl[ n ]; - if( !pDoc->IsUsed( *pRule )) - continue; - } - - if( lcl_IsExportNumRule( *pRule )) - pNumRuleTbl->Insert( pRule, pNumRuleTbl->Count() ); - } -} - -BOOL SwRTFWriter::OutListNum( const SwTxtNode& rNd ) -{ - BOOL bRet = FALSE; - const SwNumRule* pRule = rNd.GetNumRule(); - - // --> OD 2008-03-18 #refactorlists# -// if( pRule && MAXLEVEL > rNd.GetActualListLevel() ) - if( pRule && rNd.IsInList() ) - // <-- - { - // --> OD 2008-03-18 #refactorlists# - ASSERT( rNd.GetActualListLevel() >= 0 && rNd.GetActualListLevel() < MAXLEVEL, - "<SwRTFWriter::OutListNum(..)> - text node does not have valid list level. Serious defect -> please inform OD" ); - // <-- - - bOutFmtAttr = FALSE; - bOutListNumTxt = TRUE; - bRet = TRUE; - - const bool bExportNumRule = USHRT_MAX != GetNumRuleId( *pRule ); - const BYTE nLvl = static_cast< BYTE >(rNd.GetActualListLevel()); - const SwNumFmt* pFmt = pRule->GetNumFmt( nLvl ); - if( !pFmt ) - pFmt = &pRule->Get( nLvl ); - - const SfxItemSet& rNdSet = rNd.GetSwAttrSet(); - - SfxItemSet aSet( *rNdSet.GetPool(), rNdSet.GetRanges() ); - aSet.SetParent( &rNdSet ); - SvxLRSpaceItem aLR( (SvxLRSpaceItem&)rNdSet.Get( RES_LR_SPACE ) ); - aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetAbsLSpace() ); - - aLR.SetTxtFirstLineOfst( pFmt->GetFirstLineOffset() ); - if ( bExportNumRule ) - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTTEXT << OOO_STRING_SVTOOLS_RTF_PARD << OOO_STRING_SVTOOLS_RTF_PLAIN << ' '; - - aSet.Put( aLR ); - Out_SfxItemSet( aRTFAttrFnTab, *this, aSet, TRUE ); - - if( pFmt->GetCharFmt() ) - Out_SfxItemSet( aRTFAttrFnTab, *this, - pFmt->GetCharFmt()->GetAttrSet(), TRUE ); - - { - String sTxt; - if( SVX_NUM_CHAR_SPECIAL == pFmt->GetNumberingType() || SVX_NUM_BITMAP == pFmt->GetNumberingType() ) - sTxt = pFmt->GetBulletChar(); - else - sTxt = rNd.GetNumString(); - - if( bOutFmtAttr ) - { - Strm() << ' '; - bOutFmtAttr = FALSE; - } - - if (sTxt.Len()) - { - RTFOutFuncs::Out_String(Strm(), sTxt, eDefaultEncoding, - bWriteHelpFmt); - } - - if( bExportNumRule ) - { - if( OUTLINE_RULE != pRule->GetRuleType() ) - { - Strm() << OOO_STRING_SVTOOLS_RTF_TAB << '}' << OOO_STRING_SVTOOLS_RTF_ILVL; - if( nLvl > 8 ) // RTF-kennt nur 9 Ebenen - { - OutULong( 8 ); - OutComment( *this, OOO_STRING_SVTOOLS_RTF_SOUTLVL ); - OutULong( nLvl ) << '}'; - } - else - OutULong( nLvl ); - Strm() << ' '; - } - else - Strm() << OOO_STRING_SVTOOLS_RTF_TAB << '}'; - } - else if( sTxt.Len() ) - Strm() << OOO_STRING_SVTOOLS_RTF_TAB; - } - bOutListNumTxt = FALSE; - } - return bRet; -} diff --git a/sw/source/filter/rtf/rtftbl.cxx b/sw/source/filter/rtf/rtftbl.cxx index 67dcd3f797..aee78ae585 100644 --- a/sw/source/filter/rtf/rtftbl.cxx +++ b/sw/source/filter/rtf/rtftbl.cxx @@ -165,10 +165,7 @@ void SwRTFParser::ReadTable( int nToken ) enum Limits {eMAXCELLS=64000}; - SvBools aMergeBackup; - int nCount = aMergeBoxes.Count(); - for (USHORT i = 0; i < nCount; ++i) - aMergeBackup.Insert(aMergeBoxes[i], i); + SvBools aMergeBackup(aMergeBoxes); // kein TROWD aber ein TabellenToken -> zwischen TROWD und Tab.Token // waren andere Zeichen (siehe Bug 27445.rtf) @@ -177,10 +174,10 @@ void SwRTFParser::ReadTable( int nToken ) if( RTF_TROWD == nToken ) nToken = GetNextToken(); // RTF_TROWD ueberlesen - // Flags fuer die gemergten Boxen loeschen - aMergeBoxes.Remove( 0, aMergeBoxes.Count() ); - aMergeBoxes.Insert( (BOOL)FALSE, USHORT(0) ); - nAktBox = 0; + // Flag for delete merged boxes + aMergeBoxes.clear(); + aMergeBoxes.push_back( (BOOL)FALSE ); + m_nCurrentBox = 0; // wenn schon in einer Tabellen, dann splitte oder benutze // die bisherigen Boxen weiter @@ -194,11 +191,11 @@ void SwRTFParser::ReadTable( int nToken ) // very robust to avoid crashes like bug 127425 + crash reports 118743 if( pLine ) { - USHORT nTmpBox = nAktBox; + USHORT nTmpBox = m_nCurrentBox; if( nTmpBox > pLine->GetTabBoxes().Count() ) nTmpBox = pLine->GetTabBoxes().Count(); - for( USHORT n = nTmpBox; n; ) + for (USHORT n = nTmpBox; n; ) { const SwTableBox *pTmp = pLine->GetTabBoxes()[ --n ]; if( pTmp ) @@ -223,7 +220,7 @@ void SwRTFParser::ReadTable( int nToken ) sal_Int16 eVerOrient = text::VertOrientation::NONE; long nLineHeight = 0; - USHORT nBoxCnt = aMergeBoxes.Count()-1; + size_t nBoxCnt = aMergeBoxes.size()-1; SwBoxFrmFmts aBoxFmts; SwTableBoxFmt* pBoxFmt = pDoc->MakeTableBoxFmt(); SvxFrameDirection eDir = FRMDIR_HORI_LEFT_TOP; @@ -292,15 +289,16 @@ void SwRTFParser::ReadTable( int nToken ) // the first cell cannot be merged with earlier ones. if (nBoxCnt != 0) { - aMergeBoxes[ nBoxCnt ] = TRUE; + aMergeBoxes.back() = TRUE; } break; case RTF_CELLX: - if (!bTrowdRead) { + if (!bTrowdRead && (aMergeBoxes.size() < (SAL_MAX_UINT16 - 1))) + { SwTableBoxFmt* pFmt = pBoxFmt; SwTwips nSize = nTokenValue - nTblSz; - if( aMergeBoxes[ nBoxCnt ] ) + if( aMergeBoxes.back() ) { // neue Zellen lesen und noch keine Formate vorhanden, // dann benutze das der vorhergebende @@ -308,9 +306,12 @@ void SwRTFParser::ReadTable( int nToken ) { SwTableLines& rLns = pTableNode->GetTable().GetTabLines(); SwTableLine* pLine = rLns[ rLns.Count()-1 ]; - if(nAktBox!=0) - --nAktBox; - pFmt = (SwTableBoxFmt*)pLine->GetTabBoxes()[ nAktBox ]->GetFrmFmt(); + if (m_nCurrentBox != 0) + { + --m_nCurrentBox; + } + pFmt = static_cast<SwTableBoxFmt*>( + pLine->GetTabBoxes()[ m_nCurrentBox ]->GetFrmFmt()); } else pFmt = aBoxFmts[ aBoxFmts.Count()-1 ]; @@ -336,7 +337,8 @@ void SwRTFParser::ReadTable( int nToken ) nSize = COL_DFLT_WIDTH; pFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nSize, 0 )); nTblSz = nTokenValue; - aMergeBoxes.Insert( (BOOL)FALSE, ++nBoxCnt ); + aMergeBoxes.push_back( (BOOL)FALSE ); + ++nBoxCnt; SvxBoxItem aBox(pFmt->GetBox()); @@ -483,7 +485,7 @@ void SwRTFParser::ReadTable( int nToken ) default: if( ( nToken & ~(0xff | RTF_TABLEDEF)) == RTF_SHADINGDEF ) { - if( aMergeBoxes[ nBoxCnt ] ) + if( aMergeBoxes.back() ) break; ReadBackgroundAttr( nToken, (SfxItemSet&)pBoxFmt->GetAttrSet(), TRUE ); @@ -491,7 +493,7 @@ void SwRTFParser::ReadTable( int nToken ) else if( ( nToken & ~(0xff | RTF_TABLEDEF) ) == RTF_BRDRDEF || IsBorderToken(nToken)) { - if( aMergeBoxes[ nBoxCnt ] ) + if( aMergeBoxes.back() ) break; SfxItemSet& rSet = (SfxItemSet&)pBoxFmt->GetAttrSet(); @@ -512,7 +514,7 @@ void SwRTFParser::ReadTable( int nToken ) if( text::VertOrientation::NONE != eVerOrient ) { - if( !aMergeBoxes[ nBoxCnt ] ) + if( !aMergeBoxes.back() ) pBoxFmt->SetFmtAttr( SwFmtVertOrient( 0, eVerOrient )); eVerOrient = text::VertOrientation::NONE; } @@ -523,13 +525,11 @@ void SwRTFParser::ReadTable( int nToken ) // das letzte temp. BoxFmt loeschen delete pBoxFmt; - // es wurde keine einzige Box erkannt - if( nAktBox == nBoxCnt || ( bReadNewCell && !pTableNode )) + // It has been recognized as not single box + if ((m_nCurrentBox == nBoxCnt) || ( bReadNewCell && !pTableNode )) { - int nC = aMergeBackup.Count(); - for (USHORT i = 0; i < nC; ++i) - aMergeBoxes.Insert(aMergeBackup[i], i); - SkipToken( -1 ); // zum Letzen gueltigen zurueck + aMergeBoxes = aMergeBackup; + SkipToken( -1 ); // go back to the last valid return; } @@ -636,7 +636,9 @@ void SwRTFParser::ReadTable( int nToken ) aBoxFmts.Remove( 0, n ); if( aBoxFmts.Count() ) // es muessen noch neue zugefuegt werden - nAktBox = n; + { + m_nCurrentBox = n; + } else // es mussen noch Boxen geloescht werden { // remove ContentIndex of other Bound @@ -746,7 +748,7 @@ void SwRTFParser::ReadTable( int nToken ) ((SfxItemSet&)pFmt->GetAttrSet()).Put( aL ); } - nAktBox = 0; + m_nCurrentBox = 0; pOldTblNd = pTableNode; { @@ -798,12 +800,14 @@ void SwRTFParser::ReadTable( int nToken ) aBoxFmts[ nStt ], // Formate fuer den TextNode der Box pColl, 0, - nAktBox + nStt, 1 ); + m_nCurrentBox + nStt, 1 ); } } if( bChkExistTbl ) - nAktBox = 0; + { + m_nCurrentBox = 0; + } maInsertedTables.InsertTable(*pTableNode, *pPam); @@ -815,7 +819,8 @@ void SwRTFParser::ReadTable( int nToken ) if (pNewLine) { SwTableBoxes &rBoxes = pNewLine->GetTabBoxes(); - if (SwTableBox* pBox = (nAktBox < rBoxes.Count() ? rBoxes[nAktBox] : 0)) + if (SwTableBox* pBox = ((m_nCurrentBox < rBoxes.Count()) + ? rBoxes[m_nCurrentBox] : 0)) { if (const SwStartNode *pStart = pBox->GetSttNd()) { @@ -861,7 +866,7 @@ void SwRTFParser::ReadTable( int nToken ) //which were intended to be inside the tablerow are now left outside //the table after the row was placed before the current insertion point SvxRTFItemStack& rAttrStk = GetAttrStack(); - for (USHORT n = 0; n < rAttrStk.Count(); ++n) + for (size_t n = 0; n < rAttrStk.size(); ++n) { SvxRTFItemStackType* pStk = rAttrStk[n]; pStk->MoveFullNode(aOldPos, aNewPos); @@ -885,16 +890,19 @@ void SwRTFParser::GotoNextBox() SwTableBoxes& rBoxes = pLine->GetTabBoxes(); SwTableBox* pBox = rBoxes[ rBoxes.Count()-1 ]; - if( ++nAktBox >= aMergeBoxes.Count() ) - nAktBox = aMergeBoxes.Count()-1; + if (++m_nCurrentBox >= aMergeBoxes.size()) + { + OSL_ENSURE(aMergeBoxes.size() < SAL_MAX_UINT16, "too many boxes?"); + m_nCurrentBox = static_cast<USHORT>(aMergeBoxes.size()-1); + } - if( !aMergeBoxes[ nAktBox ] ) + if (!aMergeBoxes[ m_nCurrentBox ]) { int bMove = TRUE; if( pBox->GetSttIdx() > pPam->GetPoint()->nNode.GetIndex() ) { USHORT nRealBox = 0; - for( USHORT nTmp = 0; nTmp < nAktBox; ++nTmp ) + for (USHORT nTmp = 0; nTmp < m_nCurrentBox; ++nTmp) if( !aMergeBoxes[ nTmp ] ) ++nRealBox; @@ -906,7 +914,8 @@ void SwRTFParser::GotoNextBox() } } - if( bMove && nAktBox + 1 == aMergeBoxes.Count() ) + if (bMove && + (static_cast<size_t>(m_nCurrentBox + 1) == aMergeBoxes.size())) // dann hinter die Tabelle pPam->Move( fnMoveForward, fnGoNode ); } @@ -972,7 +981,7 @@ void SwRTFParser::NewTblLine() ULONG nOldPos = pPam->GetPoint()->nNode.GetIndex(); pPam->GetPoint()->nNode = *pBox->GetSttNd(); pPam->Move( fnMoveForward ); - nAktBox = 0; + m_nCurrentBox = 0; // alle Nodes in den Boxen auf die "default" Vorlage setzten { @@ -1002,11 +1011,10 @@ void SwRTFParser::NewTblLine() pPam->DeleteMark(); } - // alle Attribute, die schon auf den nachfolgen zeigen auf die neue - // Box umsetzen !! + // all attributes which will be displayed in new Box SvxRTFItemStack& rAttrStk = GetAttrStack(); const SvxRTFItemStackType* pStk; - for( USHORT n = 0; n < rAttrStk.Count(); ++n ) + for( size_t n = 0; n < rAttrStk.size(); ++n ) if( ( pStk = rAttrStk[ n ])->GetSttNodeIdx() == ULONG(nOldPos) && !pStk->GetSttCnt() ) ((SvxRTFItemStackType*)pStk)->SetStartPos( SwxPosition( pPam ) ); diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index e437f2450e..e1958adcd1 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -179,6 +179,12 @@ ULONG RtfReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPam, const S return nRet; } +ULONG RtfReader::Read(SvStream* pStream, SwDoc& rDoc, const String& rBaseURL, SwPaM& rPam) +{ + pStrm = pStream; + return Read(rDoc, rBaseURL, rPam, rBaseURL); +} + SwRTFParser::SwRTFParser(SwDoc* pD, uno::Reference<document::XDocumentProperties> i_xDocProps, const SwPaM& rCrsr, SvStream& rIn, const String& rBaseURL, @@ -188,7 +194,6 @@ SwRTFParser::SwRTFParser(SwDoc* pD, maCharStyleMapper(*pD), maSegments(*this), maInsertedTables(*pD), - aMergeBoxes(0, 5), aTblFmts(0, 10), mpBookmarkStart(0), mpRedlineStack(0), @@ -205,7 +210,7 @@ SwRTFParser::SwRTFParser(SwDoc* pD, sBaseURL( rBaseURL ), nAktPageDesc(0), nAktFirstPageDesc(0), - nAktBox(0), + m_nCurrentBox(0), nInsTblRow(USHRT_MAX), nNewNumSectDef(USHRT_MAX), nRowsToRepeat(0), @@ -1370,6 +1375,7 @@ void SwRTFParser::ReadShapeObject() String shpTxt; bool bshpTxt=false; int txflTextFlow=0; + ::rtl::OUString sDescription, sName; while (level>0 && IsParserWorking()) @@ -1427,7 +1433,14 @@ void SwRTFParser::ReadShapeObject() { txflTextFlow=aToken.ToInt32(); } - + else if (sn.EqualsAscii("wzDescription")) + { + sDescription = aToken; + } + else if(sn.EqualsAscii("wzName")) + { + sName = aToken; + } } break; case RTF_PICT: @@ -1453,6 +1466,7 @@ void SwRTFParser::ReadShapeObject() } SkipToken(-1); + SdrObject* pSdrObject = 0; switch(shapeType) { case 202: /* Text Box */ @@ -1472,6 +1486,7 @@ void SwRTFParser::ReadShapeObject() const Rectangle aRect(FRound(aRange.getMinX()), FRound(aRange.getMinY()), FRound(aRange.getMaxX()), FRound(aRange.getMaxY())); SdrRectObj* pStroke = new SdrRectObj(aRect); + pSdrObject = pStroke; pStroke->SetSnapRect(aRect); pDoc->GetOrCreateDrawModel(); // create model InsertShpObject(pStroke, this->nZOrder++); @@ -1519,6 +1534,7 @@ void SwRTFParser::ReadShapeObject() aLine.append(aPointRightBottom); SdrPathObj* pStroke = new SdrPathObj(OBJ_PLIN, ::basegfx::B2DPolyPolygon(aLine)); + pSdrObject = pStroke; //pStroke->SetSnapRect(aRect); InsertShpObject(pStroke, this->nZOrder++); @@ -1539,11 +1555,17 @@ void SwRTFParser::ReadShapeObject() const Rectangle aRect(FRound(aRange.getMinX()), FRound(aRange.getMinY()), FRound(aRange.getMaxX()), FRound(aRange.getMaxY())); SdrRectObj* pStroke = new SdrGrafObj(aGrf); + pSdrObject = pStroke; pStroke->SetSnapRect(aRect); InsertShpObject(pStroke, this->nZOrder++); } } + if( pSdrObject ) + { + pSdrObject->SetDescription(sDescription); + pSdrObject->SetTitle(sName); + } } extern void sw3io_ConvertFromOldField( SwDoc& rDoc, USHORT& rWhich, @@ -1606,14 +1628,29 @@ void SwRTFParser::NextToken( int nToken ) switch( nToken ) { case RTF_FOOTNOTE: + { //We can only insert a footnote if we're not inside a footnote. e.g. //#i7713# - if (!mbIsFootnote) + + // in insert mode it's also possible to be inside of a footnote! + bool bInsertIntoFootnote = false; + if( !IsNewDoc() ) + { + SwStartNode* pSttNode = pPam->GetNode()->StartOfSectionNode(); + while(pSttNode && pSttNode->IsSectionNode()) + { + pSttNode = pSttNode->StartOfSectionNode(); + } + if( SwFootnoteStartNode == pSttNode->GetStartNodeType() ) + bInsertIntoFootnote = true; + } + if (!mbIsFootnote && !bInsertIntoFootnote) { ReadHeaderFooter( nToken ); SkipToken( -1 ); // Klammer wieder zurueck } - break; + } + break; case RTF_SWG_PRTDATA: ReadPrtData(); break; @@ -1759,7 +1796,7 @@ void SwRTFParser::NextToken( int nToken ) if (!CantUseTables()) { // aus der Line raus - nAktBox = 0; + m_nCurrentBox = 0; pTableNode = 0; // noch in der Tabelle drin? SwNodeIndex& rIdx = pPam->GetPoint()->nNode; @@ -3548,14 +3585,13 @@ void SwRTFParser::ReadHeaderFooter( int nToken, SwPageDesc* pPageDesc ) { ASSERT( RTF_FOOTNOTE == nToken || RTF_FLY_INPARA == nToken || - pPageDesc, "PageDesc fehlt" ); + pPageDesc, "PageDesc is missing" ); bool bContainsParaCache = bContainsPara; - // alle wichtigen Sachen sichern + // backup all important data SwPosition aSavePos( *pPam->GetPoint() ); - SvxRTFItemStack aSaveStack; - aSaveStack.Insert( &GetAttrStack(), 0 ); - GetAttrStack().Remove( 0, GetAttrStack().Count() ); + SvxRTFItemStack aSaveStack(GetAttrStack()); + GetAttrStack().clear(); // save the fly array - after read, all flys may be set into // the header/footer @@ -3605,7 +3641,7 @@ void SwRTFParser::ReadHeaderFooter( int nToken, SwPageDesc* pPageDesc ) // wurde an der Position ein Escapement aufgespannt, so entferne // das jetzt. Fussnoten sind bei uns immer hochgestellt. - SvxRTFItemStackTypePtr pTmp = aSaveStack.Top(); + SvxRTFItemStackTypePtr pTmp = aSaveStack.back(); if( pTmp && pTmp->GetSttNodeIdx() == pPam->GetPoint()->nNode.GetIndex() && pTmp->GetSttCnt() == nPos ) @@ -3764,8 +3800,8 @@ void SwRTFParser::ReadHeaderFooter( int nToken, SwPageDesc* pPageDesc ) else SetNewGroup( FALSE ); // { - Klammer war kein Group-Start! mbIsFootnote = bOldIsFootnote; - GetAttrStack().Insert( &aSaveStack, 0 ); - + GetAttrStack() = aSaveStack; + aFlyArr.Insert( &aSaveArray, 0 ); aSaveArray.Remove( 0, aSaveArray.Count() ); bContainsPara = bContainsParaCache; @@ -4123,12 +4159,12 @@ void SwRTFParser::DelLastNode() if( pCNd && pCNd->StartOfSectionIndex()+2 < pCNd->EndOfSectionIndex() ) { - if( GetAttrStack().Count() ) + if( !GetAttrStack().empty() ) { // Attribut Stack-Eintraege, muessen ans Ende des vorherigen // Nodes verschoben werden. BOOL bMove = FALSE; - for( USHORT n = GetAttrStack().Count(); n; ) + for( size_t n = GetAttrStack().size(); n; ) { SvxRTFItemStackType* pStkEntry = (SvxRTFItemStackType*) GetAttrStack()[ --n ]; @@ -4180,7 +4216,7 @@ void SwRTFParser::UnknownAttrToken( int nToken, SfxItemSet* pSet ) // auf die neue Box umsetzen !! SvxRTFItemStack& rAttrStk = GetAttrStack(); const SvxRTFItemStackType* pStk; - for( USHORT n = 0; n < rAttrStk.Count(); ++n ) + for( size_t n = 0; n < rAttrStk.size(); ++n ) if( ( pStk = rAttrStk[ n ])->GetSttNodeIdx() == nOldPos && !pStk->GetSttCnt() ) ((SvxRTFItemStackType*)pStk)->SetStartPos( SwxPosition( pPam ) ); diff --git a/sw/source/filter/rtf/swparrtf.hxx b/sw/source/filter/rtf/swparrtf.hxx index a5a943fa46..a547e29086 100644 --- a/sw/source/filter/rtf/swparrtf.hxx +++ b/sw/source/filter/rtf/swparrtf.hxx @@ -29,9 +29,6 @@ #ifndef _SWPARRTF_HXX #define _SWPARRTF_HXX -#ifndef __SGI_STL_MAP -#include <map> -#endif #ifndef __SGI_STL_DEQUE #include <deque> #endif @@ -47,9 +44,7 @@ #include <editeng/numitem.hxx> #include <editeng/boxitem.hxx> #include <redline.hxx> -#ifndef __SGI_STL_ALGORITHM -#include <algorithm> -#endif + #include <fltshell.hxx> // fuer den Attribut Stack #include <ndindex.hxx> #include "../inc/msfilter.hxx" @@ -81,6 +76,8 @@ struct SvxRTFPictureType; class RtfReader: public Reader { virtual ULONG Read( SwDoc &, const String& rBaseURL, SwPaM &,const String &); +public: + virtual ULONG Read( SvStream* pStrm, SwDoc &, const String& rBaseURL, SwPaM &); }; class SwNodeIdx : public SvxNodeIdx @@ -160,7 +157,7 @@ DECLARE_TABLE( SwRTFStyleTbl, SwTxtFmtColl* ) DECLARE_TABLE( SwRTFCharStyleTbl, SwCharFmt* ) typedef SwFlySave* SwFlySavePtr; SV_DECL_PTRARR_DEL( SwFlySaveArr, SwFlySavePtr, 0, 20 ) -SV_DECL_VARARR( SwListArr, SwListEntry, 0, 20 ) +typedef std::deque< SwListEntry > SwListArr; struct DocPageInformation { @@ -323,7 +320,7 @@ class SwRTFParser : public SvxRTFParser String sBaseURL; USHORT nAktPageDesc, nAktFirstPageDesc; - USHORT nAktBox; // akt. Box + USHORT m_nCurrentBox; USHORT nInsTblRow; // beim nach \row kein \pard -> neue Line anlegen USHORT nNewNumSectDef; // jeder SectionWechsel kann neue Rules definieren USHORT nRowsToRepeat; diff --git a/sw/source/filter/rtf/wrtrtf.cxx b/sw/source/filter/rtf/wrtrtf.cxx deleted file mode 100644 index 31c77c5f86..0000000000 --- a/sw/source/filter/rtf/wrtrtf.cxx +++ /dev/null @@ -1,1806 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sw.hxx" -#include <stdlib.h> -#include <hintids.hxx> - -#include <comphelper/string.hxx> -#include <tools/stream.hxx> -#include <tools/datetime.hxx> -#include <unotools/fontcvt.hxx> -#include <rtl/tencinfo.h> -#include <svtools/rtfkeywd.hxx> -#include <svtools/rtfout.hxx> -#include <editeng/paperinf.hxx> -#include <editeng/fontitem.hxx> -#include <editeng/shaditem.hxx> -#include <editeng/brshitem.hxx> -#include <editeng/colritem.hxx> -#include <editeng/boxitem.hxx> -#include <editeng/tstpitem.hxx> -#include <editeng/ulspitem.hxx> -#include <editeng/lrspitem.hxx> -#include <editeng/frmdiritem.hxx> -#include <editeng/udlnitem.hxx> -#include <fmtpdsc.hxx> -#include <fmtcntnt.hxx> -#include <fmtfsize.hxx> -#include <fmthdft.hxx> -#include <frmatr.hxx> -#include <fmtanchr.hxx> -#include <docary.hxx> -#include <pam.hxx> -#include <doc.hxx> -#include <paratr.hxx> -#include <fldbas.hxx> -#include <ndtxt.hxx> -#include <wrtrtf.hxx> -#include <flypos.hxx> -#include <IMark.hxx> -#include <pagedesc.hxx> // fuer SwPageDesc... -#include <ftninfo.hxx> -#include <charfmt.hxx> -#include <SwStyleNameMapper.hxx> -#include <section.hxx> -#include <swtable.hxx> // fuer SwPageDesc ... -#include <swmodule.hxx> -#include <swerror.h> -#include <mdiexp.hxx> // ...Percent() -#include <statstr.hrc> // ResId fuer Statusleiste -#include <docsh.hxx> - -#include <com/sun/star/document/XDocumentProperties.hpp> -#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> - - -#if defined(UNX) -const sal_Char SwRTFWriter::sNewLine = '\012'; -#else -const sal_Char __FAR_DATA SwRTFWriter::sNewLine[] = "\015\012"; -#endif - -SV_DECL_VARARR( RTFColorTbl, Color, 5, 8 ) -SV_IMPL_VARARR( RTFColorTbl, Color ) - - -SwRTFWriter::SwRTFWriter( const String& rFltName, const String & rBaseURL ) : - eDefaultEncoding( - rtl_getTextEncodingFromWindowsCharset( - sw::ms::rtl_TextEncodingToWinCharset(DEF_ENCODING))), - eCurrentEncoding(eDefaultEncoding) -{ - SetBaseURL( rBaseURL ); - // schreibe Win-RTF-HelpFileFmt - bWriteHelpFmt = 'W' == rFltName.GetChar( 0 ); - // schreibe nur Gliederungs Absaetze - bOutOutlineOnly = 'O' == rFltName.GetChar( 0 ); - // enable non-standard tags for cut and paste - bNonStandard = '\0' == rFltName.GetChar( 0 ); -} - - -SwRTFWriter::~SwRTFWriter() -{} - - -ULONG SwRTFWriter::WriteStream() -{ - bOutPageAttr = bOutSection = TRUE; - - bOutStyleTab = bOutTable = bOutPageDesc = bOutPageDescTbl = - bAutoAttrSet = bOutListNumTxt = bOutLeftHeadFoot = bIgnoreNextPgBreak = - bTxtAttr = bAssociated = FALSE; - - nCurScript = 1; // latin - ask the doc?? - - nCurRedline = USHRT_MAX; - if(pDoc->GetRedlineTbl().Count()) - nCurRedline = 0; - - - pCurEndPosLst = 0; - nBkmkTabPos = -1; - pAktPageDesc = 0; - pAttrSet = 0; - pFlyFmt = 0; // kein FlyFrmFormat gesetzt - - pColTbl = new RTFColorTbl; - pNumRuleTbl = 0; - - BYTE nSz = (BYTE)Min( pDoc->GetSpzFrmFmts()->Count(), USHORT(255) ); - SwPosFlyFrms aFlyPos( nSz, nSz ); - - //Abkuerzung wenn nur Gliederung ausgegeben werden soll, und keine - //Gliederungsabsaetze ausserhalb des Body stehen. - if ( bOutOutlineOnly && - pDoc->GetNodes().GetOutLineNds().Count() && - pDoc->GetNodes().GetOutLineNds()[0]->GetIndex() > - pDoc->GetNodes().GetEndOfExtras().GetIndex() ) - { - nAktFlyPos = 0; - pFlyPos = 0; - MakeHeader(); - - const SwOutlineNodes &rOutLine = pDoc->GetNodes().GetOutLineNds(); - for ( USHORT i = 0; i < rOutLine.Count(); ++i ) - { - const SwNode *pNd = pDoc->GetNodes()[*rOutLine[i]]; - ASSERT( pNd->IsCntntNode(), "Outlinenode and no CntNode!?" ); - - SwCntntNode* pCNd = (SwCntntNode*)pNd; - - // erfrage den aktuellen PageDescriptor. - const SwPageDesc* pTmp = pCNd->GetSwAttrSet().GetPageDesc().GetPageDesc(); - if( pTmp ) - pAktPageDesc = pTmp; - pCurPam->GetPoint()->nContent.Assign( pCNd, 0 ); - Out( aRTFNodeFnTab, *pCNd, *this ); - } - } - else - { - long nMaxNode = pDoc->GetNodes().Count(); - - if( bShowProgress ) - ::StartProgress( STR_STATSTR_W4WWRITE, 0, nMaxNode, pDoc->GetDocShell() ); - - // Tabelle am Doc.-Anfang beachten - { - SwTableNode * pTNd = pCurPam->GetNode()->FindTableNode(); - if( pTNd && bWriteAll ) - { - // mit dem TabellenNode anfangen !! - pCurPam->GetPoint()->nNode = *pTNd; - - if( bWriteOnlyFirstTable ) - pCurPam->GetMark()->nNode = *pTNd->EndOfSectionNode(); - } - } - - // Tabelle fuer die freifliegenden Rahmen erzeugen, aber nur wenn - // das gesamte Dokument geschrieben wird - nAktFlyPos = 0; - pDoc->GetAllFlyFmts( aFlyPos, bWriteAll ? 0 : pOrigPam ); - - // sollten nur Rahmen vorhanden sein? - // (Moeglich, wenn eine Rahmen-Selektion ins Clipboard - // gestellt wurde) - if( bWriteAll && - // keine Laenge - *pCurPam->GetPoint() == *pCurPam->GetMark() && - // Rahmen vorhanden - pDoc->GetSpzFrmFmts()->Count() && !aFlyPos.Count() && - // nur ein Node im Array - pDoc->GetNodes().GetEndOfExtras().GetIndex() + 3 == - pDoc->GetNodes().GetEndOfContent().GetIndex() && - // und genau der ist selektiert - pDoc->GetNodes().GetEndOfContent().GetIndex() - 1 == - pCurPam->GetPoint()->nNode.GetIndex() ) - { - // dann den Inhalt vom Rahmen ausgeben. - // dieser steht immer an Position 0 !! - SwFrmFmt* pFmt = (*pDoc->GetSpzFrmFmts())[ 0 ]; - const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); - if( pIdx ) - { - SwPosFlyFrm* pFPos = new SwPosFlyFrm( pCurPam->GetPoint()->nNode, - pFmt, aFlyPos.Count() ); - aFlyPos.Insert( pFPos ); - } - } - - pFlyPos = &aFlyPos; - - // schreibe die StyleTabelle, allgemeine Angaben,Header/Footer/Footnotes - MakeHeader(); - - Out_SwDoc( pOrigPam ); - - if( bShowProgress ) - ::EndProgress( pDoc->GetDocShell() ); - } - - Strm() << '}'; - - // loesche die Tabelle mit den freifliegenden Rahmen - for( USHORT i = aFlyPos.Count(); i > 0; ) - delete aFlyPos[ --i ]; - - pFlyPos = 0; - delete pColTbl; - if( pNumRuleTbl ) - { - // don't destroy the numrule pointers in the DTOR. - pNumRuleTbl->Remove( 0, pNumRuleTbl->Count() ); - delete pNumRuleTbl; - } - delete pRedlAuthors; - - // schreibe Win-RTF-HelpFileFmt - bOutOutlineOnly = bWriteHelpFmt = FALSE; - pAttrSet = 0; - - return 0; -} - - -void SwRTFWriter::Out_SwDoc( SwPaM* pPam ) -{ - BOOL bSaveWriteAll = bWriteAll; // sichern - // suche die naechste Bookmark-Position aus der Bookmark-Tabelle - nBkmkTabPos = bWriteAll ? FindPos_Bkmk( *pCurPam->GetPoint() ) : -1; - - // gebe alle Bereiche des Pams in das RTF-File aus. - do { - bWriteAll = bSaveWriteAll; - bFirstLine = TRUE; - - // suche den ersten am Pam-auszugebenen FlyFrame - // fehlt noch: - - while( pCurPam->GetPoint()->nNode < pCurPam->GetMark()->nNode || - (pCurPam->GetPoint()->nNode == pCurPam->GetMark()->nNode && - pCurPam->GetPoint()->nContent.GetIndex() <= pCurPam->GetMark()->nContent.GetIndex()) ) - { - SwNode& rNd = pCurPam->GetPoint()->nNode.GetNode(); - - if( &rNd == &pDoc->GetNodes().GetEndOfContent() ) - break; - - if( rNd.IsCntntNode() ) - { - SwCntntNode& rCNd = (SwCntntNode&)rNd; - - OutBreaks( rCNd.GetSwAttrSet() ); - OutFlyFrm(); - - if( !bFirstLine ) - pCurPam->GetPoint()->nContent.Assign( &rCNd, 0 ); - - if( !bOutOutlineOnly || - //( rCNd.IsTxtNode() && NO_NUMBERING != //#outline level,removed by zhaojianwei - //((SwTxtNode&)rCNd).GetTxtColl()->GetOutlineLevel() )) - ( rCNd.IsTxtNode() && //->add by zhaojianwei - ((SwTxtNode&)rCNd).GetTxtColl()->IsAssignedToListLevelOfOutlineStyle()))//<-end,zhaojianwei - Out( aRTFNodeFnTab, rCNd, *this ); - - } - else if( !bOutOutlineOnly ) - { - if (rNd.IsTableNode()) - { - bool bAllOk = false; - if (const SwTableNode *pNd = rNd.GetTableNode()) - { - if (const SwFrmFmt *pFmt = pNd->GetTable().GetFrmFmt()) - { - OutBreaks(pFmt->GetAttrSet()); - bAllOk = true; - } - OutRTF_SwTblNode(*this, *pNd); - } - ASSERT(bAllOk, "Unexpected missing properties from tables"); - } - else if( rNd.IsSectionNode() ) - { - OutBreaks( ((SwSectionNode&)rNd).GetSection().GetFmt() - ->GetAttrSet() ); - OutRTF_SwSectionNode( *this, (SwSectionNode&)rNd ); - } - else if( rNd.IsEndNode() ) - CheckEndNodeForSection( rNd ); - } - - ULONG nPos = pCurPam->GetPoint()->nNode++; // Bewegen - - if( bShowProgress ) - ::SetProgressState( nPos, pDoc->GetDocShell() ); // Wie weit ? - - /* sollen nur die Selectierten Bereiche gesichert werden, so - * duerfen nur die vollstaendigen Nodes gespeichert werde, - * d.H. der 1. und n. Node teilweise, der 2. bis n-1. Node - * vollstaendig. (vollstaendig heisst mit allen Formaten! ) - */ - bWriteAll = bSaveWriteAll || - pCurPam->GetPoint()->nNode != pCurPam->GetMark()->nNode; - bFirstLine = FALSE; - } - } while( CopyNextPam( &pPam ) ); // bis alle PaM's bearbeitet - - bWriteAll = bSaveWriteAll; // wieder auf alten Wert zurueck -} - - -// schreibe die StyleTabelle, algemeine Angaben,Header/Footer/Footnotes - - -void SwRTFWriter::MakeHeader() -{ - // baue den Vorspann wie Header, ColorTbl, FontTbl - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_RTF << '1' - << OOO_STRING_SVTOOLS_RTF_ANSI; - if( bWriteAll ) - { - Strm() << OOO_STRING_SVTOOLS_RTF_DEFF; - OutULong( GetId( (SvxFontItem&)pDoc->GetAttrPool().GetDefaultItem( - RES_CHRATR_FONT ) )); - } - // JP 13.02.2001 - if this not exist, MS don't understand our ansi - // characters (0x80-0xff). - Strm() << "\\adeflang1025"; - - OutRTFFontTab(); - OutRTFColorTab(); - OutRTFStyleTab(); - OutRTFListTab(); - OutRTFRevTab(); - - Strm() << SwRTFWriter::sNewLine; // ein Trenner - - // wenn teilweise ausgegeben wird, die globalen Daten nicht speichern - if( !bWriteAll ) - return; - - // Ausgeben der Doc-Info/-Statistik - OutDocInfoStat(); - - // einige globale Daten Schreiben - { // Default-TabSize - const SvxTabStopItem& rTabs = (const SvxTabStopItem&) - pDoc->GetAttrPool().GetDefaultItem( RES_PARATR_TABSTOP ); - Strm() << OOO_STRING_SVTOOLS_RTF_DEFTAB; - OutLong( rTabs[0].GetTabPos() ); - if ( !pDoc->get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) ) - Strm() << OOO_STRING_SVTOOLS_RTF_LYTPRTMET; - } - - // PageDescriptor ausgeben (??nur wenn das gesamte Dokument??) - OutPageDesc(); - - // gebe die Groesse und die Raender der Seite aus - if( pDoc->GetPageDescCnt() ) - { - //JP 06.04.99: Bug 64361 - suche den ersten SwFmtPageDesc. Ist - // keiner gesetzt, so ist der Standard gueltig - const SwFmtPageDesc* pSttPgDsc = 0; - { - const SwNode& rSttNd = *pDoc->GetNodes()[ - pDoc->GetNodes().GetEndOfExtras().GetIndex() + 2 ]; - const SfxItemSet* pSet = 0; - - if( rSttNd.IsCntntNode() ) - pSet = &rSttNd.GetCntntNode()->GetSwAttrSet(); - else if( rSttNd.IsTableNode() ) - pSet = &rSttNd.GetTableNode()->GetTable(). - GetFrmFmt()->GetAttrSet(); - else if( rSttNd.IsSectionNode() ) - pSet = &rSttNd.GetSectionNode()->GetSection(). - GetFmt()->GetAttrSet(); - - if( pSet ) - { - USHORT nPosInDoc; - pSttPgDsc = (SwFmtPageDesc*)&pSet->Get( RES_PAGEDESC ); - if( !pSttPgDsc->GetPageDesc() ) - pSttPgDsc = 0; - else if( pDoc->FindPageDescByName( pSttPgDsc-> - GetPageDesc()->GetName(), &nPosInDoc )) - { - // FALSE wegen schliessender Klammer !! - OutComment( *this, OOO_STRING_SVTOOLS_RTF_PGDSCNO, FALSE ); - OutULong( nPosInDoc ) << '}'; - } - } - } - const SwPageDesc& rPageDesc = pSttPgDsc ? *pSttPgDsc->GetPageDesc() - : const_cast<const SwDoc *>(pDoc)->GetPageDesc( 0 ); - const SwFrmFmt &rFmtPage = rPageDesc.GetMaster(); - - { - if( rPageDesc.GetLandscape() ) - Strm() << OOO_STRING_SVTOOLS_RTF_LANDSCAPE; - - const SwFmtFrmSize& rSz = rFmtPage.GetFrmSize(); - // Clipboard-Dokument wird immer ohne Drucker angelegt, so ist - // der Std.PageDesc immer aug LONG_MAX !! Mappe dann auf DIN A4 - if( LONG_MAX == rSz.GetHeight() || LONG_MAX == rSz.GetWidth() ) - { - Strm() << OOO_STRING_SVTOOLS_RTF_PAPERH; - Size a4 = SvxPaperInfo::GetPaperSize(PAPER_A4); - OutULong( a4.Height() ) << OOO_STRING_SVTOOLS_RTF_PAPERW; - OutULong( a4.Width() ); - } - else - { - Strm() << OOO_STRING_SVTOOLS_RTF_PAPERH; - OutULong( rSz.GetHeight() ) << OOO_STRING_SVTOOLS_RTF_PAPERW; - OutULong( rSz.GetWidth() ); - } - } - - { - const SvxLRSpaceItem& rLR = rFmtPage.GetLRSpace(); - Strm() << OOO_STRING_SVTOOLS_RTF_MARGL; - OutLong( rLR.GetLeft() ) << OOO_STRING_SVTOOLS_RTF_MARGR; - OutLong( rLR.GetRight() ); - } - - { - const SvxULSpaceItem& rUL = rFmtPage.GetULSpace(); - Strm() << OOO_STRING_SVTOOLS_RTF_MARGT; - OutLong( rUL.GetUpper() ) << OOO_STRING_SVTOOLS_RTF_MARGB; - OutLong( rUL.GetLower() ); - } - - Strm() << OOO_STRING_SVTOOLS_RTF_SECTD << OOO_STRING_SVTOOLS_RTF_SBKNONE; - OutRTFPageDescription( rPageDesc, FALSE, TRUE ); // Changed bCheckForFirstPage to TRUE so headers - // following title page are correctly added - i13107 - if( pSttPgDsc ) - { - bIgnoreNextPgBreak = TRUE; - pAktPageDesc = &rPageDesc; - } - } - - - { - // schreibe die Fussnoten- und Endnoten-Info raus - const SwFtnInfo& rFtnInfo = pDoc->GetFtnInfo(); - - const char* pOut = FTNPOS_CHAPTER == rFtnInfo.ePos - ? OOO_STRING_SVTOOLS_RTF_ENDDOC - : OOO_STRING_SVTOOLS_RTF_FTNBJ; - Strm() << pOut << OOO_STRING_SVTOOLS_RTF_FTNSTART; - OutLong( rFtnInfo.nFtnOffset + 1 ); - - switch( rFtnInfo.eNum ) - { - case FTNNUM_PAGE: pOut = OOO_STRING_SVTOOLS_RTF_FTNRSTPG; break; - case FTNNUM_DOC: pOut = OOO_STRING_SVTOOLS_RTF_FTNRSTCONT; break; -// case FTNNUM_CHAPTER: - default: pOut = OOO_STRING_SVTOOLS_RTF_FTNRESTART; break; - } - Strm() << pOut; - - switch( rFtnInfo.aFmt.GetNumberingType() ) - { - case SVX_NUM_CHARS_LOWER_LETTER: - case SVX_NUM_CHARS_LOWER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_FTNNALC; break; - case SVX_NUM_CHARS_UPPER_LETTER: - case SVX_NUM_CHARS_UPPER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_FTNNAUC; break; - case SVX_NUM_ROMAN_LOWER: pOut = OOO_STRING_SVTOOLS_RTF_FTNNRLC; break; - case SVX_NUM_ROMAN_UPPER: pOut = OOO_STRING_SVTOOLS_RTF_FTNNRUC; break; - case SVX_NUM_CHAR_SPECIAL: pOut = OOO_STRING_SVTOOLS_RTF_FTNNCHI; break; -// case SVX_NUM_ARABIC: - default: pOut = OOO_STRING_SVTOOLS_RTF_FTNNAR; break; - } - Strm() << pOut; - - - const SwEndNoteInfo& rEndNoteInfo = pDoc->GetEndNoteInfo(); - - Strm() << OOO_STRING_SVTOOLS_RTF_AENDDOC << OOO_STRING_SVTOOLS_RTF_AFTNRSTCONT - << OOO_STRING_SVTOOLS_RTF_AFTNSTART; - OutLong( rEndNoteInfo.nFtnOffset + 1 ); - - switch( rEndNoteInfo.aFmt.GetNumberingType() ) - { - case SVX_NUM_CHARS_LOWER_LETTER: - case SVX_NUM_CHARS_LOWER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNALC; break; - case SVX_NUM_CHARS_UPPER_LETTER: - case SVX_NUM_CHARS_UPPER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNAUC; break; - case SVX_NUM_ROMAN_LOWER: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNRLC; break; - case SVX_NUM_ROMAN_UPPER: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNRUC; break; - case SVX_NUM_CHAR_SPECIAL: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNCHI; break; -// case SVX_NUM_ARABIC: - default: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNAR; break; - } - Strm() << pOut; - } - - if( pDoc->_GetDBDesc().sDataSource.getLength() ) - { - // stelle erstmal fest, ob ueberhaupt Datenbankfelder benutzt werden! - const SwFldTypes* pTypes = pDoc->GetFldTypes(); - for( USHORT nCnt = pTypes->Count(); nCnt >= INIT_FLDTYPES; ) - if( RES_DBFLD == (*pTypes)[ --nCnt ]->Which() && - (*pTypes)[ nCnt ]->GetDepends() ) - { - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_FIELD; - OutComment( *this, OOO_STRING_SVTOOLS_RTF_FLDINST ) << " DATA "; - SwDBData aData = pDoc->GetDBData(); - String sOut(aData.sDataSource); - sOut += DB_DELIM; - sOut += (String)aData.sCommand; - RTFOutFuncs::Out_String( Strm(), sOut, - eDefaultEncoding, bWriteHelpFmt ); - Strm() << "}{" << OOO_STRING_SVTOOLS_RTF_FLDRSLT << " }}"; - break; - } - } - - pAttrSet = 0; - - Strm() << SwRTFWriter::sNewLine; // ein Trenner -} - -void SwRTFWriter::OutInfoDateTime( const sal_Char* i_pStr, - const util::DateTime& i_rDT ) -{ - Strm() << '{' << i_pStr << OOO_STRING_SVTOOLS_RTF_YR; - OutLong( Strm(), i_rDT.Year ) << OOO_STRING_SVTOOLS_RTF_MO; - OutLong( Strm(), i_rDT.Month ) << OOO_STRING_SVTOOLS_RTF_DY; - OutLong( Strm(), i_rDT.Day ) << OOO_STRING_SVTOOLS_RTF_HR; - OutLong( Strm(), i_rDT.Hours ) << OOO_STRING_SVTOOLS_RTF_MIN; - OutLong( Strm(), i_rDT.Minutes ) << '}'; -} - -bool CharsetSufficient(const String &rString, rtl_TextEncoding eChrSet) -{ - const sal_uInt32 nFlags = - RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR | - RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR; - rtl::OString sDummy; - rtl::OUString sStr(rString); - return sStr.convertToString(&sDummy, eChrSet, nFlags); -} - -void SwRTFWriter::OutUnicodeSafeRecord(const sal_Char *pToken, - const String &rContent) -{ - if (rContent.Len()) - { - bool bNeedUnicodeWrapper = !CharsetSufficient(rContent, eDefaultEncoding); - - if (bNeedUnicodeWrapper) - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_UPR; - - Strm() << '{' << pToken << ' '; - OutRTF_AsByteString(*this, rContent, eDefaultEncoding); - Strm() << '}'; - - if (bNeedUnicodeWrapper) - { - OutComment(*this, OOO_STRING_SVTOOLS_RTF_UD); - Strm() << '{' << pToken << ' '; - RTFOutFuncs::Out_String(Strm(), rContent, eDefaultEncoding, - bWriteHelpFmt); - Strm() << "}}}"; - } - - } -} - -void SwRTFWriter::OutDocInfoStat() -{ - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_INFO; - - SwDocShell *pDocShell(pDoc->GetDocShell()); - uno::Reference<document::XDocumentProperties> xDocProps; - if (pDocShell) { - uno::Reference<document::XDocumentPropertiesSupplier> xDPS( - pDocShell->GetModel(), uno::UNO_QUERY_THROW); - xDocProps.set(xDPS->getDocumentProperties()); - } - - // may be null (in case of copying) - if (xDocProps.is()) - { - OutUnicodeSafeRecord(OOO_STRING_SVTOOLS_RTF_TITLE, xDocProps->getTitle()); - OutUnicodeSafeRecord(OOO_STRING_SVTOOLS_RTF_SUBJECT, xDocProps->getSubject()); - - OutUnicodeSafeRecord(OOO_STRING_SVTOOLS_RTF_KEYWORDS, - ::comphelper::string::convertCommaSeparated(xDocProps->getKeywords())); - OutUnicodeSafeRecord(OOO_STRING_SVTOOLS_RTF_DOCCOMM, xDocProps->getDescription()); - - OutUnicodeSafeRecord(OOO_STRING_SVTOOLS_RTF_AUTHOR, xDocProps->getAuthor() ); - OutInfoDateTime(OOO_STRING_SVTOOLS_RTF_CREATIM, xDocProps->getCreationDate()); - - OutUnicodeSafeRecord(OOO_STRING_SVTOOLS_RTF_AUTHOR, xDocProps->getModifiedBy() ); - OutInfoDateTime(OOO_STRING_SVTOOLS_RTF_REVTIM, xDocProps->getModificationDate()); - - OutInfoDateTime(OOO_STRING_SVTOOLS_RTF_PRINTIM, xDocProps->getPrintDate()); - - } - - // fuer interne Zwecke - Versionsnummer rausschreiben - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_COMMENT << " StarWriter}{" << OOO_STRING_SVTOOLS_RTF_VERN; - OutLong( Strm(), SUPD*10 ) << '}'; - - Strm() << '}'; -} - -static void InsColor( RTFColorTbl& rTbl, const Color& rCol ) -{ - USHORT n; - for( n = 0; n < rTbl.Count(); ++n ) - if( rTbl[n] == rCol ) - return; // schon vorhanden, zurueck - - n = COL_AUTO == rCol.GetColor() ? 0 : rTbl.Count(); - rTbl.Insert( rCol, n ); -} - -static void InsColorLine( RTFColorTbl& rTbl, const SvxBoxItem& rBox ) -{ - const SvxBorderLine* pLine = 0; - - if( rBox.GetTop() ) - InsColor( rTbl, (pLine = rBox.GetTop())->GetColor() ); - if( rBox.GetBottom() && pLine != rBox.GetBottom() ) - InsColor( rTbl, (pLine = rBox.GetBottom())->GetColor() ); - if( rBox.GetLeft() && pLine != rBox.GetLeft() ) - InsColor( rTbl, (pLine = rBox.GetLeft())->GetColor() ); - if( rBox.GetRight() && pLine != rBox.GetRight() ) - InsColor( rTbl, rBox.GetRight()->GetColor() ); -} - -void SwRTFWriter::OutRTFColorTab() -{ - ASSERT( pColTbl, "Wo ist meine Color-Tabelle?" ); - - // dann baue die ColorTabelle aus allen Attributen, die Colors - // enthalten und im Pool angemeldet sind auf. - USHORT n, nMaxItem; - const SfxItemPool& rPool = pDoc->GetAttrPool(); - - // das Charakter - Color Attribut - { - const SvxColorItem* pCol = (const SvxColorItem*)GetDfltAttr( - RES_CHRATR_COLOR ); - InsColor( *pColTbl, pCol->GetValue() ); - if( 0 != ( pCol = (const SvxColorItem*)rPool.GetPoolDefaultItem( - RES_CHRATR_COLOR ) )) - InsColor( *pColTbl, pCol->GetValue() ); - nMaxItem = rPool.GetItemCount(RES_CHRATR_COLOR); - for( n = 0; n < nMaxItem; ++n ) - { - if( 0 != (pCol = (const SvxColorItem*)rPool.GetItem( - RES_CHRATR_COLOR, n ) ) ) - InsColor( *pColTbl, pCol->GetValue() ); - } - - const SvxUnderlineItem* pUnder = (const SvxUnderlineItem*)GetDfltAttr( RES_CHRATR_UNDERLINE ); - InsColor( *pColTbl, pUnder->GetColor() ); - nMaxItem = rPool.GetItemCount(RES_CHRATR_UNDERLINE); - for( n = 0; n < nMaxItem;n++) - { - if( 0 != (pUnder = (const SvxUnderlineItem*)rPool.GetItem( RES_CHRATR_UNDERLINE, n ) ) ) - InsColor( *pColTbl, pUnder->GetColor() ); - - } - - const SvxOverlineItem* pOver = (const SvxOverlineItem*)GetDfltAttr( RES_CHRATR_OVERLINE ); - InsColor( *pColTbl, pOver->GetColor() ); - nMaxItem = rPool.GetItemCount(RES_CHRATR_OVERLINE); - for( n = 0; n < nMaxItem;n++) - { - if( 0 != (pOver = (const SvxOverlineItem*)rPool.GetItem( RES_CHRATR_OVERLINE, n ) ) ) - InsColor( *pColTbl, pOver->GetColor() ); - - } - - } - - // das Frame Hintergrund - Attribut - static const USHORT aBrushIds[] = { - RES_BACKGROUND, RES_CHRATR_BACKGROUND, 0 }; - - for( const USHORT* pIds = aBrushIds; *pIds; ++pIds ) - { - const SvxBrushItem* pBkgrd = (const SvxBrushItem*)GetDfltAttr( *pIds ); - InsColor( *pColTbl, pBkgrd->GetColor() ); - if( 0 != ( pBkgrd = (const SvxBrushItem*)rPool.GetPoolDefaultItem( - *pIds ) )) - { - InsColor( *pColTbl, pBkgrd->GetColor() ); - } - nMaxItem = rPool.GetItemCount( *pIds ); - for( n = 0; n < nMaxItem; ++n ) - if( 0 != (pBkgrd = (const SvxBrushItem*)rPool.GetItem( - *pIds , n ) )) - { - InsColor( *pColTbl, pBkgrd->GetColor() ); - } - } - - // das Frame Schatten - Attribut - { - const SvxShadowItem* pShadow = (const SvxShadowItem*)GetDfltAttr( - RES_SHADOW ); - InsColor( *pColTbl, pShadow->GetColor() ); - if( 0 != ( pShadow = (const SvxShadowItem*)rPool.GetPoolDefaultItem( - RES_SHADOW ) )) - { - InsColor( *pColTbl, pShadow->GetColor() ); - } - nMaxItem = rPool.GetItemCount(RES_SHADOW); - for( n = 0; n < nMaxItem; ++n ) - if( 0 != (pShadow = (const SvxShadowItem*)rPool.GetItem( - RES_SHADOW, n ) ) ) - { - InsColor( *pColTbl, pShadow->GetColor() ); - } - } - - // das Frame Umrandungs - Attribut - { - // Box muesste noch gemacht werden, aber default nie eine Line gesetzt! - const SvxBoxItem* pBox; - if( 0 != ( pBox = (const SvxBoxItem*)rPool.GetPoolDefaultItem( - RES_BOX ) )) - InsColorLine( *pColTbl, *pBox ); - nMaxItem = rPool.GetItemCount(RES_BOX); - for( n = 0; n < nMaxItem; ++n ) - if( 0 != (pBox = (const SvxBoxItem*)rPool.GetItem( RES_BOX, n ) )) - InsColorLine( *pColTbl, *pBox ); - } - - // und raus damit - Strm() << SwRTFWriter::sNewLine << '{' << OOO_STRING_SVTOOLS_RTF_COLORTBL; - - for( n = 0; n < pColTbl->Count(); n++ ) - { - const Color& rCol = (*pColTbl)[ n ]; - if( n || COL_AUTO != rCol.GetColor() ) - { - Strm() << OOO_STRING_SVTOOLS_RTF_RED; - OutULong( rCol.GetRed() ) << OOO_STRING_SVTOOLS_RTF_GREEN; - OutULong( rCol.GetGreen() ) << OOO_STRING_SVTOOLS_RTF_BLUE; - OutULong( rCol.GetBlue() ); - } - Strm() << ';'; - } - Strm() << '}'; -} - -bool FontCharsetSufficient(const String &rFntNm, const String &rAltNm, - rtl_TextEncoding eChrSet) -{ - bool bRet = CharsetSufficient(rFntNm, eChrSet); - if (bRet) - bRet = CharsetSufficient(rAltNm, eChrSet); - return bRet; -} - -static void _OutFont( SwRTFWriter& rWrt, const SvxFontItem& rFont, USHORT nNo ) -{ - rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_F; - - const char* pStr = OOO_STRING_SVTOOLS_RTF_FNIL; - switch (rFont.GetFamily()) - { - case FAMILY_ROMAN: - pStr = OOO_STRING_SVTOOLS_RTF_FROMAN; - break; - case FAMILY_SWISS: - pStr = OOO_STRING_SVTOOLS_RTF_FSWISS; - break; - case FAMILY_MODERN: - pStr = OOO_STRING_SVTOOLS_RTF_FMODERN; - break; - case FAMILY_SCRIPT: - pStr = OOO_STRING_SVTOOLS_RTF_FSCRIPT; - break; - case FAMILY_DECORATIVE: - pStr = OOO_STRING_SVTOOLS_RTF_FDECOR; - break; - default: - break; - } - rWrt.OutULong(nNo) << pStr << OOO_STRING_SVTOOLS_RTF_FPRQ; - - USHORT nVal = 0; - switch (rFont.GetPitch()) - { - case PITCH_FIXED: - nVal = 1; - break; - case PITCH_VARIABLE: - nVal = 2; - break; - default: - nVal = 0; - break; - } - rWrt.OutULong(nVal); - - sw::util::FontMapExport aRes(rFont.GetFamilyName()); - - /* - #i10538# - In rtf the fontname is in the fontcharset, so if that isn't possible - then bump the charset up to unicode - */ - sal_uInt8 nChSet = 0; - rtl_TextEncoding eChrSet = rFont.GetCharSet(); - nChSet = sw::ms::rtl_TextEncodingToWinCharset(eChrSet); - eChrSet = rtl_getTextEncodingFromWindowsCharset(nChSet); - if (!FontCharsetSufficient(aRes.msPrimary, aRes.msSecondary, eChrSet)) - { - eChrSet = RTL_TEXTENCODING_UNICODE; - nChSet = sw::ms::rtl_TextEncodingToWinCharset(eChrSet); - eChrSet = rtl_getTextEncodingFromWindowsCharset(nChSet); - } - - rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FCHARSET; - rWrt.OutULong( nChSet ); - rWrt.Strm() << ' '; - if (aRes.HasDistinctSecondary()) - { - RTFOutFuncs::Out_Fontname(rWrt.Strm(), aRes.msPrimary, eChrSet, - rWrt.bWriteHelpFmt); - OutComment(rWrt, OOO_STRING_SVTOOLS_RTF_FALT) << ' '; - RTFOutFuncs::Out_Fontname(rWrt.Strm(), aRes.msSecondary, eChrSet, - rWrt.bWriteHelpFmt) << '}'; - } - else - { - RTFOutFuncs::Out_Fontname(rWrt.Strm(), aRes.msPrimary, eChrSet, - rWrt.bWriteHelpFmt); - } - rWrt.Strm() << ";}"; -} - -void SwRTFWriter::OutRTFFontTab() -{ - USHORT n = 0; - const SfxItemPool& rPool = pDoc->GetAttrPool(); - const SvxFontItem* pFont = (const SvxFontItem*)GetDfltAttr(RES_CHRATR_FONT); - - Strm() << SwRTFWriter::sNewLine << '{' << OOO_STRING_SVTOOLS_RTF_FONTTBL; - _OutFont( *this, *pFont, n++ ); - - pFont = (const SvxFontItem*)rPool.GetPoolDefaultItem(RES_CHRATR_FONT); - if (pFont) - _OutFont(*this, *pFont, n++); - - PutNumFmtFontsInAttrPool(); - PutCJKandCTLFontsInAttrPool(); - - USHORT nMaxItem = rPool.GetItemCount(RES_CHRATR_FONT); - for (USHORT nGet = 0; nGet < nMaxItem; ++nGet) - { - pFont = (const SvxFontItem*)rPool.GetItem(RES_CHRATR_FONT, nGet); - if (pFont) - _OutFont(*this, *pFont, n++); - } - - Strm() << '}'; -} - -void RTF_WrtRedlineAuthor::Write(Writer &rWrt) -{ - SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt; - - rRTFWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_REVTBL << ' '; - typedef std::vector<String>::iterator myiter; - - for(std::vector<String>::iterator aIter = maAuthors.begin(); aIter != maAuthors.end(); ++aIter) - { - rRTFWrt.Strm() << '{'; - // rWrt.bWriteHelpFmt - RTFOutFuncs::Out_String( rRTFWrt.Strm(), *aIter, rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ) << ";}"; - } - rRTFWrt.Strm() << '}' << SwRTFWriter::sNewLine; -} - -bool SwRTFWriter::OutRTFRevTab() -{ - // Writes the revision author table - int nRevAuthors = pDoc->GetRedlineTbl().Count(); - - pRedlAuthors = new RTF_WrtRedlineAuthor; - // RTF always seems to use Unknown as the default first entry - String sUnknown(RTL_CONSTASCII_STRINGPARAM("Unknown")); - pRedlAuthors->AddName(sUnknown); - - if (nRevAuthors < 1) - return false; - - // pull out all the redlines and make a vector of all the author names - for( USHORT i = 0; i < pDoc->GetRedlineTbl().Count(); ++i ) - { - const SwRedline* pRedl = pDoc->GetRedlineTbl()[ i ]; - const String sAuthor = SW_MOD()->GetRedlineAuthor( pRedl->GetAuthor() ); - pRedlAuthors->AddName(sAuthor); - } - - pRedlAuthors->Write(*this); - return true; -} - -//Takashi Ono for CJK -const rtl::OUString SwRTFWriter::XlateFmtName( const rtl::OUString &rName, SwGetPoolIdFromName eFlags ) -{ -#define RES_NONE RES_POOLCOLL_DOC_END - - static const RES_POOL_COLLFMT_TYPE aArr[]={ - RES_POOLCOLL_STANDARD, RES_POOLCOLL_HEADLINE1, RES_POOLCOLL_HEADLINE2, - RES_POOLCOLL_HEADLINE3, RES_POOLCOLL_HEADLINE4, RES_POOLCOLL_HEADLINE5, - RES_POOLCOLL_HEADLINE6, RES_POOLCOLL_HEADLINE7, RES_POOLCOLL_HEADLINE8, - RES_POOLCOLL_HEADLINE9, - - RES_POOLCOLL_TOX_IDX1, RES_POOLCOLL_TOX_IDX2, RES_POOLCOLL_TOX_IDX3, - RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE, - RES_POOLCOLL_TOX_CNTNT1, - - RES_POOLCOLL_TOX_CNTNT2, RES_POOLCOLL_TOX_CNTNT3, RES_POOLCOLL_TOX_CNTNT4, - RES_POOLCOLL_TOX_CNTNT5, RES_POOLCOLL_TOX_CNTNT6, RES_POOLCOLL_TOX_CNTNT7, - RES_POOLCOLL_TOX_CNTNT8, RES_POOLCOLL_TOX_CNTNT9, - RES_POOLCOLL_TEXT_IDENT, RES_POOLCOLL_FOOTNOTE, - - RES_NONE, RES_POOLCOLL_HEADER, RES_POOLCOLL_FOOTER, RES_POOLCOLL_TOX_IDXH, - RES_POOLCOLL_LABEL, RES_POOLCOLL_TOX_ILLUSH, RES_POOLCOLL_JAKETADRESS, RES_POOLCOLL_SENDADRESS, - RES_NONE, RES_NONE, - - RES_NONE, RES_NONE, RES_NONE, RES_POOLCOLL_ENDNOTE, RES_POOLCOLL_TOX_AUTHORITIESH, RES_NONE, RES_NONE, - RES_POOLCOLL_BUL_LEVEL1, RES_POOLCOLL_BUL_LEVEL1, RES_POOLCOLL_NUM_LEVEL1, - - RES_POOLCOLL_BUL_LEVEL2, RES_POOLCOLL_BUL_LEVEL3, RES_POOLCOLL_BUL_LEVEL4, RES_POOLCOLL_BUL_LEVEL5, - RES_POOLCOLL_BUL_LEVEL2, RES_POOLCOLL_BUL_LEVEL3, RES_POOLCOLL_BUL_LEVEL4, RES_POOLCOLL_BUL_LEVEL5, - RES_POOLCOLL_NUM_LEVEL2, RES_POOLCOLL_NUM_LEVEL3, RES_POOLCOLL_NUM_LEVEL4, RES_POOLCOLL_NUM_LEVEL5, - - RES_POOLCOLL_DOC_TITEL, RES_NONE, RES_POOLCOLL_SIGNATURE, RES_NONE, - RES_POOLCOLL_TEXT, RES_POOLCOLL_TEXT_MOVE, RES_NONE, RES_NONE, - - RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_POOLCOLL_DOC_SUBTITEL }; - - static const sal_Char *stiName[] = { - "Normal", "heading 1", "heading 2", - "heading 3", "heading 4", "heading 5", - "heading 6", "heading 7", "heading 8", - "heading 9", - - "index 1", "index 2", "index 3", - "index 4", "index 5", "index 6", - "index 7", "index 8", "index 9", - - "toc 1", "toc 2", "toc 3", - "toc 4", "toc 5", "toc 6", - "toc 7", "toc 8", "toc 9", - "Normal Indent", "footnote text", - - "annotation text", "header", "footer", "index heading", - "caption", "table of figures", "envelope address", "envelope return", - "footnote reference", "annotation reference", - - "line number", "page number", "endnote reference", "endnote text", "table of authorities", "macro", "toa heading", - "List", "List Bullet", "List Number", - - "List 2", "List 3", "List 4", "List 5", - "List Bullet 2", "List Bullet 3", "List Bullet 4", "List Bullet 5", - "List Number 2", "List Number 3", "List Number 4", "List Number 5", - - "Title", "Closing", "Signature", "Default Paragraph Font", - "Body Text", "Body Text Indent", "List Continue", - - "List Continue 2", "List Continue 3", "List Continue 4", "List Continue 5", "Message Header", "Subtitle"}; - - ASSERT( ( sizeof( aArr ) / sizeof( RES_POOL_COLLFMT_TYPE ) == 75 ), - "Style-UEbersetzungstabelle hat falsche Groesse" ); - ASSERT( ( sizeof( stiName ) / sizeof( *stiName ) == 75 ), - "Style-UEbersetzungstabelle hat falsche Groesse" ); - - sal_uInt16 idcol = ::SwStyleNameMapper::GetPoolIdFromUIName( rName, eFlags ); - if (idcol==USHRT_MAX) //#i40770# user defined style names get lost - return rName; - - for (size_t i = 0; i < sizeof( aArr ) / sizeof( *aArr ); i++) - { - if ( idcol == aArr[i] ) - { - return rtl::OUString::createFromAscii(stiName[i]); - } - } - return ::SwStyleNameMapper::GetProgName( idcol, String() ); -} - -void SwRTFWriter::OutRTFStyleTab() -{ - USHORT n; - - // das 0-Style ist das Default, wird nie ausgegeben !! - USHORT nArrLen = pDoc->GetTxtFmtColls()->Count(); - if( nArrLen <= 1 && pDoc->GetCharFmts()->Count() <= 1 ) - return; - - bOutStyleTab = TRUE; - Strm() << SwRTFWriter::sNewLine << '{' << OOO_STRING_SVTOOLS_RTF_STYLESHEET; - - // das Default-TextStyle wird nicht mit ausgegeben !! - for( n = 1; n < nArrLen; ++n ) - { - const SwTxtFmtColl* pColl = (*pDoc->GetTxtFmtColls())[ n ]; - pAttrSet = &pColl->GetAttrSet(); - - Strm() << '{'; - // gebe Attribute aus - OutRTF_SwFmt( *this, *pColl ); - - if( pColl->DerivedFrom() ) - // suche die Id vom "Parent" Format - for( USHORT nBasedOn=1; nBasedOn < nArrLen; nBasedOn++) - if( (*pDoc->GetTxtFmtColls())[ nBasedOn ] == - pColl->DerivedFrom() ) - { - // die Ableitung vom Format - Strm() << OOO_STRING_SVTOOLS_RTF_SBASEDON; - OutULong( nBasedOn ); - break; - } - - if( pColl == &pColl->GetNextTxtFmtColl() ) - { - Strm() << OOO_STRING_SVTOOLS_RTF_SNEXT; - OutULong( n ); - } - else - // suche die Id vom "Naechsten" Format - for( USHORT nNext=1; nNext < nArrLen; nNext++) - if( (*pDoc->GetTxtFmtColls())[ nNext ] == - &pColl->GetNextTxtFmtColl() ) - { - // die Ableitung vom Format - Strm() << OOO_STRING_SVTOOLS_RTF_SNEXT; - OutULong( nNext ); - break; - } - - //if( NO_NUMBERING != pColl->GetOutlineLevel() )//#outline level,zhaojianwei - if(pColl->IsAssignedToListLevelOfOutlineStyle())//<-end,zhaojianwei - { - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_SOUTLVL; - //OutULong( pColl->GetOutlineLevel() ) << '}';//#outline level,zhaojianwei - OutULong( pColl->GetAssignedOutlineStyleLevel() ) << '}';//<-end,zhaojianwei - } - - Strm() << ' '; - RTFOutFuncs::Out_String( Strm(), XlateFmtName( pColl->GetName(), nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL ), eDefaultEncoding, - bWriteHelpFmt ) << ";}" << SwRTFWriter::sNewLine; - } - - USHORT nChrArrLen = pDoc->GetCharFmts()->Count(); - for( n = 1; n < nChrArrLen; ++n ) - { - const SwCharFmt* pFmt = (*pDoc->GetCharFmts())[ n ]; - pAttrSet = &pFmt->GetAttrSet(); - - Strm() << '{'; - // gebe Attribute aus - OutRTF_SwFmt( *this, *pFmt ); - - if( pFmt->DerivedFrom() ) - // suche die Id vom "Parent" Format - for( USHORT nBasedOn=1; nBasedOn < nChrArrLen; nBasedOn++) - if( (*pDoc->GetCharFmts())[ nBasedOn ] == - pFmt->DerivedFrom() ) - { - // die Ableitung vom Format - Strm() << OOO_STRING_SVTOOLS_RTF_SBASEDON; - OutULong( nArrLen + nBasedOn ); - break; - } - - Strm() << ' '; - RTFOutFuncs::Out_String( Strm(), XlateFmtName( pFmt->GetName(), nsSwGetPoolIdFromName::GET_POOLID_CHRFMT ), eDefaultEncoding, - bWriteHelpFmt ) << ";}" << SwRTFWriter::sNewLine; - } - - Strm() << '}'; - bOutStyleTab = FALSE; -} - -bool ExportAsInline(const SwFlyFrmFmt& rFlyFrmFmt) -{ - //if not an inline element (hack in our limitations here as to only - //graphics like this!!!! - return rFlyFrmFmt.GetAnchor().GetAnchorId() == FLY_AS_CHAR; -} - -void SwRTFWriter::OutRTFFlyFrms(const SwFlyFrmFmt& rFlyFrmFmt) -{ - // ein FlyFrame wurde erkannt, gebe erstmal den aus - - // Hole vom Node und vom letzten Node die Position in der Section - const SwFmtCntnt& rFlyCntnt = rFlyFrmFmt.GetCntnt(); - - ULONG nStt = rFlyCntnt.GetCntntIdx()->GetIndex()+1; - ULONG nEnd = pDoc->GetNodes()[ nStt - 1 ]->EndOfSectionIndex(); - - if( nStt >= nEnd ) // kein Bereich, also kein gueltiger Node - return; - - if (!ExportAsInline(rFlyFrmFmt)) - Strm() << SwRTFWriter::sNewLine << OOO_STRING_SVTOOLS_RTF_PARD << OOO_STRING_SVTOOLS_RTF_PLAIN; - //If we are only exporting an inline graphic/object then we - //only need the its pFlyFmt for the duration of exporting it - //for floating objects its a little more complex at the moment - const SwFlyFrmFmt *pOldFlyFmt = pFlyFmt; - pFlyFmt = &rFlyFrmFmt; - - { - RTFSaveData aSaveData( *this, nStt, nEnd ); - Out_SwDoc( pCurPam ); - } - - if (!ExportAsInline(rFlyFrmFmt)) - Strm() << OOO_STRING_SVTOOLS_RTF_PARD << SwRTFWriter::sNewLine; -//#i46098#: else - pFlyFmt = pOldFlyFmt; -} - - - -void SwRTFWriter::OutRedline( xub_StrLen nCntntPos ) -{ - const SwRedline *pCurRedline = 0; - USHORT nCount = pDoc->GetRedlineTbl().Count(); - - if (nCurRedline < nCount) - { - pCurRedline = pDoc->GetRedlineTbl()[nCurRedline]; - if(pCurRedline) - { - const SwPosition* pStartPos = pCurRedline->Start(); - const SwPosition* pEndPos = pStartPos == pCurRedline->GetPoint() - ? pCurRedline->GetMark() - : pCurRedline->GetPoint(); - - USHORT nStart = pStartPos->nContent.GetIndex(); - USHORT nEnd = pEndPos->nContent.GetIndex(); - - ULONG nCurPam = pCurPam->GetPoint()->nNode.GetIndex(); - ULONG nStartIndex = pStartPos->nNode.GetIndex(); - ULONG nEndIndex = pEndPos->nNode.GetIndex(); - const String& rStr = pCurPam->GetNode()->GetTxtNode()->GetTxt(); - xub_StrLen nEnde = rStr.Len(); - - bool bSpanRedline = (nCurPam >= nStartIndex) && (nCurPam <= nEndIndex) && (nStartIndex != nEndIndex); - - if ((bSpanRedline && nCntntPos == 0) || - (nStartIndex == nCurPam && nStart == nCntntPos)) - { - // We are at the start of a redline just need to find out which type - Strm() << '{'; - if(pCurRedline->GetType() == nsRedlineType_t::REDLINE_INSERT) - { - Strm() << OOO_STRING_SVTOOLS_RTF_REVISED; - Strm() << OOO_STRING_SVTOOLS_RTF_REVAUTH; - String sName = SW_MOD()->GetRedlineAuthor(pCurRedline->GetAuthor()); - OutLong( pRedlAuthors->AddName(sName) ); - Strm() << OOO_STRING_SVTOOLS_RTF_REVDTTM; - OutLong( sw::ms::DateTime2DTTM(pCurRedline->GetTimeStamp()) ); - Strm() << ' '; - } - else if(pCurRedline->GetType() == nsRedlineType_t::REDLINE_DELETE) - { - Strm() << OOO_STRING_SVTOOLS_RTF_DELETED; - Strm() << OOO_STRING_SVTOOLS_RTF_REVAUTHDEL; - String sDelName = SW_MOD()->GetRedlineAuthor(pCurRedline->GetAuthor()); - OutLong( pRedlAuthors->AddName(sDelName) ); - Strm() << OOO_STRING_SVTOOLS_RTF_REVDTTMDEL; - OutLong( sw::ms::DateTime2DTTM(pCurRedline->GetTimeStamp()) ); - Strm() << ' '; - } - } - - // this is either then of the end of the node or the end of the redline - // time to close off this one - if( (bSpanRedline && nCntntPos == nEnde) || - (nEndIndex == nCurPam && nEnd == nCntntPos) ) - { - Strm() << '}'; - } - - // We have come to the end of a redline move to the next one - // and use resursion to see if another redline starts here - if (nEndIndex == nCurPam && nEnd == nCntntPos) - { - nCurRedline++; - OutRedline(nCntntPos); - } - } - } -} - -void SwRTFWriter::OutBookmarks( xub_StrLen nCntntPos) -{ - IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); - if (-1 == nBkmkTabPos) - return; - - const ::sw::mark::IMark* pBookmark = (pMarkAccess->getMarksBegin() + nBkmkTabPos)->get(); - if(!pBookmark) - return; - - const SwPosition* pStartPos = &pBookmark->GetMarkStart(); - const SwPosition* pEndPos = &pBookmark->GetMarkEnd(); - - ASSERT(pStartPos && pEndPos, "Impossible"); - if (!(pStartPos && pEndPos)) - return; - - if (pStartPos->nNode.GetIndex() == pCurPam->GetPoint()->nNode.GetIndex() && - pStartPos->nContent.GetIndex() == nCntntPos) - { - // zur Zeit umspannt das SwBookmark keinen Bereich also kann - // es hier vollstaendig ausgegeben werden. - - // erst die SWG spezifischen Daten: - const ::sw::mark::IBookmark* const pAsBookmark = dynamic_cast< const ::sw::mark::IBookmark* >(pBookmark); - if(pAsBookmark && (pAsBookmark->GetShortName().getLength() || pAsBookmark->GetKeyCode().GetCode())) - { - OutComment( *this, OOO_STRING_SVTOOLS_RTF_BKMKKEY ); - OutULong( ( pAsBookmark->GetKeyCode().GetCode() | - pAsBookmark->GetKeyCode().GetModifier() )); - if( !pAsBookmark->GetShortName().getLength() ) - Strm() << " " ; - else - { - Strm() << ' '; - OutRTF_AsByteString( *this, pAsBookmark->GetShortName(), eDefaultEncoding ); - } - Strm() << '}'; - } - OutComment( *this, OOO_STRING_SVTOOLS_RTF_BKMKSTART ) << ' '; - RTFOutFuncs::Out_String( Strm(), pBookmark->GetName(), - eDefaultEncoding, bWriteHelpFmt ) << '}'; - } - - if (pEndPos->nNode.GetIndex() == pCurPam->GetPoint()->nNode.GetIndex() && - pEndPos->nContent.GetIndex() == nCntntPos) - { - // zur Zeit umspannt das SwBookmark keinen Bereich also kann - // es hier vollstaendig ausgegeben werden. - - // erst die SWG spezifischen Daten: - const ::sw::mark::IBookmark* const pAsBookmark = dynamic_cast< const ::sw::mark::IBookmark* >(pBookmark); - if(pAsBookmark && (pAsBookmark->GetShortName().getLength() || pAsBookmark->GetKeyCode().GetCode())) - { - OutComment( *this, OOO_STRING_SVTOOLS_RTF_BKMKKEY ); - OutULong( ( pAsBookmark->GetKeyCode().GetCode() | - pAsBookmark->GetKeyCode().GetModifier() )); - if( !pAsBookmark->GetShortName().getLength() ) - Strm() << " " ; - else - { - Strm() << ' '; - OutRTF_AsByteString( *this, pAsBookmark->GetShortName(), eDefaultEncoding ); - } - Strm() << '}'; - } - OutComment( *this, OOO_STRING_SVTOOLS_RTF_BKMKEND ) << ' '; - - { - ::rtl::OUString aEmpty; - ::rtl::OUString & rBookmarkName = aEmpty; - - if (pAsBookmark) - rBookmarkName = pAsBookmark->GetName(); - - RTFOutFuncs::Out_String( Strm(), rBookmarkName, - eDefaultEncoding, bWriteHelpFmt ) << '}'; - } - - if(++nBkmkTabPos >= pMarkAccess->getMarksCount()) - nBkmkTabPos = -1; - else - pBookmark = (pMarkAccess->getMarksBegin() + nBkmkTabPos)->get(); - } -} - -void SwRTFWriter::OutFlyFrm() -{ - USHORT n; - - if( !pFlyPos ) - return; - - // gebe alle freifliegenden Rahmen die sich auf den akt. Absatz - // und evt. auf das aktuelle Zeichen beziehen, aus. - - // suche nach dem Anfang der FlyFrames - for( n = 0; n < pFlyPos->Count() && - (*pFlyPos)[n]->GetNdIndex().GetIndex() < - pCurPam->GetPoint()->nNode.GetIndex(); ++n ) - ; - if( n < pFlyPos->Count() ) - while( n < pFlyPos->Count() && - pCurPam->GetPoint()->nNode.GetIndex() == - (*pFlyPos)[n]->GetNdIndex().GetIndex() ) - { - // den Array-Iterator weiterschalten, damit nicht doppelt - // ausgegeben wird !! - OutRTFFlyFrms( (const SwFlyFrmFmt&)(*pFlyPos)[n++]->GetFmt() ); - } -} - - -USHORT SwRTFWriter::GetId( const Color& rColor ) const -{ - ASSERT( pColTbl, "Wo ist meine Color-Tabelle?" ); - for( USHORT n = 0; n < pColTbl->Count(); n++ ) - if( rColor == (*pColTbl)[ n ] ) - return n; - - ASSERT( FALSE, "Color nicht in der Tabelle" ); - return 0; -} - -USHORT SwRTFWriter::GetId( const SvxFontItem& rFont ) const -{ - const SfxItemPool& rPool = pDoc->GetAttrPool(); - const SvxFontItem* pFont = (const SvxFontItem*)GetDfltAttr( RES_CHRATR_FONT ); - if( rFont == *pFont ) - return 0; - - USHORT n = 1; - if( 0 != ( pFont = (const SvxFontItem*)rPool.GetPoolDefaultItem( - RES_CHRATR_FONT ))) - { - if( rFont == *pFont ) - return 1; - ++n; - } - - USHORT nMaxItem = rPool.GetItemCount( RES_CHRATR_FONT ); - for( USHORT nGet = 0; nGet < nMaxItem; ++nGet ) - if( 0 != (pFont = (const SvxFontItem*)rPool.GetItem( - RES_CHRATR_FONT, nGet )) ) - { - if( rFont == *pFont ) - return n; - ++n; - } - - ASSERT( FALSE, "Font nicht in der Tabelle" ); - return 0; -} - -USHORT SwRTFWriter::GetId( const Font& rFont ) const -{ - return GetId( SvxFontItem( rFont.GetFamily(), rFont.GetName(), - rFont.GetStyleName(), rFont.GetPitch(), - rFont.GetCharSet(), - RES_CHRATR_FONT ) ); -} - -USHORT SwRTFWriter::GetId( const SwTxtFmtColl& rColl ) const -{ - // suche das angegebene Format - const SvPtrarr & rArr = *pDoc->GetTxtFmtColls(); - for( USHORT n = 0; n < rArr.Count(); n++ ) - if( (SwTxtFmtColl*)rArr[ n ] == &rColl ) - return n; - ASSERT( FALSE, "TextCollection nicht in der Tabelle" ); - return 0; -} - -USHORT SwRTFWriter::GetId( const SwCharFmt& rFmt ) const -{ - // suche das angegebene Format - const SvPtrarr & rArr = *pDoc->GetCharFmts(); - for( USHORT n = 0; n < rArr.Count(); n++ ) - if( (SwCharFmt*)rArr[ n ] == &rFmt ) - return n + pDoc->GetTxtFmtColls()->Count(); - ASSERT( FALSE, "CharDFFormat nicht in der Tabelle" ); - return 0; -} - -void SwRTFWriter::OutPageDesc() -{ - // Ausgabe der Page-Descriptoren - USHORT nSize = pDoc->GetPageDescCnt(); - if( !nSize ) - return; - - Strm() << SwRTFWriter::sNewLine; // ein Trenner - bOutPageDesc = bOutPageDescTbl = TRUE; - OutComment( *this, OOO_STRING_SVTOOLS_RTF_PGDSCTBL ); - for( USHORT n = 0; n < nSize; ++n ) - { - const SwPageDesc& rPageDesc = - const_cast<const SwDoc*>(pDoc)->GetPageDesc( n ); - - Strm() << SwRTFWriter::sNewLine << '{' << OOO_STRING_SVTOOLS_RTF_PGDSC; - OutULong( n ) << OOO_STRING_SVTOOLS_RTF_PGDSCUSE; - OutULong( rPageDesc.ReadUseOn() ); - - OutRTFPageDescription( rPageDesc, FALSE, FALSE ); - - // suche den Folge-PageDescriptor: - USHORT i = nSize; - while( i ) - if( rPageDesc.GetFollow() == - &const_cast<const SwDoc *>(pDoc)->GetPageDesc( --i ) ) - break; - Strm() << OOO_STRING_SVTOOLS_RTF_PGDSCNXT; - OutULong( i ) << ' '; - RTFOutFuncs::Out_String( Strm(), XlateFmtName( rPageDesc.GetName(), nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC ), eDefaultEncoding, - bWriteHelpFmt ) << ";}"; - } - Strm() << '}' << SwRTFWriter::sNewLine; - bOutPageDesc = bOutPageDescTbl = FALSE; -} - -void SwRTFWriter::OutRTFBorder(const SvxBorderLine* aLine, const USHORT nSpace ) -{ - // M.M. This function writes out border lines in RTF similar to what - // WW8_BRC SwWW8Writer::TranslateBorderLine does in the winword filter - // Eventually it would be nice if all this functionality was in the one place - int nDistance = aLine->GetDistance(); - int nOutWidth = aLine->GetOutWidth(); - int nInWidth = aLine->GetInWidth(); - int nWidth = aLine->GetOutWidth(); - - if(nDistance == 0) // Single Line - Strm() << OOO_STRING_SVTOOLS_RTF_BRDRS; - else // Double Line - { - if(nOutWidth == nInWidth) - Strm() << OOO_STRING_SVTOOLS_RTF_BRDRDB; - else if (nOutWidth > nInWidth) - Strm() << OOO_STRING_SVTOOLS_RTF_BRDRTNTHSG; - else if (nOutWidth < nInWidth) - Strm() << OOO_STRING_SVTOOLS_RTF_BRDRTHTNSG; - } - Strm() << OOO_STRING_SVTOOLS_RTF_BRDRW; - OutULong(nWidth); - - Strm() << OOO_STRING_SVTOOLS_RTF_BRSP; - OutULong(nSpace); -} - -void SwRTFWriter::OutRTFBorders(SvxBoxItem aBox) -{ - const SvxBorderLine *pLine = aBox.GetTop(); - if(pLine) - { - Strm() << OOO_STRING_SVTOOLS_RTF_PGBRDRT; - OutRTFBorder(pLine, aBox.GetDistance(BOX_LINE_TOP)); - } - - pLine = aBox.GetBottom(); - if(pLine) - { - Strm() << OOO_STRING_SVTOOLS_RTF_PGBRDRB; - OutRTFBorder(pLine, aBox.GetDistance(BOX_LINE_BOTTOM)); - } - - pLine = aBox.GetRight(); - if(pLine) - { - Strm() << OOO_STRING_SVTOOLS_RTF_PGBRDRR; - OutRTFBorder(pLine, aBox.GetDistance(BOX_LINE_LEFT)); - } - - pLine = aBox.GetLeft(); - if(pLine) - { - Strm() << OOO_STRING_SVTOOLS_RTF_PGBRDRL; - OutRTFBorder(pLine, aBox.GetDistance(BOX_LINE_RIGHT)); - } -} - -void SwRTFWriter::OutRTFPageDescription( const SwPageDesc& rPgDsc, - BOOL bWriteReset, - BOOL bCheckForFirstPage ) -{ - // jetzt noch den Teil fuer alle anderen Applikationen: - const SwPageDesc *pSave = pAktPageDesc; - bool bOldOut = bOutPageDesc; - bool bOldHDFT = bOutLeftHeadFoot; - - // falls es einen Follow gibt, - pAktPageDesc = &rPgDsc; - if( bCheckForFirstPage && pAktPageDesc->GetFollow() && - pAktPageDesc->GetFollow() != pAktPageDesc ) - pAktPageDesc = pAktPageDesc->GetFollow(); - - bOutPageDesc = TRUE; - bOutLeftHeadFoot = FALSE; - - if( bWriteReset ) - { - if( bFirstLine && bWriteAll && - pCurPam->GetPoint()->nNode == pOrigPam->Start()->nNode ) - Strm() << OOO_STRING_SVTOOLS_RTF_SECTD << OOO_STRING_SVTOOLS_RTF_SBKNONE; - else - Strm() << OOO_STRING_SVTOOLS_RTF_SECT << OOO_STRING_SVTOOLS_RTF_SECTD; - } - - if( pAktPageDesc->GetLandscape() ) - Strm() << OOO_STRING_SVTOOLS_RTF_LNDSCPSXN; - - const SwFmt *pFmt = &pAktPageDesc->GetMaster(); //GetLeft(); - OutRTF_SwFmt( *this, *pFmt ); - - SvxBoxItem aBox = pFmt->GetAttrSet().GetBox(); - OutRTFBorders(pFmt->GetAttrSet().GetBox()); - - // falls es gesharte Heaer/Footer gibt, so gebe diese auch noch aus - if ( - (nsUseOnPage::PD_MIRROR & pAktPageDesc->GetUseOn()) && - (!pAktPageDesc->IsFooterShared() || !pAktPageDesc->IsHeaderShared()) - ) - { - bOutLeftHeadFoot = TRUE; - const SfxPoolItem* pHt; - if( !pAktPageDesc->IsHeaderShared() && - SFX_ITEM_SET == pAktPageDesc->GetLeft().GetAttrSet(). - GetItemState( RES_HEADER, FALSE, &pHt )) - OutRTF_SwFmtHeader( *this, *pHt ); - - if( !pAktPageDesc->IsFooterShared() && - SFX_ITEM_SET == pAktPageDesc->GetLeft().GetAttrSet(). - GetItemState( RES_FOOTER, FALSE, &pHt )) - OutRTF_SwFmtFooter( *this, *pHt ); - bOutLeftHeadFoot = FALSE; - } - - if( pAktPageDesc != &rPgDsc ) - { - pAktPageDesc = &rPgDsc; - Strm() << OOO_STRING_SVTOOLS_RTF_TITLEPG; - - // die Header/Footer der 1. Seite ausgeben - const SfxPoolItem* pHt; - if( SFX_ITEM_SET == pAktPageDesc->GetMaster().GetAttrSet(). - GetItemState( RES_HEADER, FALSE, &pHt )) - OutRTF_SwFmtHeader( *this, *pHt ); - - if( SFX_ITEM_SET == pAktPageDesc->GetMaster().GetAttrSet(). - GetItemState( RES_FOOTER, FALSE, &pHt )) - OutRTF_SwFmtFooter( *this, *pHt ); - } - - pAktPageDesc = pSave; - bOutPageDesc = bOldOut; - bOutLeftHeadFoot = bOldHDFT; -} - -BOOL SwRTFWriter::OutBreaks( const SfxItemSet& rSet ) -{ - // dann nie Seitenumbrueche ausgeben - BOOL bPgDscWrite = FALSE; - - if( !bOutOutlineOnly && bOutPageAttr && !bIgnoreNextPgBreak) - { - const SfxPoolItem *pItem; - if( SFX_ITEM_SET == rSet.GetItemState( RES_PAGEDESC, TRUE, &pItem ) - && ((SwFmtPageDesc*)pItem)->GetPageDesc() ) - { - const SwFmtPageDesc& rPgDsc = *(SwFmtPageDesc*)pItem; - for( USHORT nPos = pDoc->GetPageDescCnt(); nPos; ) - if( &const_cast<const SwDoc *>(pDoc) - ->GetPageDesc( --nPos ) == rPgDsc.GetPageDesc() ) - { - pAktPageDesc = ((SwFmtPageDesc*)pItem)->GetPageDesc(); - // FALSE wegen schliessender Klammer !! - OutComment( *this, OOO_STRING_SVTOOLS_RTF_PGDSCNO, FALSE ); - OutULong( nPos ) << '}'; - - // nicht weiter, in Styles gibts keine SectionControls !! - if( !bOutStyleTab ) - OutRTFPageDescription( *rPgDsc.GetPageDesc(), - TRUE, TRUE ); - bPgDscWrite = TRUE; - break; - } - } - else if( SFX_ITEM_SET == rSet.GetItemState( RES_BREAK, TRUE, &pItem ) ) - { - const SvxFmtBreakItem &rBreak = *(SvxFmtBreakItem*)pItem; - if( bWriteHelpFmt ) - { - if( SVX_BREAK_PAGE_BEFORE == rBreak.GetBreak() || - SVX_BREAK_PAGE_AFTER == rBreak.GetBreak() || - SVX_BREAK_PAGE_BOTH == rBreak.GetBreak() ) - { - bOutFmtAttr = true; - Strm() << OOO_STRING_SVTOOLS_RTF_PAGE; - } - } - else - { - switch( rBreak.GetBreak() ) - { - case SVX_BREAK_COLUMN_BEFORE: - case SVX_BREAK_COLUMN_AFTER: - case SVX_BREAK_COLUMN_BOTH: - break; - case SVX_BREAK_PAGE_BEFORE: - bOutFmtAttr = true; - Strm() << OOO_STRING_SVTOOLS_RTF_PAGE; - break; - case SVX_BREAK_PAGE_AFTER: - OutComment(*this, OOO_STRING_SVTOOLS_RTF_PGBRK, false) << "0}"; - break; - case SVX_BREAK_PAGE_BOTH: - OutComment(*this, OOO_STRING_SVTOOLS_RTF_PGBRK, false) << "1}"; - break; - default: - break; - } - } - } - } - bIgnoreNextPgBreak = false; - return bPgDscWrite; -} - - -void SwRTFWriter::CheckEndNodeForSection( const SwNode& rNd ) -{ - const SwSectionNode* pSectNd = rNd.StartOfSectionNode()->GetSectionNode(); - if( pSectNd /*&& CONTENT_SECTION == pSectNd->GetSection().GetType()*/ ) - { - const SwSectionFmt* pSectFmt = pSectNd->GetSection().GetFmt(); - - // diese Section hatte den akt. Abschnitt bestimmt - // wer bestimmt den nachsten?? - SwNodeIndex aIdx( rNd, 1 ); - pSectNd = aIdx.GetNode().GetSectionNode(); - if( !( ( pSectNd || (aIdx.GetNode().IsEndNode() && - 0 != ( pSectNd = aIdx.GetNode().StartOfSectionNode()->GetSectionNode() )) ) - /*&& CONTENT_SECTION == pSectNd->GetSection().GetType()*/ )) - { - // wer bestimmt denn nun den neuen Abschnitt? - // PageDesc oder eine uebergeordnete Section? - SwSection* pParent = pSectFmt->GetParentSection(); -// while( pParent /*&& CONTENT_SECTION != pParent->GetType()*/ ) -// pParent = pParent->GetParent(); - - if( pParent /*&& CONTENT_SECTION == pParent->GetType()*/ ) - OutRTF_SwSectionNode( *this, *pParent-> - GetFmt()->GetSectionNode( TRUE ) ); - else - { - if (! bOutPageDesc) - { - Strm() << OOO_STRING_SVTOOLS_RTF_SECT << OOO_STRING_SVTOOLS_RTF_SECTD << OOO_STRING_SVTOOLS_RTF_SBKNONE; - OutRTFPageDescription( ( pAktPageDesc - ? *pAktPageDesc - : const_cast<const SwDoc *>(pDoc) - ->GetPageDesc(0) ), - FALSE, TRUE ); - Strm() << SwRTFWriter::sNewLine; - } - } - } - // else - // weiter machen, der naechste definiert den neuen Abschnitt - } -} - -// Struktur speichert die aktuellen Daten des Writers zwischen, um -// einen anderen Dokument-Teil auszugeben, wie z.B. Header/Footer -RTFSaveData::RTFSaveData( SwRTFWriter& rWriter, ULONG nStt, ULONG nEnd ) - : rWrt( rWriter ), - pOldPam( rWrt.pCurPam ), pOldEnd( rWrt.GetEndPaM() ), - pOldFlyFmt( rWrt.pFlyFmt ), pOldPageDesc( rWrt.pAktPageDesc ), - pOldAttrSet( rWrt.GetAttrSet() ) -{ - bOldWriteAll = rWrt.bWriteAll; - bOldOutTable = rWrt.bOutTable; - bOldOutPageAttr = rWrt.bOutPageAttr; - bOldAutoAttrSet = rWrt.bAutoAttrSet; - bOldOutSection = rWrt.bOutSection; - - rWrt.pCurPam = rWrt.NewSwPaM( *rWrt.pDoc, nStt, nEnd ); - - // Tabelle in Sonderbereichen erkennen - if( nStt != rWrt.pCurPam->GetMark()->nNode.GetIndex() && - rWrt.pDoc->GetNodes()[ nStt ]->IsTableNode() ) - rWrt.pCurPam->GetMark()->nNode = nStt; - - rWrt.SetEndPaM( rWrt.pCurPam ); - rWrt.pCurPam->Exchange( ); - rWrt.bWriteAll = TRUE; - rWrt.bOutTable = FALSE; - rWrt.bOutPageAttr = FALSE; - rWrt.SetAttrSet( 0 ); - rWrt.bAutoAttrSet = FALSE; - rWrt.bOutSection = FALSE; -} - - -RTFSaveData::~RTFSaveData() -{ - delete rWrt.pCurPam; // Pam wieder loeschen - - rWrt.pCurPam = pOldPam; - rWrt.SetEndPaM( pOldEnd ); - rWrt.bWriteAll = bOldWriteAll; - rWrt.bOutTable = bOldOutTable; - rWrt.pFlyFmt = pOldFlyFmt; - rWrt.pAktPageDesc = pOldPageDesc; - rWrt.SetAttrSet( pOldAttrSet ); - rWrt.bAutoAttrSet = bOldAutoAttrSet; - rWrt.bOutPageAttr = bOldOutPageAttr; - rWrt.bOutSection = bOldOutSection; -} - -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL ExportRTF( const String& rFltName, const String& rBaseURL, WriterRef& xRet ) -{ - xRet = new SwRTFWriter( rFltName, rBaseURL ); -} - -short SwRTFWriter::GetCurrentPageDirection() const -{ - const SwFrmFmt &rFmt = pAktPageDesc - ? pAktPageDesc->GetMaster() - : const_cast<const SwDoc *>(pDoc) - ->GetPageDesc(0).GetMaster(); - const SvxFrameDirectionItem* pItem = &rFmt.GetFrmDir(); - - if (!pItem) - { - pItem = (const SvxFrameDirectionItem*) - &pDoc->GetAttrPool().GetDefaultItem(RES_FRAMEDIR); - } - return pItem->GetValue(); -} - -short SwRTFWriter::TrueFrameDirection(const SwFrmFmt &rFlyFmt) const -{ - const SwFrmFmt *pFlyFmt2 = &rFlyFmt; - const SvxFrameDirectionItem* pItem = 0; - while (pFlyFmt2) - { - pItem = &pFlyFmt2->GetFrmDir(); - if (FRMDIR_ENVIRONMENT == pItem->GetValue()) - { - pItem = 0; - const SwFmtAnchor* pAnchor = &pFlyFmt2->GetAnchor(); - if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && - pAnchor->GetCntntAnchor() ) - { - pFlyFmt2 = pAnchor->GetCntntAnchor()->nNode. - GetNode().GetFlyFmt(); - } - else - pFlyFmt2 = 0; - } - else - pFlyFmt2 = 0; - } - - short nRet; - if (pItem) - nRet = pItem->GetValue(); - else - nRet = GetCurrentPageDirection(); - - ASSERT(nRet != FRMDIR_ENVIRONMENT, "leaving with environment direction"); - return nRet; -} - -/* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/rtf/wrtrtf.hxx b/sw/source/filter/rtf/wrtrtf.hxx deleted file mode 100644 index 1c51a21dcf..0000000000 --- a/sw/source/filter/rtf/wrtrtf.hxx +++ /dev/null @@ -1,253 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _WRTRTF_HXX -#define _WRTRTF_HXX - -#include <shellio.hxx> -#include <wrt_fn.hxx> -#include "../inc/msfilter.hxx" - -#include <com/sun/star/util/DateTime.hpp> - -// einige Forward Deklarationen -class Color; -class Font; -class SvPtrarr; -class RTFColorTbl; -class SwFmt; -class SwFlyFrmFmt; -class SwPosFlyFrms; -class SwPageDesc; -class SwTableNode; -class SwTxtFmtColl; -class SwNumRule; -class SwNumRuleTbl; -class DateTime; -class RTFEndPosLst; -class SvxBorderLine; - -extern SwAttrFnTab aRTFAttrFnTab; -extern SwNodeFnTab aRTFNodeFnTab; - -// the default text encoding for the export, if it doesn't fit unicode will -// be used -#define DEF_ENCODING RTL_TEXTENCODING_ASCII_US - - -class RTF_WrtRedlineAuthor : public sw::util::WrtRedlineAuthor -{ - public: - virtual void Write(Writer &rWrt); -}; - -// der RTF-Writer - -class SwRTFWriter : public Writer -{ - friend class RTFEndPosLst; - - SvPtrarr* pFontRemoveLst; - RTFColorTbl* pColTbl; - SwPosFlyFrms* pFlyPos; // Pointer auf die aktuelle "FlyFrmTabelle" - RTFEndPosLst* pCurEndPosLst; - const SfxItemSet* pAttrSet; // akt. Format/Collection vom Node - // fuer den Zugriff auf einige Attribute - // z.B. Font-Size, LR-Space,.. - SwNumRuleTbl* pNumRuleTbl; // list of all exported numrules - RTF_WrtRedlineAuthor *pRedlAuthors; - - USHORT nAktFlyPos; // Index auf das naechste "FlyFrmFmt" - void OutRTFColorTab(); - void OutRTFFontTab(); - const rtl::OUString XlateFmtName( const rtl::OUString &rName, SwGetPoolIdFromName eFlags ); - void OutRTFStyleTab(); - void OutRTFListTab(); - bool OutRTFRevTab(); - - void MakeHeader(); - void OutUnicodeSafeRecord(const sal_Char *pToken, - const String &rContent); - void OutDocInfoStat(); - void OutInfoDateTime( const sal_Char*, - const ::com::sun::star::util::DateTime& ); - void CheckEndNodeForSection( const SwNode& rNd ); - - void BuildNumRuleTbl(); - - - -public: - // --- public Member -------------------------------------------------- - - USHORT nCurRedline; - - - const SwFlyFrmFmt* pFlyFmt; // liegt der Node in einem FlyFrame, - // ist das Format gesetzt, sonst 0 - const SwPageDesc* pAktPageDesc; // aktuell gesetzter PageDesc. - sal_Int32 nBkmkTabPos; // akt. Position in der Bookmark-Tabelle - USHORT nCurScript; // actual scripttype - rtl_TextEncoding eDefaultEncoding; - rtl_TextEncoding eCurrentEncoding; - -#if defined(UNX) - static const sal_Char sNewLine; // nur \012 oder \015 -#else - static const sal_Char __FAR_DATA sNewLine[]; // \015\012 -#endif - - - BOOL bFirstLine : 1; // wird die 1. Zeile ausgegeben ? - BOOL bOutFmtAttr : 1; // TRUE: beim Schreiben eines Formates - // existierte mindestens ein Attribut - BOOL bRTFFlySyntax : 1; // gebe nur original RTFSyntax aus - // (nur fuer die fliegenden Rahmen) - BOOL bOutPageDesc: 1; // gebe einen PageDescriptor aus - BOOL bOutPageDescTbl: 1; // gebe die PageDescriptor-Tabelle aus - BOOL bOutTable : 1; // gebe eine Tabelle aus - BOOL bTxtAttr : 1; // werden TextAttribute ausgegeben ? - BOOL bWriteHelpFmt : 1; // schreibe Win-RTF-HelpFileFmt - BOOL bOutStyleTab : 1; // gebe die StyleSheet-Tabelle aus - BOOL bOutPageAttr : 1; // PageDescAttribut ausgeben? - BOOL bAutoAttrSet : 1; // TRUE: pAttrSet ist harte Attributierung - // FALSE: pAttrSet ist vom Format/Collection - BOOL bOutOutlineOnly : 1; // TRUE: nur Gliederungs-Absaetze schreiben - BOOL bOutListNumTxt : 1; // TRUE: der ListNumText wird ausgegeben - BOOL bOutLeftHeadFoot : 1; // gebe vom PageDesc. den linkten - // Header/Footer aus - BOOL bOutSection : 1; // TRUE: Section PageDesc ausgeben - BOOL bIgnoreNextPgBreak : 1; // TRUE: naechsten PageDesc/Break ignorieren - BOOL bAssociated : 1; // use associated tokens - - BOOL bNonStandard : 1; // use non-standard tags (for cut and paste) - - // --- public Methoden ------------------------------------------------ - - SwRTFWriter( const String& rFilterName, const String& rBaseURL ); - virtual ~SwRTFWriter(); - virtual ULONG WriteStream(); - - void Out_SwDoc( SwPaM* ); // schreibe den makierten Bereich - - // gebe die evt. an der akt. Position stehenden FlyFrame aus. - void OutFlyFrm(); - void OutRTFFlyFrms( const SwFlyFrmFmt& ); - // gebe alle an der Position stehenden Bookmarks aus - void OutBookmarks( xub_StrLen nCntntPos ); - // gebe die PageDesc-Daten im normalen RTF-Format aus - void OutRTFPageDescription( const SwPageDesc&, BOOL , BOOL ); - void OutRTFBorders( SvxBoxItem aBox ); - void OutRTFBorder( const SvxBorderLine* aLine, const USHORT nSpace ); - BOOL OutBreaks( const SfxItemSet& rSet ); - void OutRedline( xub_StrLen nCntntPos ); - - // gebe die PageDescriptoren aus - USHORT GetId( const Color& ) const; - USHORT GetId( const SvxFontItem& ) const; - USHORT GetId( const Font& ) const; - USHORT GetId( const SwTxtFmtColl& ) const; - USHORT GetId( const SwCharFmt& ) const; - USHORT GetId( const SwNumRuleItem& rItem ) const; - - void OutPageDesc(); - - BOOL OutListNum( const SwTxtNode& rNd ); - USHORT GetNumRuleId( const SwNumRule& rRule ); - - // fuer RTFSaveData - SwPaM* GetEndPaM() { return pOrigPam; } - void SetEndPaM( SwPaM* pPam ) { pOrigPam = pPam; } - - const SfxPoolItem& GetItem( USHORT nWhich ) const; - - const SfxItemSet* GetAttrSet() const { return pAttrSet; } - void SetAttrSet( const SfxItemSet* p ) { pAttrSet = p; } - - const RTFEndPosLst* GetEndPosLst() const { return pCurEndPosLst; } - - void SetAssociatedFlag( BOOL b ) { bAssociated = b; } - BOOL IsAssociatedFlag() const { return bAssociated; } - - void SetCurrScriptType( USHORT n ) { nCurScript = n; } - USHORT GetCurrScriptType() const { return nCurScript; } - - short TrueFrameDirection(const SwFrmFmt &rFlyFmt) const; - short GetCurrentPageDirection() const; -}; - - -// Struktur speichert die aktuellen Daten des Writers zwischen, um -// einen anderen Dokument-Teil auszugeben, wie z.B. Header/Footer -// Mit den beiden USHORTs im CTOR wird ein neuer PaM erzeugt und auf -// die Position im Dokument gesetzt. -// Im Destructor werden alle Daten wieder restauriert und der angelegte -// Pam wieder geloescht. - -struct RTFSaveData -{ - SwRTFWriter& rWrt; - SwPaM* pOldPam, *pOldEnd; - const SwFlyFrmFmt* pOldFlyFmt; - const SwPageDesc* pOldPageDesc; - const SfxItemSet* pOldAttrSet; // akt. Attribute vom Node - - BOOL bOldWriteAll : 1; - BOOL bOldOutTable : 1; - BOOL bOldOutPageAttr : 1; - BOOL bOldAutoAttrSet : 1; - BOOL bOldOutSection : 1; - - RTFSaveData( SwRTFWriter&, ULONG nStt, ULONG nEnd ); - ~RTFSaveData(); -}; - - -// einige Funktions-Deklarationen -Writer& OutRTF_AsByteString( Writer& rWrt, const String& rStr, rtl_TextEncoding eEncoding); -Writer& OutRTF_SwFmt( Writer& rWrt, const SwFmt& ); -Writer& OutRTF_SwTblNode(Writer& , const SwTableNode&); -Writer& OutRTF_SwSectionNode( Writer& , SwSectionNode & ); - - -// Augabe von RTF-Bitmaps (steht im File "wrtpict.cxx") -//struct SvxRTFPictureType; -//class Bitmap; -//USHORT WriteRTFPict( const SwPictureType&, Bitmap&, SvStream& ); - -// Ausagbe von Footer-/Headers -Writer& OutRTF_SwFmtHeader( Writer& , const SfxPoolItem& ); -Writer& OutRTF_SwFmtFooter( Writer& , const SfxPoolItem& ); - -// Kommentar und zusaetzlichen String ausgeben -SvStream& OutComment( Writer& rWrt, const sal_Char* pStr ); - // zusaetzlich das bOutFmtAttr-Flag manipulieren -SvStream& OutComment( Writer& rWrt, const sal_Char* pStr, BOOL bSetFlag ); -bool ExportAsInline(const SwFlyFrmFmt& rFlyFrmFmt); - -#endif // _WRTRTF_HXX - - diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index 8e7f67997c..03c07448bd 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -487,9 +487,9 @@ void Writer::_AddFontItems( SfxItemPool& rPool, USHORT nW ) if( 0 != ( pFont = (const SvxFontItem*)rPool.GetPoolDefaultItem( nW )) ) _AddFontItem( rPool, *pFont ); - USHORT nMaxItem = rPool.GetItemCount( nW ); - for( USHORT nGet = 0; nGet < nMaxItem; ++nGet ) - if( 0 != (pFont = (const SvxFontItem*)rPool.GetItem( nW, nGet )) ) + sal_uInt32 nMaxItem = rPool.GetItemCount2( nW ); + for( sal_uInt32 nGet = 0; nGet < nMaxItem; ++nGet ) + if( 0 != (pFont = (const SvxFontItem*)rPool.GetItem2( nW, nGet )) ) _AddFontItem( rPool, *pFont ); } diff --git a/sw/source/filter/ww8/README-rtf.txt b/sw/source/filter/ww8/README-rtf.txt new file mode 100644 index 0000000000..2ae4872311 --- /dev/null +++ b/sw/source/filter/ww8/README-rtf.txt @@ -0,0 +1,227 @@ + +--------------------------------------------------------------------- + +Summary of new features in RtfExport + +--------------------------------------------------------------------- + +Miklos Vajna + +<vmiklos@frugalware.org> +--------------------------------------------------------------------- + +Table of Contents + +1. Introduction + + 1.1. Terminology + 1.2. General + +2. List if fixed bugs +3. List of new features + + 3.1. Nested tables + 3.2. Character properties + 3.3. Sections + 3.4. Graphics + 3.5. Bookmarks + 3.6. Fields + 3.7. Drawing + 3.8. Form fields + 3.9. OLE objects + +4. Changes in the source code outside RTF + + +--------------------------------------------------------------------- + +1. Introduction + +--------------------------------------------------------------------- + +The biggest difference is that the new exporter is an UNO component, +and it?s based on the MSWord base classes, the vision here is that +this way much less code can achieve the same set of features, +reducing the amount of duplicated code. + + +1.1. Terminology + +-------------- + + * The "MSO OK, OOo KO" and similar abbreviations describe if the + given new feature is supported by the OOo RTF importer or it can + be tested using Microsoft Office. + * RtfExport refers to the new UNO-based exporter, RtfWriter refers + to the old built-in one. + + +1.2. General + +-------------- + +RtfWriter sometimes created documents where the first { is closed in +the middle of the document. MSO ignores this problem, but OOo stops +parsing the rest of the document if this happens, in other words +everything after such a bug is ignored. This can be reproduced by for +example parprops.odt, but it?s triggered in several other cases as +well. RtfExport has no automatic prevention for this, either - but +during development I primarily test the output with OOo, so hopefully +the bug will pop up less frequently. + + +--------------------------------------------------------------------- + +2. List if fixed bugs + +--------------------------------------------------------------------- + + * http://www.openoffice.org/issues/show_bug.cgi?id=51469 postit + fields + * http://www.openoffice.org/issues/show_bug.cgi?id=66619 page + margins + * http://www.openoffice.org/issues/show_bug.cgi?id=69856 page + numbers + * http://www.openoffice.org/issues/show_bug.cgi?id=81569 { and } in + document title + * http://www.openoffice.org/issues/show_bug.cgi?id=84703 redlines + * http://www.openoffice.org/issues/show_bug.cgi?id=91166 russian + chars + * http://www.openoffice.org/issues/show_bug.cgi?id=92673 bookmarks + across tables + * http://www.openoffice.org/issues/show_bug.cgi?id=100507 ole + object export + * http://www.openoffice.org/issues/show_bug.cgi?id=103993 same as # + 81569 just for doc comments + * http://www.openoffice.org/issues/show_bug.cgi?id=106677 + listoverride index starts at zero + * http://www.openoffice.org/issues/show_bug.cgi?id=38344 enhanced + character space + + +--------------------------------------------------------------------- + +3. List of new features + +--------------------------------------------------------------------- + + +3.1. Nested tables + +-------------- + +This was new in Word2000 and it?s now supported by RtfExport (MSO OK, +OOo KO) + + +3.2. Character properties + +-------------- + +The followings are now supported: + + * blinking (MSO OK, OOo KO) + * expanded spacing (MSO OK, OOo OK) + * pair kerning (MSO OK, OOo OK) + + +3.3. Sections + +-------------- + +RtfExport writes: + + * column breaks (MSO OK, OOo OK) + * special breaks (when the next page should be an odd or an even + page; MSO OK, OOo KO) + * the write-protected property of sections is experted properly + (MSO OK, OOo KO) + * better page numbers (inherited type from page styles, restarts; + MSO OK, OOo KO) + * line numbering (MSO OK, OOo KO) + + +3.4. Graphics + +-------------- + +PNG graphics are exported in WMF format as well, so that not only MSO +and OOo can display graphics from the output document, but Wordpad as +well. + + +3.5. Bookmarks + +-------------- + +Implicit bookmarks like reference to a footnote did not work in OOo +(one got an Error: Reference source not found message when opening +the result), this now works as expected. (MSO OK - the importer +previously autocorrected this as well, OO OK) + + +3.6. Fields + +-------------- + + * Table of contents is now written as a field, so it?s properly + read-only (MSO OK, OOo KO) + * Postit comments are now exported. (MSO OK, OOo KO) + + +3.7. Drawing + +-------------- + +Drawing objects for Word 97 through Word 2007 (shapes) are now +implemented: + + * basic shapes (rectangle, ellipse, etc.) + * lines, including free-form ones + * texts, including vertical ones and their (paragraph and + character) formatting + +(MSO OK, OOo KO) + + +3.8. Form fields + +-------------- + +All types supported by the RTF format are exported, namely: + + * text boxes + * check boxes + * list boxes + +(MSO OK, OOo KO) + + +3.9. OLE objects + +-------------- + +Their result is exported as a picture - RtfWriter did not export +anything. (MSO OK, OOo OK) + +For math, the native data is written as well, so you can edit the +object, too. (MSO OK, OOo KO) + + +--------------------------------------------------------------------- + +4. Changes in the source code outside RTF + +--------------------------------------------------------------------- + +These are refactorings I needed for RTF. To my best knowledge they do +not change the output of other filters from a user?s point of view. + + * The code that splits runs according to bookmarks is moved from + DocxExport to MSWordExportBase + * WW8_SdrAttrIter has been refactored to MSWord_SdrAttrIter + * MSWordExportBase::SubstituteBullet can avoid replacing bullets + * wwFontHelper::InitFontTable can really load all fonts + * An obvious typo in WW8AttributeOutput::CharTwoLines has been + fixed + diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 8752ff2f3c..16fc06ec4f 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -116,131 +116,6 @@ bool DocxExport::CollapseScriptsforWordOk( USHORT nScript, USHORT nWhich ) return true; } -bool DocxExport::GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt, - xub_StrLen nEnd, IMarkVector& rArr ) -{ - IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); - ULONG nNd = rNd.GetIndex( ); - - const sal_Int32 nMarks = pMarkAccess->getMarksCount(); - for ( sal_Int32 i = 0; i < nMarks; i++ ) - { - IMark* pMark = ( pMarkAccess->getMarksBegin() + i )->get(); - - // Only keep the bookmarks starting or ending in this node - if ( pMark->GetMarkStart().nNode == nNd || - pMark->GetMarkEnd().nNode == nNd ) - { - xub_StrLen nBStart = pMark->GetMarkStart().nContent.GetIndex(); - xub_StrLen nBEnd = pMark->GetMarkEnd().nContent.GetIndex(); - - // Keep only the bookmars starting or ending in the snippet - bool bIsStartOk = ( nBStart >= nStt ) && ( nBStart <= nEnd ); - bool bIsEndOk = ( nBEnd >= nStt ) && ( nBEnd <= nEnd ); - - if ( bIsStartOk || bIsEndOk ) - rArr.push_back( pMark ); - } - } - return ( rArr.size() > 0 ); -} - -class CompareMarksEnd : public std::binary_function < const IMark *, const IMark *, bool > -{ -public: - inline bool operator() ( const IMark * pOneB, const IMark * pTwoB ) const - { - xub_StrLen nOEnd = pOneB->GetMarkEnd().nContent.GetIndex(); - xub_StrLen nTEnd = pTwoB->GetMarkEnd().nContent.GetIndex(); - - return nOEnd < nTEnd; - } -}; - -bool DocxExport::NearestBookmark( xub_StrLen& rNearest ) -{ - bool bHasBookmark = false; - - if ( m_rSortedMarksStart.size( ) > 0 ) - { - IMark* pMarkStart = m_rSortedMarksStart.front(); - rNearest = pMarkStart->GetMarkStart().nContent.GetIndex(); - bHasBookmark = true; - } - - if ( m_rSortedMarksEnd.size( ) > 0 ) - { - IMark* pMarkEnd = m_rSortedMarksEnd[0]; - if ( !bHasBookmark ) - rNearest = pMarkEnd->GetMarkEnd().nContent.GetIndex(); - else - rNearest = std::min( rNearest, pMarkEnd->GetMarkEnd().nContent.GetIndex() ); - bHasBookmark = true; - } - - return bHasBookmark; -} - -xub_StrLen DocxExport::GetNextPos( SwAttrIter* pAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos ) -{ - // Get the bookmarks for the normal run - xub_StrLen nNextPos = MSWordExportBase::GetNextPos( pAttrIter, rNode, nAktPos ); - - GetSortedBookmarks( rNode, nAktPos, nNextPos - nAktPos ); - - xub_StrLen nNextBookmark = nNextPos; - NearestBookmark( nNextPos ); - - return std::min( nNextPos, nNextBookmark ); -} - -void DocxExport::UpdatePosition( SwAttrIter* pAttrIter, xub_StrLen nAktPos, xub_StrLen nEnd ) -{ - xub_StrLen nNextPos; - - // either no bookmark, or it is not at the current position - if ( !NearestBookmark( nNextPos ) || nNextPos > nAktPos ) - { - MSWordExportBase::UpdatePosition( pAttrIter, nAktPos, nEnd ); - } -} - -void DocxExport::GetSortedBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen ) -{ - IMarkVector aMarksStart; - if ( GetBookmarks( rNode, nAktPos, nAktPos + nLen, aMarksStart ) ) - { - IMarkVector aSortedEnd; - IMarkVector aSortedStart; - for ( IMarkVector::const_iterator it = aMarksStart.begin(), end = aMarksStart.end(); - it < end; ++it ) - { - IMark* pMark = (*it); - - // Remove the positions egals to the current pos - xub_StrLen nStart = pMark->GetMarkStart().nContent.GetIndex(); - xub_StrLen nEnd = pMark->GetMarkEnd().nContent.GetIndex(); - - if ( nStart > nAktPos ) - aSortedStart.push_back( pMark ); - - if ( nEnd > nAktPos ) - aSortedEnd.push_back( pMark ); - } - - // Sort the bookmarks by end position - std::sort( aSortedEnd.begin(), aSortedEnd.end(), CompareMarksEnd() ); - - m_rSortedMarksStart.swap( aSortedStart ); - m_rSortedMarksEnd.swap( aSortedEnd ); - } - else - { - m_rSortedMarksStart.clear( ); - m_rSortedMarksEnd.clear( ); - } -} - void DocxExport::AppendBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen ) { std::vector< OUString > aStarts; diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx index 06d39a68d7..df385be268 100644 --- a/sw/source/filter/ww8/docxexport.hxx +++ b/sw/source/filter/ww8/docxexport.hxx @@ -76,11 +76,6 @@ class DocxExport : public MSWordExportBase /// Footer counter. sal_Int32 m_nFooters; - /// Used to split the runs according to the bookmarks start and ends - typedef std::vector< ::sw::mark::IMark* > IMarkVector; - IMarkVector m_rSortedMarksStart; - IMarkVector m_rSortedMarksEnd; - /// Exporter of the VML shapes. oox::vml::VMLExport *m_pVMLExport; @@ -162,24 +157,7 @@ protected: const SwFmtPageDesc* pNewPgDescFmt = 0, const SwPageDesc* pNewPgDesc = 0 ); - /// Get the next position in the text node to output - virtual xub_StrLen GetNextPos( SwAttrIter* pAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos ); - - /// Update the information for GetNextPos(). - virtual void UpdatePosition( SwAttrIter* pAttrIter, xub_StrLen nAktPos, xub_StrLen nEnd ); - private: - /// Find the nearest bookmark from the current position. - /// - /// Returns false when there is no bookmark. - bool NearestBookmark( xub_StrLen& rNearest ); - - void GetSortedBookmarks( const SwTxtNode& rNd, xub_StrLen nAktPos, - xub_StrLen nLen ); - - bool GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt, xub_StrLen nEnd, - IMarkVector& rArr ); - /// Setup pStyles and write styles.xml void InitStyles(); diff --git a/sw/source/filter/ww8/docxexportfilter.cxx b/sw/source/filter/ww8/docxexportfilter.cxx index 1fbbf83aa1..15acf1a691 100644 --- a/sw/source/filter/ww8/docxexportfilter.cxx +++ b/sw/source/filter/ww8/docxexportfilter.cxx @@ -26,6 +26,8 @@ ************************************************************************/ #include "docxexportfilter.hxx" +#include "rtfexportfilter.hxx" +#include "rtfimportfilter.hxx" #include "docxexport.hxx" #include <docsh.hxx> @@ -133,6 +135,7 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ ) { + OSL_TRACE("%s, pImplName is '%s'", OSL_THIS_FUNC, pImplName); uno::Reference< lang::XSingleServiceFactory > xFactory; void* pRet = 0; @@ -145,6 +148,22 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplN DocxExport_getImplementationName(), DocxExport_createInstance, DocxExport_getSupportedServiceNames() ) ); + } else if ( rtl_str_compare( pImplName, IMPL_NAME_RTFEXPORT ) == 0 ) { + const OUString aServiceName( OUString::createFromAscii( IMPL_NAME_RTFEXPORT ) ); + + xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory( + reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), + RtfExport_getImplementationName(), + RtfExport_createInstance, + RtfExport_getSupportedServiceNames() ) ); + } else if ( rtl_str_compare( pImplName, IMPL_NAME_RTFIMPORT ) == 0 ) { + const OUString aServiceName( OUString::createFromAscii( IMPL_NAME_RTFIMPORT ) ); + + xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory( + reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), + RtfImport_getImplementationName(), + RtfImport_createInstance, + RtfImport_getSupportedServiceNames() ) ); } if ( xFactory.is() ) diff --git a/sw/source/filter/ww8/makefile.mk b/sw/source/filter/ww8/makefile.mk index b25887e3e2..a1d12422f9 100644 --- a/sw/source/filter/ww8/makefile.mk +++ b/sw/source/filter/ww8/makefile.mk @@ -67,7 +67,12 @@ EXCEPTIONSFILES = \ $(SLO)$/WW8TableInfo.obj \ $(SLO)$/WW8FFData.obj \ $(SLO)$/WW8Sttbf.obj \ - $(SLO)$/WW8FibData.obj + $(SLO)$/WW8FibData.obj \ + $(SLO)$/rtfexportfilter.obj \ + $(SLO)$/rtfimportfilter.obj \ + $(SLO)$/rtfattributeoutput.obj \ + $(SLO)$/rtfsdrexport.obj \ + $(SLO)$/rtfexport.obj SLOFILES = \ @@ -96,7 +101,12 @@ SLOFILES = \ $(SLO)$/WW8TableInfo.obj \ $(SLO)$/WW8FFData.obj \ $(SLO)$/WW8Sttbf.obj \ - $(SLO)$/WW8FibData.obj + $(SLO)$/WW8FibData.obj \ + $(SLO)$/rtfexportfilter.obj \ + $(SLO)$/rtfimportfilter.obj \ + $(SLO)$/rtfattributeoutput.obj \ + $(SLO)$/rtfsdrexport.obj \ + $(SLO)$/rtfexport.obj # --- Tagets ------------------------------------------------------- diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx new file mode 100644 index 0000000000..09b2bbabcd --- /dev/null +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -0,0 +1,3447 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2010 Miklos Vajna. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "rtfattributeoutput.hxx" +#include "rtfexport.hxx" +#include "rtfsdrexport.hxx" +#include "writerwordglue.hxx" +#include "wrtww8.hxx" +#include "ww8par.hxx" +#include "fmtcntnt.hxx" +#include "fmtsrnd.hxx" +#include "fchrfmt.hxx" +#include "tgrditem.hxx" +#include "fmtruby.hxx" +#include "charfmt.hxx" +#include "breakit.hxx" + +#include <i18npool/mslangid.hxx> + +#include <hintids.hxx> + +#include <svl/poolitem.hxx> +#include <svtools/rtfkeywd.hxx> + +#include <editeng/fontitem.hxx> +#include <editeng/tstpitem.hxx> +#include <editeng/adjitem.hxx> +#include <editeng/spltitem.hxx> +#include <editeng/widwitem.hxx> +#include <editeng/lspcitem.hxx> +#include <editeng/keepitem.hxx> +#include <editeng/shaditem.hxx> +#include <editeng/brshitem.hxx> +#include <editeng/postitem.hxx> +#include <editeng/wghtitem.hxx> +#include <editeng/kernitem.hxx> +#include <editeng/crsditem.hxx> +#include <editeng/cmapitem.hxx> +#include <editeng/wrlmitem.hxx> +#include <editeng/udlnitem.hxx> +#include <editeng/langitem.hxx> +#include <editeng/escpitem.hxx> +#include <editeng/fhgtitem.hxx> +#include <editeng/colritem.hxx> +#include <editeng/hyznitem.hxx> +#include <editeng/brkitem.hxx> +#include <editeng/lrspitem.hxx> +#include <editeng/ulspitem.hxx> +#include <editeng/boxitem.hxx> +#include <editeng/cntritem.hxx> +#include <editeng/shdditem.hxx> +#include <editeng/akrnitem.hxx> +#include <editeng/pbinitem.hxx> +#include <editeng/emphitem.hxx> +#include <editeng/twolinesitem.hxx> +#include <editeng/charscaleitem.hxx> +#include <editeng/charrotateitem.hxx> +#include <editeng/charreliefitem.hxx> +#include <editeng/paravertalignitem.hxx> +#include <editeng/pgrditem.hxx> +#include <editeng/frmdiritem.hxx> +#include <editeng/blnkitem.hxx> +#include <editeng/charhiddenitem.hxx> +#include <svx/svdmodel.hxx> +#include <svx/svdobj.hxx> +#include <svx/fmglob.hxx> +#include <svx/svdouno.hxx> +#include <filter/msfilter/msoleexp.hxx> + +#include <docufld.hxx> +#include <flddropdown.hxx> +#include <format.hxx> +#include <fmtclds.hxx> +#include <fmtinfmt.hxx> +#include <fmtfld.hxx> +#include <fmtfsize.hxx> +#include <fmtftn.hxx> +#include <fmtrowsplt.hxx> +#include <fmtline.hxx> +#include <fmtanchr.hxx> +#include <frmfmt.hxx> +#include <frmatr.hxx> +#include <ftninfo.hxx> +#include <htmltbl.hxx> +#include <ndgrf.hxx> +#include <ndtxt.hxx> +#include <node.hxx> +#include <pagedesc.hxx> +#include <paratr.hxx> +#include <swmodule.hxx> +#include <swtable.hxx> +#include <txtftn.hxx> +#include <txtinet.hxx> +#include <numrule.hxx> +#include <grfatr.hxx> +#include <ndole.hxx> +#include <lineinfo.hxx> +#include <rtf.hxx> + +#include <rtl/strbuf.hxx> +#include <rtl/ustrbuf.hxx> +#include <rtl/ustring.hxx> + +#include <tools/color.hxx> + +#include <vcl/cvtgrf.hxx> + +#include <com/sun/star/i18n/ScriptType.hdl> +#include <com/sun/star/drawing/XShape.hpp> +#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/chart2/XChartDocument.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/container/XNamed.hpp> + +#include <osl/diagnose.h> + +using rtl::OString; +using rtl::OStringBuffer; +using rtl::OUString; +using rtl::OUStringBuffer; +using rtl::OUStringToOString; + +using namespace nsSwDocInfoSubType; +using namespace nsFieldFlags; +using namespace sw::util; +using namespace ::com::sun::star; + +static OString OutTBLBorderLine(RtfExport &rExport, const SvxBorderLine* pLine, const sal_Char* pStr) +{ + OStringBuffer aRet; + aRet.append(pStr); + if( pLine->GetInWidth() ) + { + // double line + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDB); + switch( pLine->GetInWidth() ) + { + case DEF_LINE_WIDTH_0: + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW "15"); + break; + case DEF_LINE_WIDTH_1: + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW "30"); + break; + case DEF_LINE_WIDTH_2: + case DEF_LINE_WIDTH_3: + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW "45"); + break; + } + } + else + { + // single line + if( DEF_LINE_WIDTH_1 >= pLine->GetOutWidth() ) + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRS OOO_STRING_SVTOOLS_RTF_BRDRW).append((sal_Int32)pLine->GetOutWidth()); + else + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTH OOO_STRING_SVTOOLS_RTF_BRDRW).append((sal_Int32)pLine->GetOutWidth() / 2); + } + + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRCF); + aRet.append((sal_Int32)rExport.GetColor(pLine->GetColor())); + return aRet.makeStringAndClear(); +} + +static OString OutBorderLine(RtfExport &rExport, const SvxBorderLine* pLine, + const sal_Char* pStr, USHORT nDist) +{ + OStringBuffer aRet; + aRet.append(OutTBLBorderLine(rExport, pLine, pStr)); + aRet.append(OOO_STRING_SVTOOLS_RTF_BRSP); + aRet.append((sal_Int32)nDist); + return aRet.makeStringAndClear(); +} + +static OString OutBorderLine( RtfExport &rExport, const SvxBorderLine* pLine, + const char* pStr ) +{ + OStringBuffer aRet; + aRet.append(pStr); + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDLNCOL); + aRet.append((sal_Int32)rExport.GetColor( pLine->GetColor() ) ); + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDLNIN); + aRet.append((sal_Int32)pLine->GetInWidth()); + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDLNOUT); + aRet.append((sal_Int32)pLine->GetOutWidth()); + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDLNDIST); + aRet.append((sal_Int32)pLine->GetDistance()); + return aRet.makeStringAndClear(); +} + +void RtfAttributeOutput::RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + /* + You would have thought that + m_rExport.Strm() << (bIsRTL ? OOO_STRING_SVTOOLS_RTF_RTLCH : OOO_STRING_SVTOOLS_RTF_LTRCH); would be sufficent here , + but looks like word needs to see the other directional token to be + satisified that all is kosher, otherwise it seems in ver 2003 to go and + semi-randomlyly stick strike through about the place. Perhaps + strikethrough is some ms developers "something is wrong signal" debugging + code that we're triggering ? + */ + if (bIsRTL) { + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LTRCH); + m_aStylesEnd.append(' '); + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_RTLCH); + } else { + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_RTLCH); + m_aStylesEnd.append(' '); + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LTRCH); + } + + switch (nScript) { + case i18n::ScriptType::LATIN: + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LOCH); + break; + case i18n::ScriptType::ASIAN: + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_DBCH); + break; + case i18n::ScriptType::COMPLEX: + /* noop */ + break; + default: + /* should not happen? */ + break; + } +} + +void RtfAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // Output table/table row/table cell starts if needed + if ( pTextNodeInfo.get() ) + { + sal_uInt32 nRow = pTextNodeInfo->getRow(); + sal_uInt32 nCell = pTextNodeInfo->getCell(); + + // New cell/row? + if ( m_nTableDepth > 0 && !m_bTableCellOpen ) + { + ww8::WW8TableNodeInfoInner::Pointer_t pDeepInner( pTextNodeInfo->getInnerForDepth( m_nTableDepth ) ); + OSL_ENSURE( pDeepInner, "TableNodeInfoInner not found"); + if ( pDeepInner && pDeepInner->getCell() == 0 ) + StartTableRow( pDeepInner ); + + StartTableCell( pDeepInner ); + } + + if ( nRow == 0 && nCell == 0 ) + { + // Do we have to start the table? + // [If we are at the rigth depth already, it means that we + // continue the table cell] + sal_uInt32 nCurrentDepth = pTextNodeInfo->getDepth(); + + if ( nCurrentDepth > m_nTableDepth ) + { + // Start all the tables that begin here + for ( sal_uInt32 nDepth = m_nTableDepth + 1; nDepth <= pTextNodeInfo->getDepth(); ++nDepth ) + { + ww8::WW8TableNodeInfoInner::Pointer_t pInner( pTextNodeInfo->getInnerForDepth( nDepth ) ); + + m_bLastTable = (nDepth == pTextNodeInfo->getDepth()); + StartTable( pInner ); + StartTableRow( pInner ); + StartTableCell( pInner ); + } + + m_nTableDepth = nCurrentDepth; + } + } + } + + OSL_ENSURE(m_aRun.getLength() == 0, "m_aRun is not empty"); +} + +void RtfAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + FinishTableRowCell( pTextNodeInfoInner ); + + OStringBuffer aParagraph; + + aParagraph.append(m_aRun.makeStringAndClear()); + aParagraph.append(m_aAfterRuns.makeStringAndClear()); + if (m_bTblAfterCell) + m_bTblAfterCell = false; + else + { + aParagraph.append(m_rExport.sNewLine); + aParagraph.append(OOO_STRING_SVTOOLS_RTF_PAR); + aParagraph.append(' '); + } + if (m_nColBreakNeeded) + { + aParagraph.append(OOO_STRING_SVTOOLS_RTF_COLUMN); + m_nColBreakNeeded = false; + } + + if (!m_bBufferSectionHeaders) + m_rExport.Strm() << aParagraph.makeStringAndClear(); + else + m_aSectionHeaders.append(aParagraph.makeStringAndClear()); +} + +void RtfAttributeOutput::EmptyParagraph() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << m_rExport.sNewLine << OOO_STRING_SVTOOLS_RTF_PAR << ' '; +} + +void RtfAttributeOutput::StartParagraphProperties( const SwTxtNode& rNode ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + OSL_ENSURE(m_aStyles.getLength() == 0, "m_aStyles is not empty"); + + // output page/section breaks + SwNodeIndex aNextIndex( rNode, 1 ); + m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear(); + m_bBufferSectionBreaks = true; + + // output section headers / footers + if (!m_bBufferSectionHeaders) + m_rExport.Strm() << m_aSectionHeaders.makeStringAndClear(); + + if ( aNextIndex.GetNode().IsTxtNode() ) + { + const SwTxtNode* pTxtNode = static_cast< SwTxtNode* >( &aNextIndex.GetNode() ); + m_rExport.OutputSectionBreaks( pTxtNode->GetpSwAttrSet(), *pTxtNode ); + } + else if ( aNextIndex.GetNode().IsTableNode() ) + { + const SwTableNode* pTableNode = static_cast< SwTableNode* >( &aNextIndex.GetNode() ); + const SwFrmFmt *pFmt = pTableNode->GetTable().GetFrmFmt(); + m_rExport.OutputSectionBreaks( &(pFmt->GetAttrSet()), *pTableNode ); + } + m_bBufferSectionBreaks = false; + + OStringBuffer aPar; + if (!m_rExport.bRTFFlySyntax) + { + aPar.append(OOO_STRING_SVTOOLS_RTF_PARD); + aPar.append(OOO_STRING_SVTOOLS_RTF_PLAIN); + aPar.append(' '); + } + if (!m_bBufferSectionHeaders) + m_rExport.Strm() << aPar.makeStringAndClear(); + else + m_aSectionHeaders.append(aPar.makeStringAndClear()); +} + +void RtfAttributeOutput::EndParagraphProperties() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + m_aStyles.append(m_aStylesEnd.makeStringAndClear()); + m_rExport.Strm() << m_aStyles.makeStringAndClear(); +} + +void RtfAttributeOutput::StartRun( const SwRedlineData* pRedlineData ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aRun.append('{'); + + // if there is some redlining in the document, output it + Redline( pRedlineData ); + + OSL_ENSURE(m_aRunText.getLength() == 0, "m_aRunText is not empty"); +} + +void RtfAttributeOutput::EndRun() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + m_aRun.append(m_rExport.sNewLine); + m_aRun.append(m_aRunText.makeStringAndClear()); + m_aRun.append('}'); +} + +void RtfAttributeOutput::StartRunProperties() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + OSL_ENSURE(m_aStyles.getLength() == 0, "m_aStyles is not empty"); +} + +void RtfAttributeOutput::EndRunProperties( const SwRedlineData* /*pRedlineData*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + m_aStyles.append(m_aStylesEnd.makeStringAndClear()); + m_aRun.append(m_aStyles.makeStringAndClear()); +} + +void RtfAttributeOutput::RunText( const String& rText, rtl_TextEncoding eCharSet ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + RawText( rText, 0, eCharSet ); +} + +OStringBuffer& RtfAttributeOutput::RunText() +{ + return m_aRunText; +} + +OStringBuffer& RtfAttributeOutput::Styles() +{ + return m_aStyles; +} + +void RtfAttributeOutput::RawText( const String& rText, bool /*bForceUnicode*/, rtl_TextEncoding eCharSet ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + m_aRunText.append(m_rExport.OutString(rText, eCharSet)); +} + +void RtfAttributeOutput::StartRuby( const SwTxtNode& /*rNode*/, const SwFmtRuby& /*rRuby*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::EndRuby() +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +bool RtfAttributeOutput::StartURL( const String& rUrl, const String& rTarget ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append('{'); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_FIELD); + m_aStyles.append('{'); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_IGNORE); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_FLDINST); + m_aStyles.append(" HYPERLINK "); + + String sURL( rUrl ); + if( sURL.Len() ) + { + m_aStyles.append("\""); + m_aStyles.append(m_rExport.OutString( sURL, m_rExport.eCurrentEncoding)); + m_aStyles.append("\" "); + } + + if( rTarget.Len() ) + { + m_aStyles.append("\\\\t \""); + m_aStyles.append(m_rExport.OutString( rTarget, m_rExport.eCurrentEncoding)); + m_aStyles.append("\" "); + } + + m_aStyles.append("}"); + return true; +} + +bool RtfAttributeOutput::EndURL() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // close the fldrslt group + m_aRunText.append('}'); + // close the field group + m_aRunText.append('}'); + return true; +} + +void RtfAttributeOutput::FieldVanish( const String& /*rTxt*/, ww::eField /*eType*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::Redline( const SwRedlineData* pRedline ) +{ + if (!pRedline) + return; + + OSL_TRACE("%s", OSL_THIS_FUNC); + + if (pRedline->GetType() == nsRedlineType_t::REDLINE_INSERT) + { + m_aRun.append(OOO_STRING_SVTOOLS_RTF_REVISED); + m_aRun.append(OOO_STRING_SVTOOLS_RTF_REVAUTH); + m_aRun.append((sal_Int32)m_rExport.GetRedline(SW_MOD()->GetRedlineAuthor(pRedline->GetAuthor()))); + m_aRun.append(OOO_STRING_SVTOOLS_RTF_REVDTTM); + } + else if(pRedline->GetType() == nsRedlineType_t::REDLINE_DELETE) + { + m_aRun.append(OOO_STRING_SVTOOLS_RTF_DELETED); + m_aRun.append(OOO_STRING_SVTOOLS_RTF_REVAUTHDEL); + m_aRun.append((sal_Int32)m_rExport.GetRedline(SW_MOD()->GetRedlineAuthor(pRedline->GetAuthor()))); + m_aRun.append(OOO_STRING_SVTOOLS_RTF_REVDTTMDEL); + } + m_aRun.append((sal_Int32)sw::ms::DateTime2DTTM(pRedline->GetTimeStamp())); + m_aRun.append(' '); +} + +void RtfAttributeOutput::FormatDrop( const SwTxtNode& /*rNode*/, const SwFmtDrop& /*rSwFmtDrop*/, USHORT /*nStyle*/, ww8::WW8TableNodeInfo::Pointer_t /*pTextNodeInfo*/, ww8::WW8TableNodeInfoInner::Pointer_t /*pTextNodeInfoInner*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::ParagraphStyle( USHORT nStyle ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + OString *pStyle = m_rExport.GetStyle(nStyle); + OStringBuffer aStyle; + aStyle.append(OOO_STRING_SVTOOLS_RTF_S); + aStyle.append((sal_Int32)nStyle); + if (pStyle) + aStyle.append(pStyle->getStr()); + if (!m_bBufferSectionHeaders) + m_rExport.Strm() << aStyle.makeStringAndClear(); + else + m_aSectionHeaders.append(aStyle.makeStringAndClear()); +} + +void RtfAttributeOutput::TableInfoCell( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_INTBL); + if ( m_nTableDepth > 1 ) + { + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ITAP); + m_aStyles.append((sal_Int32)m_nTableDepth); + } + m_bWroteCellInfo = true; +} + +void RtfAttributeOutput::TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfo*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* noop */ +} + +void RtfAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( !m_pTableWrt ) + InitTableHelper( pTableTextNodeInfoInner ); + + const SwTableBox *pTblBox = pTableTextNodeInfoInner->getTableBox( ); + SwFrmFmt *pFmt = pTblBox->GetFrmFmt( ); + + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_TROWD); + TableOrientation( pTableTextNodeInfoInner ); + TableBidi( pTableTextNodeInfoInner ); + TableHeight( pTableTextNodeInfoInner ); + TableCanSplit( pTableTextNodeInfoInner ); + + // Cell margins + const SvxBoxItem& rBox = pFmt->GetBox( ); + static const USHORT aBorders[] = + { + BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT + }; + + static const char* aRowPadNames[] = + { + OOO_STRING_SVTOOLS_RTF_TRPADDT, OOO_STRING_SVTOOLS_RTF_TRPADDL, OOO_STRING_SVTOOLS_RTF_TRPADDB, OOO_STRING_SVTOOLS_RTF_TRPADDR + }; + + static const char* aRowPadUnits[] = + { + OOO_STRING_SVTOOLS_RTF_TRPADDFT, OOO_STRING_SVTOOLS_RTF_TRPADDFL, OOO_STRING_SVTOOLS_RTF_TRPADDFB, OOO_STRING_SVTOOLS_RTF_TRPADDFR + }; + + for (int i = 0; i < 4; ++i) + { + m_aRowDefs.append(aRowPadUnits[i]); + m_aRowDefs.append((sal_Int32)3); + m_aRowDefs.append(aRowPadNames[i]); + m_aRowDefs.append((sal_Int32)rBox.GetDistance(aBorders[i])); + } + + // The cell-dependent properties + const SwWriteTableRows& aRows = m_pTableWrt->GetRows( ); + SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ]; + SwTwips nSz = 0; + Point aPt; + SwRect aRect( pFmt->FindLayoutRect( false, &aPt )); + SwTwips nPageSize = aRect.Width(); + SwTwips nTblSz = pFmt->GetFrmSize().GetWidth(); + for( USHORT i = 0; i < pRow->GetCells().Count(); i++ ) + { + SwWriteTableCell *pCell = pRow->GetCells( )[ i ]; + const SwFrmFmt *pCellFmt = pCell->GetBox()->GetFrmFmt(); + + pTableTextNodeInfoInner->setCell( i ); + TableCellProperties(pTableTextNodeInfoInner); + + // Right boundary: this can't be in TableCellProperties as the old + // value of nSz is needed. + nSz += pCellFmt->GetFrmSize().GetWidth(); + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CELLX); + SwTwips nCalc = nSz; + nCalc *= nPageSize; + nCalc /= nTblSz; + m_aRowDefs.append( (sal_Int32)(pFmt->GetLRSpace().GetLeft() + nCalc) ); + } +} + +void RtfAttributeOutput::TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* + * The function name is a bit misleading: given that we write borders + * before each row, we just have borders, not default ones. Additionally, + * this function actually writes borders for a specific cell only and is + * called for each cell. + */ + + const SwTableBox *pTblBox = pTableTextNodeInfoInner->getTableBox( ); + SwFrmFmt *pFmt = pTblBox->GetFrmFmt( ); + const SvxBoxItem& rDefault = pFmt->GetBox( ); + const SwWriteTableRows& aRows = m_pTableWrt->GetRows( ); + SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ]; + SwWriteTableCell *pCell = pRow->GetCells( )[ pTableTextNodeInfoInner->getCell( ) ]; + const SwFrmFmt *pCellFmt = pCell->GetBox()->GetFrmFmt(); + const SfxPoolItem* pItem; + if (SFX_ITEM_SET == pCellFmt->GetAttrSet().GetItemState(RES_BOX, TRUE, &pItem)) + { + const SvxBoxItem& rBox = (SvxBoxItem&)*pItem; + static const USHORT aBorders[] = + { + BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT + }; + static const char* aBorderNames[] = + { + OOO_STRING_SVTOOLS_RTF_CLBRDRT, OOO_STRING_SVTOOLS_RTF_CLBRDRL, OOO_STRING_SVTOOLS_RTF_CLBRDRB, OOO_STRING_SVTOOLS_RTF_CLBRDRR + }; + //Yes left and top are swapped with eachother for cell padding! Because + //that's what the thunderingly annoying rtf export/import word xp does. + static const char* aCellPadNames[] = + { + OOO_STRING_SVTOOLS_RTF_CLPADL, OOO_STRING_SVTOOLS_RTF_CLPADT, OOO_STRING_SVTOOLS_RTF_CLPADB, OOO_STRING_SVTOOLS_RTF_CLPADR + }; + static const char* aCellPadUnits[] = + { + OOO_STRING_SVTOOLS_RTF_CLPADFL, OOO_STRING_SVTOOLS_RTF_CLPADFT, OOO_STRING_SVTOOLS_RTF_CLPADFB, OOO_STRING_SVTOOLS_RTF_CLPADFR + }; + for (int i = 0; i < 4; ++i) + { + if (const SvxBorderLine* pLn = rBox.GetLine(aBorders[i])) + m_aRowDefs.append(OutTBLBorderLine(m_rExport, pLn, aBorderNames[i])); + if (rDefault.GetDistance(aBorders[i]) != + rBox.GetDistance(aBorders[i])) + { + m_aRowDefs.append(aCellPadUnits[i]); + m_aRowDefs.append((sal_Int32)3); + m_aRowDefs.append(aCellPadNames[i]); + m_aRowDefs.append((sal_Int32)rBox.GetDistance(aBorders[i])); + } + } + } +} + +void RtfAttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SwWriteTableRows& aRows = m_pTableWrt->GetRows( ); + SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ]; + SwWriteTableCell *pCell = pRow->GetCells( )[ pTableTextNodeInfoInner->getCell( ) ]; + const SwFrmFmt *pCellFmt = pCell->GetBox()->GetFrmFmt(); + const SfxPoolItem* pItem; + if( SFX_ITEM_SET == pCellFmt->GetAttrSet().GetItemState( + RES_BACKGROUND, TRUE, &pItem )) + { + const SvxBrushItem& rBack = (SvxBrushItem&)*pItem; + if( !rBack.GetColor().GetTransparency() ) + { + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLCBPAT); + m_aRowDefs.append((sal_Int32)m_rExport.GetColor(rBack.GetColor())); + } + } +} + +void RtfAttributeOutput::TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox(); + const SwTableLine * pTabLine = pTabBox->GetUpper(); + const SwFrmFmt * pLineFmt = pTabLine->GetFrmFmt(); + const SwFmtFrmSize& rLSz = pLineFmt->GetFrmSize(); + + if ( ATT_VAR_SIZE != rLSz.GetHeightSizeType() && rLSz.GetHeight() ) + { + sal_Int32 nHeight = 0; + + switch ( rLSz.GetHeightSizeType() ) + { + case ATT_FIX_SIZE: nHeight = -rLSz.GetHeight(); break; + case ATT_MIN_SIZE: nHeight = rLSz.GetHeight(); break; + default: break; + } + + if ( nHeight ) + { + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_TRRH); + m_aRowDefs.append(nHeight); + } + } +} + +void RtfAttributeOutput::TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox(); + const SwTableLine * pTabLine = pTabBox->GetUpper(); + const SwFrmFmt * pLineFmt = pTabLine->GetFrmFmt(); + const SwFmtRowSplit& rSplittable = pLineFmt->GetRowSplit( ); + + // The rtf default is to allow a row to break + if (rSplittable.GetValue() == 0) + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_TRKEEP); +} + +void RtfAttributeOutput::TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SwTable * pTable = pTableTextNodeInfoInner->getTable(); + const SwFrmFmt * pFrmFmt = pTable->GetFrmFmt(); + + if ( m_rExport.TrueFrameDirection( *pFrmFmt ) != FRMDIR_HORI_RIGHT_TOP ) + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_LTRROW); + else + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_RTLROW); +} + +void RtfAttributeOutput::TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SwWriteTableRows& aRows = m_pTableWrt->GetRows( ); + SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ]; + SwWriteTableCell *pCell = pRow->GetCells( )[ pTableTextNodeInfoInner->getCell( ) ]; + const SwFrmFmt *pCellFmt = pCell->GetBox()->GetFrmFmt(); + const SfxPoolItem* pItem; + + // vertical merges + if (pCell->GetRowSpan() > 1) + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVMGF); + else if (pCell->GetRowSpan() == 0) + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVMRG); + + // vertical alignment + if( SFX_ITEM_SET == pCellFmt->GetAttrSet().GetItemState( + RES_VERT_ORIENT, TRUE, &pItem ) ) + switch( ((SwFmtVertOrient*)pItem)->GetVertOrient() ) + { + case text::VertOrientation::CENTER: m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALC); break; + case text::VertOrientation::BOTTOM: m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALB); break; + default: m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALT); break; + } +} + +void RtfAttributeOutput::TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t /*pNodeInfo*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* noop */ +} + +void RtfAttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // This is called when the nested table ends in a cell, and there's no + // paragraph benhind that; so we must check for the ends of cell, rows, + // and tables + // ['true' to write an empty paragraph, MS Word insists on that] + FinishTableRowCell( pNodeInfoInner, true ); +} + +void RtfAttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SwTable *pTable = pTableTextNodeInfoInner->getTable(); + SwFrmFmt *pFmt = pTable->GetFrmFmt( ); + + OStringBuffer aTblAdjust( OOO_STRING_SVTOOLS_RTF_TRQL ); + switch (pFmt->GetHoriOrient().GetHoriOrient()) + { + case text::HoriOrientation::CENTER: + aTblAdjust.setLength(0); + aTblAdjust.append(OOO_STRING_SVTOOLS_RTF_TRQC); + break; + case text::HoriOrientation::RIGHT: + aTblAdjust.setLength(0); + aTblAdjust.append(OOO_STRING_SVTOOLS_RTF_TRQR); + break; + case text::HoriOrientation::NONE: + case text::HoriOrientation::LEFT_AND_WIDTH: + aTblAdjust.append(OOO_STRING_SVTOOLS_RTF_TRLEFT); + aTblAdjust.append((sal_Int32)pFmt->GetLRSpace().GetLeft()); + break; + default: + break; + } + + m_aRowDefs.append(aTblAdjust.makeStringAndClear()); +} + +void RtfAttributeOutput::TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::TableRowEnd( sal_uInt32 /*nDepth*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* noop, see EndTableRow() */ +} + +/* + * Our private table methods. + */ + +void RtfAttributeOutput::InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + sal_uInt32 nPageSize = 0; + bool bRelBoxSize = false; + + // Create the SwWriteTable instance to use col spans + GetTablePageSize( pTableTextNodeInfoInner.get(), nPageSize, bRelBoxSize ); + + const SwTable* pTable = pTableTextNodeInfoInner->getTable( ); + const SwFrmFmt *pFmt = pTable->GetFrmFmt( ); + SwTwips nTblSz = pFmt->GetFrmSize( ).GetWidth( ); + + const SwHTMLTableLayout *pLayout = pTable->GetHTMLTableLayout(); + if( pLayout && pLayout->IsExportable() ) + m_pTableWrt = new SwWriteTable( pLayout ); + else + m_pTableWrt = new SwWriteTable( pTable->GetTabLines(), (USHORT)nPageSize, + (USHORT)nTblSz, false); +} + +void RtfAttributeOutput::StartTable( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // To trigger calling InitTableHelper() + delete m_pTableWrt, m_pTableWrt = NULL; +} + +void RtfAttributeOutput::StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + sal_uInt32 nCurrentDepth = pTableTextNodeInfoInner->getDepth(); + OSL_TRACE("%s, (depth is %d)", OSL_THIS_FUNC, (int)nCurrentDepth); + + TableDefinition(pTableTextNodeInfoInner); + + if (!m_bLastTable) + m_aTables.push_back(m_aRowDefs.makeStringAndClear()); + + // We'll write the table definition for nested tables later + if ( nCurrentDepth > 1 ) + return; + m_rExport.Strm() << m_aRowDefs.makeStringAndClear(); +} + +void RtfAttributeOutput::StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_bTableCellOpen = true; +} + +void RtfAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + TableDefaultBorders(pTableTextNodeInfoInner); + TableBackgrounds(pTableTextNodeInfoInner); + TableVerticalCell(pTableTextNodeInfoInner); +} + +void RtfAttributeOutput::EndTableCell( ) +{ + OSL_TRACE("%s, (depth is %d)", OSL_THIS_FUNC, (int)m_nTableDepth); + + if (!m_bWroteCellInfo) + { + m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_INTBL); + m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_ITAP); + m_aAfterRuns.append((sal_Int32)m_nTableDepth); + } + if ( m_nTableDepth > 1 ) + m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_NESTCELL); + else + m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_CELL); + + m_bTableCellOpen = false; + m_bTblAfterCell = true; + m_bWroteCellInfo = false; +} + +void RtfAttributeOutput::EndTableRow( ) +{ + OSL_TRACE("%s, (depth is %d)", OSL_THIS_FUNC, (int)m_nTableDepth); + + if ( m_nTableDepth > 1 ) + { + m_aAfterRuns.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_NESTTABLEPROPRS); + if (m_aRowDefs.getLength() > 0) + m_aAfterRuns.append(m_aRowDefs.makeStringAndClear()); + else if (m_aTables.size() > 0) + { + m_aAfterRuns.append(m_aTables.back()); + m_aTables.pop_back(); + } + m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_NESTROW "}" "{" OOO_STRING_SVTOOLS_RTF_NONESTTABLES OOO_STRING_SVTOOLS_RTF_PAR "}"); + } + else + { + if (m_aTables.size() > 0) + { + m_aAfterRuns.append(m_aTables.back()); + m_aTables.pop_back(); + } + m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_ROW); + } +} + +void RtfAttributeOutput::EndTable() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( m_nTableDepth > 0 ) { + m_nTableDepth--; + delete m_pTableWrt, m_pTableWrt = NULL; + } + + // We closed the table; if it is a nested table, the cell that contains it + // still continues + m_bTableCellOpen = true; + + // Cleans the table helper + delete m_pTableWrt, m_pTableWrt = NULL; +} + +void RtfAttributeOutput::FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer_t pInner, bool /*bForceEmptyParagraph*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( pInner.get() ) + { + // Where are we in the table + sal_uInt32 nRow = pInner->getRow( ); + + const SwTable *pTable = pInner->getTable( ); + const SwTableLines& rLines = pTable->GetTabLines( ); + USHORT nLinesCount = rLines.Count( ); + + if ( pInner->isEndOfCell() ) + EndTableCell(); + + // This is a line end + if ( pInner->isEndOfLine() ) + EndTableRow(); + + // This is the end of the table + if ( pInner->isEndOfLine( ) && ( nRow + 1 ) == nLinesCount ) + EndTable(); + } +} + +void RtfAttributeOutput::StartStyles() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + m_rExport.Strm() << m_rExport.sNewLine << '{' << OOO_STRING_SVTOOLS_RTF_COLORTBL; + m_rExport.OutColorTable(); + OSL_ENSURE(m_aStylesheet.getLength() == 0, "m_aStylesheet is not empty"); + m_aStylesheet.append(m_rExport.sNewLine); + m_aStylesheet.append('{'); + m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_STYLESHEET); +} + +void RtfAttributeOutput::EndStyles( USHORT /*nNumberOfStyles*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + m_rExport.Strm() << '}'; + m_rExport.Strm() << m_aStylesheet.makeStringAndClear(); + m_rExport.Strm() << '}'; +} + +void RtfAttributeOutput::DefaultStyle( USHORT /*nStyle*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* noop, the default style is always 0 in RTF */ +} + +void RtfAttributeOutput::StartStyle( const String& rName, bool bPapFmt, + USHORT nBase, USHORT nNext, USHORT /*nWwId*/, USHORT nId ) +{ + OSL_TRACE("%s, rName = '%s'", OSL_THIS_FUNC, + OUStringToOString( OUString( rName ), m_rExport.eCurrentEncoding ).getStr()); + + m_aStylesheet.append('{'); + if (bPapFmt) + m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_S); + else + m_aStylesheet.append( OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_CS); + m_aStylesheet.append( (sal_Int32)nId ); + + if ( nBase != 0x0FFF ) + { + m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_SBASEDON); + m_aStylesheet.append((sal_Int32)nBase); + } + + m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_SNEXT); + m_aStylesheet.append((sal_Int32)nNext); + + m_rStyleName = rName; + m_nStyleId = nId; +} + +void RtfAttributeOutput::EndStyle() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + m_aStyles.append(m_aStylesEnd.makeStringAndClear()); + OString aStyles = m_aStyles.makeStringAndClear(); + m_rExport.InsStyle(m_nStyleId, aStyles); + m_aStylesheet.append(aStyles); + m_aStylesheet.append(' '); + m_aStylesheet.append(OUStringToOString( OUString( m_rStyleName ), m_rExport.eCurrentEncoding )); + m_aStylesheet.append(";}"); + m_aStylesheet.append(m_rExport.sNewLine); +} + +void RtfAttributeOutput::StartStyleProperties( bool /*bParProp*/, USHORT /*nStyle*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + /* noop */ +} + +void RtfAttributeOutput::EndStyleProperties( bool /*bParProp*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + /* noop */ +} + +void RtfAttributeOutput::OutlineNumbering( BYTE nLvl, const SwNumFmt& /*rNFmt*/, const SwFmt& /*rFmt*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( nLvl >= WW8ListManager::nMaxLevel ) + nLvl = WW8ListManager::nMaxLevel - 1; + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ILVL); + m_aStyles.append((sal_Int32)nLvl); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_OUTLINELEVEL); + m_aStyles.append((sal_Int32)nLvl); +} + +void RtfAttributeOutput::PageBreakBefore( bool bBreak ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if (bBreak) + { + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_PAGEBB; + } +} + +void RtfAttributeOutput::SectionBreak( BYTE nC, const WW8_SepInfo* pSectionInfo ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + switch (nC) + { + case msword::ColumnBreak: + m_nColBreakNeeded = true; + break; + case msword::PageBreak: + if ( pSectionInfo ) + m_rExport.SectionProperties( *pSectionInfo ); + break; + } +} + +void RtfAttributeOutput::StartSection() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_SECT OOO_STRING_SVTOOLS_RTF_SECTD); + if (!m_bBufferSectionBreaks) + m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear(); +} + +void RtfAttributeOutput::EndSection() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* + * noop, \sect must go to StartSection or Word won't notice multiple + * columns... + */ +} + +void RtfAttributeOutput::SectionFormProtection( bool bProtected ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_SECTUNLOCKED); + m_aSectionBreaks.append((sal_Int32)!bProtected); +} + +void RtfAttributeOutput::SectionLineNumbering( ULONG /*nRestartNo*/, const SwLineNumberInfo& rLnNumInfo ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LINEMOD; + m_rExport.OutLong(rLnNumInfo.GetCountBy()); + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LINEX; + m_rExport.OutLong(rLnNumInfo.GetPosFromLeft()); + if (!rLnNumInfo.IsRestartEachPage()) + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LINECONT; +} + +void RtfAttributeOutput::SectionTitlePage() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* + * noop, handled in RtfExport::WriteHeaderFooter() + */ +} + +void RtfAttributeOutput::SectionPageBorders( const SwFrmFmt* pFmt, const SwFrmFmt* /*pFirstPageFmt*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SvxBoxItem& rBox = pFmt->GetBox(); + const SvxBorderLine *pLine = rBox.GetTop(); + if(pLine) + m_aSectionBreaks.append(OutBorderLine( m_rExport, pLine, + OOO_STRING_SVTOOLS_RTF_PGBRDRT, + rBox.GetDistance(BOX_LINE_TOP) )); + pLine = rBox.GetBottom(); + if(pLine) + m_aSectionBreaks.append(OutBorderLine( m_rExport, pLine, + OOO_STRING_SVTOOLS_RTF_PGBRDRB, + rBox.GetDistance(BOX_LINE_BOTTOM) )); + pLine = rBox.GetLeft(); + if(pLine) + m_aSectionBreaks.append(OutBorderLine( m_rExport, pLine, + OOO_STRING_SVTOOLS_RTF_PGBRDRL, + rBox.GetDistance(BOX_LINE_LEFT) )); + pLine = rBox.GetRight(); + if(pLine) + m_aSectionBreaks.append(OutBorderLine( m_rExport, pLine, + OOO_STRING_SVTOOLS_RTF_PGBRDRR, + rBox.GetDistance(BOX_LINE_RIGHT) )); +} + +void RtfAttributeOutput::SectionBiDi( bool bBiDi ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << (bBiDi ? OOO_STRING_SVTOOLS_RTF_RTLSECT : OOO_STRING_SVTOOLS_RTF_LTRSECT); +} + +void RtfAttributeOutput::SectionPageNumbering( USHORT nNumType, USHORT nPageRestartNumber ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if (nPageRestartNumber > 0) + { + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_PGNSTARTS); + m_aSectionBreaks.append((sal_Int32)nPageRestartNumber); + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_PGNRESTART); + } + + const char* pStr = 0; + switch ( nNumType ) + { + case SVX_NUM_CHARS_UPPER_LETTER: + case SVX_NUM_CHARS_UPPER_LETTER_N: pStr = OOO_STRING_SVTOOLS_RTF_PGNUCLTR; break; + case SVX_NUM_CHARS_LOWER_LETTER: + case SVX_NUM_CHARS_LOWER_LETTER_N: pStr = OOO_STRING_SVTOOLS_RTF_PGNLCLTR; break; + case SVX_NUM_ROMAN_UPPER: pStr = OOO_STRING_SVTOOLS_RTF_PGNUCRM; break; + case SVX_NUM_ROMAN_LOWER: pStr = OOO_STRING_SVTOOLS_RTF_PGNLCRM; break; + + case SVX_NUM_ARABIC: pStr = OOO_STRING_SVTOOLS_RTF_PGNDEC; break; + } + if (pStr) + m_aSectionBreaks.append(pStr); +} + +void RtfAttributeOutput::SectionType( BYTE nBreakCode ) +{ + OSL_TRACE("%s, nBreakCode = %d", OSL_THIS_FUNC, nBreakCode); + + /* + * break code: 0 No break, 1 New column + * 2 New page, 3 Even page, 4 Odd page + */ + const char* sType = NULL; + switch ( nBreakCode ) + { + case 1: sType = OOO_STRING_SVTOOLS_RTF_SBKCOL; break; + case 2: sType = OOO_STRING_SVTOOLS_RTF_SBKPAGE; break; + case 3: sType = OOO_STRING_SVTOOLS_RTF_SBKEVEN; break; + case 4: sType = OOO_STRING_SVTOOLS_RTF_SBKODD; break; + default: sType = OOO_STRING_SVTOOLS_RTF_SBKNONE; break; + } + m_aSectionBreaks.append(sType); + if (!m_bBufferSectionBreaks) + m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear(); +} + +void RtfAttributeOutput::NumberingDefinition( USHORT nId, const SwNumRule &/*rRule*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTOVERRIDE; + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LISTID; + m_rExport.OutULong(nId); + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LISTOVERRIDECOUNT << '0'; + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LS; + m_rExport.OutULong(nId) << '}'; +} + +void RtfAttributeOutput::StartAbstractNumbering( USHORT nId ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LIST << OOO_STRING_SVTOOLS_RTF_LISTTEMPLATEID; + m_rExport.OutULong( nId ); + m_nListId = nId; +} + +void RtfAttributeOutput::EndAbstractNumbering() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LISTID; + m_rExport.OutULong( m_nListId ) << '}' << m_rExport.sNewLine; +} + +void RtfAttributeOutput::NumberingLevel( BYTE nLevel, + USHORT nStart, + USHORT nNumberingType, + SvxAdjust eAdjust, + const BYTE * pNumLvlPos, + BYTE /*nFollow*/, + const wwFont * pFont, + const SfxItemSet * pOutSet, + sal_Int16 nIndentAt, + sal_Int16 nFirstLineIndex, + sal_Int16 /*nListTabPos*/, + const String &rNumberingString ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << m_rExport.sNewLine; + if( nLevel > 8 ) // RTF knows only 9 levels + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_SOUTLVL; + + m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTLEVEL; + + USHORT nVal = 0; + switch( nNumberingType ) + { + case SVX_NUM_ROMAN_UPPER: nVal = 1; break; + case SVX_NUM_ROMAN_LOWER: nVal = 2; break; + case SVX_NUM_CHARS_UPPER_LETTER: + case SVX_NUM_CHARS_UPPER_LETTER_N: nVal = 3; break; + case SVX_NUM_CHARS_LOWER_LETTER: + case SVX_NUM_CHARS_LOWER_LETTER_N: nVal = 4; break; + + case SVX_NUM_BITMAP: + case SVX_NUM_CHAR_SPECIAL: nVal = 23; break; + } + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LEVELNFC; + m_rExport.OutULong( nVal ); + + switch( eAdjust ) + { + case SVX_ADJUST_CENTER: nVal = 1; break; + case SVX_ADJUST_RIGHT: nVal = 2; break; + default: nVal = 0; break; + } + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LEVELJC; + m_rExport.OutULong( nVal ); + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LEVELSTARTAT; + m_rExport.OutULong( nStart ); + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LEVELFOLLOW << "0"; + + // leveltext group + m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LEVELTEXT << ' '; + + if( SVX_NUM_CHAR_SPECIAL == nNumberingType || + SVX_NUM_BITMAP == nNumberingType ) + { + m_rExport.Strm() << "\\'01"; + sal_Unicode cChar = rNumberingString.GetChar(0); + m_rExport.Strm() << "\\u"; + m_rExport.OutULong(cChar); + m_rExport.Strm() << " ?"; + } + else + { + m_rExport.Strm() << "\\'" << m_rExport.OutHex( rNumberingString.Len(), 2 ); + m_rExport.Strm() << m_rExport.OutString( rNumberingString, m_rExport.eDefaultEncoding ); + } + + m_rExport.Strm() << ";}"; + + // write the levelnumbers + m_rExport.Strm() << "{" << OOO_STRING_SVTOOLS_RTF_LEVELNUMBERS; + for( BYTE i = 0; i <= nLevel && pNumLvlPos[ i ]; ++i ) + { + m_rExport.Strm() << "\\'" << m_rExport.OutHex(pNumLvlPos[ i ], 2).getStr(); + } + m_rExport.Strm() << ";}"; + + if( pOutSet ) + { + if (pFont) + { + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_F; + m_rExport.OutULong(m_rExport.maFontHelper.GetId(*pFont)); + } + m_rExport.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rExport.mbExportModeRTF ); + m_rExport.Strm() << m_aStyles.makeStringAndClear(); + } + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_FI; + m_rExport.OutLong( nFirstLineIndex ) << OOO_STRING_SVTOOLS_RTF_LI; + m_rExport.OutLong( nIndentAt ); + + m_rExport.Strm() << '}'; + if( nLevel > 8 ) + m_rExport.Strm() << '}'; +} + +void RtfAttributeOutput::WriteField_Impl( const SwField* pFld, ww::eField /*eType*/, const String& rFldCmd, BYTE /*nMode*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // NEEDSWORK this has beeen tested only with page numbers + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_FIELD); + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FLDINST " "); + m_aRunText.append(m_rExport.OutString(rFldCmd, m_rExport.eCurrentEncoding)); + m_aRunText.append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " "); + if (pFld) + m_aRunText.append(m_rExport.OutString(pFld->ExpandField(true), m_rExport.eDefaultEncoding)); + m_aRunText.append("}}"); +} + +void RtfAttributeOutput::WriteBookmarks_Impl( std::vector< rtl::OUString >& rStarts, std::vector< rtl::OUString >& rEnds ) +{ + for ( std::vector< OUString >::const_iterator it = rStarts.begin(), end = rStarts.end(); it < end; ++it ) + { + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_BKMKSTART " "); + m_aRun.append(m_rExport.OutString(*it, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + rStarts.clear(); + + for ( std::vector< OUString >::const_iterator it = rEnds.begin(), end = rEnds.end(); it < end; ++it ) + { + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_BKMKEND " "); + m_aRun.append(m_rExport.OutString(*it, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + rEnds.clear(); +} + +void RtfAttributeOutput::WriteHeaderFooter_Impl( const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr ) +{ + OStringBuffer aSectionBreaks = m_aSectionBreaks; + m_aSectionBreaks.setLength(0); + OStringBuffer aRun = m_aRun; + m_aRun.setLength(0); + + m_aSectionHeaders.append(bHeader ? OOO_STRING_SVTOOLS_RTF_HEADERY : OOO_STRING_SVTOOLS_RTF_FOOTERY); + m_aSectionHeaders.append((sal_Int32)m_rExport.pAktPageDesc->GetMaster().GetULSpace().GetUpper()); + m_aSectionHeaders.append('{'); + m_aSectionHeaders.append(pStr); + m_bBufferSectionHeaders = true; + m_rExport.WriteHeaderFooterText(rFmt, bHeader); + m_bBufferSectionHeaders = false; + m_aSectionHeaders.append('}'); + + m_aSectionBreaks = aSectionBreaks; + m_aRun = aRun; +} + +void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Point& /*rNdTopLeft*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SwNode *pNode = rFrame.GetContent(); + const SwGrfNode *pGrfNode = pNode ? pNode->GetGrfNode() : 0; + + switch ( rFrame.GetWriterType() ) + { + case sw::Frame::eTxtBox: + OSL_ENSURE(m_aRunText.getLength() == 0, "m_aRunText is not empty"); + m_rExport.mpParentFrame = &rFrame; + m_rExport.bOutFlyFrmAttrs = m_rExport.bRTFFlySyntax = true; + m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true ); + m_rExport.Strm() << m_aRunText.makeStringAndClear(); + m_rExport.Strm() << m_aStyles.makeStringAndClear(); + m_rExport.bOutFlyFrmAttrs = m_rExport.bRTFFlySyntax = false; + m_rExport.Strm() << "{" OOO_STRING_SVTOOLS_RTF_IGNORE; + m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true ); + m_rExport.Strm() << m_aRunText.makeStringAndClear(); + m_rExport.Strm() << m_aStyles.makeStringAndClear(); + m_rExport.Strm() << '}'; + + { + /* + * Save m_aRun as we should not loose the opening brace. + * OTOH, just drop the contents of m_aRunText in case something + * would be there, causing a problem later. + */ + OString aSave = m_aRun.makeStringAndClear(); + m_rExport.bRTFFlySyntax = true; + + const SwFrmFmt& rFrmFmt = rFrame.GetFrmFmt( ); + const SwNodeIndex* pNodeIndex = rFrmFmt.GetCntnt().GetCntntIdx(); + ULONG nStt = pNodeIndex ? pNodeIndex->GetIndex()+1 : 0; + ULONG nEnd = pNodeIndex ? pNodeIndex->GetNode().EndOfSectionIndex() : 0; + m_rExport.SaveData( nStt, nEnd ); + m_rExport.mpParentFrame = &rFrame; + m_rExport.WriteText( ); + m_rExport.RestoreData(); + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_PARD; + m_rExport.bRTFFlySyntax = false; + m_aRun.append(aSave); + m_aRunText.setLength(0); + } + + m_rExport.mpParentFrame = NULL; + m_rExport.Strm() << RtfExport::sNewLine; + break; + case sw::Frame::eGraphic: + if (!rFrame.IsInline()) + { + m_rExport.mpParentFrame = &rFrame; + m_rExport.bRTFFlySyntax = true; + m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true ); + m_rExport.bRTFFlySyntax = false; + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE); + m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true ); + m_aRunText.append('}'); + m_rExport.mpParentFrame = NULL; + } + + if ( pGrfNode ) + FlyFrameGraphic( dynamic_cast<const SwFlyFrmFmt*>( &rFrame.GetFrmFmt() ), *pGrfNode, rFrame.GetLayoutSize() ); + break; + case sw::Frame::eDrawing: + { + const SdrObject* pSdrObj = rFrame.GetFrmFmt().FindRealSdrObject(); + if ( pSdrObj ) + { + bool bSwapInPage = false; + if ( !pSdrObj->GetPage() ) + { + if ( SdrModel* pModel = m_rExport.pDoc->GetDrawModel() ) + { + if ( SdrPage *pPage = pModel->GetPage( 0 ) ) + { + bSwapInPage = true; + const_cast< SdrObject* >( pSdrObj )->SetPage( pPage ); + } + } + } + + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_FIELD "{"); + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_IGNORE); + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLDINST); + m_aRunText.append(" SHAPE "); + m_aRunText.append("}" "{" OOO_STRING_SVTOOLS_RTF_FLDRSLT); + + m_rExport.SdrExporter().AddSdrObject( *pSdrObj ); + + m_aRunText.append('}'); + m_aRunText.append('}'); + + if ( bSwapInPage ) + const_cast< SdrObject* >( pSdrObj )->SetPage( 0 ); + } + } + break; + case sw::Frame::eFormControl: + { + const SwFrmFmt &rFrmFmt = rFrame.GetFrmFmt(); + const SdrObject *pObject = rFrmFmt.FindRealSdrObject(); + + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_FIELD); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FLDINST); + + if (pObject && pObject->GetObjInventor() == FmFormInventor) + { + if (SdrUnoObj *pFormObj = PTR_CAST(SdrUnoObj,pObject)) + { + uno::Reference< awt::XControlModel > xControlModel = + pFormObj->GetUnoControlModel(); + uno::Reference< lang::XServiceInfo > xInfo(xControlModel, uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPropSet(xControlModel, uno::UNO_QUERY); + uno::Reference<beans::XPropertySetInfo> xPropSetInfo = xPropSet->getPropertySetInfo(); + OUString sName; + if (xInfo->supportsService(C2U("com.sun.star.form.component.CheckBox"))) + { + + m_aRun.append(OUStringToOString(OUString(FieldString(ww::eFORMCHECKBOX)), m_rExport.eCurrentEncoding)); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD "{"); + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFTYPE "1"); // 1 = checkbox + // checkbox size in half points, this seems to be always 20, see WW8Export::DoCheckBox() + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFHPS "20"); + + OUString aStr; + sName = C2U("Name"); + if (xPropSetInfo->hasPropertyByName(sName)) + { + xPropSet->getPropertyValue(sName) >>= aStr; + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFNAME " "); + m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + + sName = C2U("HelpText"); + if (xPropSetInfo->hasPropertyByName(sName)) + { + xPropSet->getPropertyValue(sName) >>= aStr; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNHELP); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " "); + m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + + sName = C2U("HelpF1Text"); + if (xPropSetInfo->hasPropertyByName(sName)) + { + xPropSet->getPropertyValue(sName) >>= aStr; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNSTAT); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " "); + m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + + sal_Int16 nTemp = 0; + xPropSet->getPropertyValue(C2U("DefaultState")) >>= nTemp; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFDEFRES); + m_aRun.append((sal_Int32)nTemp); + xPropSet->getPropertyValue(C2U("State")) >>= nTemp; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFRES); + m_aRun.append((sal_Int32)nTemp); + + m_aRun.append("}}"); + + // field result is empty, ffres already contains the form result + m_aRun.append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " "); + } + else if (xInfo->supportsService(C2U("com.sun.star.form.component.TextField"))) + { + OStringBuffer aBuf; + OString aStr; + OUString aTmp; + const sal_Char* pStr; + + m_aRun.append(OUStringToOString(OUString(FieldString(ww::eFORMTEXT)), m_rExport.eCurrentEncoding)); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_DATAFIELD " "); + for (int i = 0; i < 8; i++) aBuf.append((sal_Char)0x00); + xPropSet->getPropertyValue(C2U("Name")) >>= aTmp; + aStr = OUStringToOString(aTmp, m_rExport.eCurrentEncoding); + aBuf.append((sal_Char)aStr.getLength()); + aBuf.append(aStr); + aBuf.append((sal_Char)0x00); + xPropSet->getPropertyValue(C2U("DefaultText")) >>= aTmp; + aStr = OUStringToOString(aTmp, m_rExport.eCurrentEncoding); + aBuf.append((sal_Char)aStr.getLength()); + aBuf.append(aStr); + for (int i = 0; i < 11; i++) aBuf.append((sal_Char)0x00); + aStr = aBuf.makeStringAndClear(); + pStr = aStr.getStr(); + for (int i = 0; i < aStr.getLength(); i++, pStr++) + m_aRun.append(m_rExport.OutHex(*pStr, 2)); + m_aRun.append('}'); + m_aRun.append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " "); + xPropSet->getPropertyValue(C2U("Text")) >>= aTmp; + m_aRun.append(OUStringToOString(aTmp, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD "{"); + sName = C2U("HelpText"); + if (xPropSetInfo->hasPropertyByName(sName)) + { + xPropSet->getPropertyValue(sName) >>= aTmp; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNHELP); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " "); + m_aRun.append(OUStringToOString(aTmp, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + + sName = C2U("HelpF1Text"); + if (xPropSetInfo->hasPropertyByName(sName)) + { + xPropSet->getPropertyValue(sName) >>= aTmp; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNSTAT); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " "); + m_aRun.append(OUStringToOString(aTmp, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + m_aRun.append("}"); + } + else if (xInfo->supportsService(C2U("com.sun.star.form.component.ListBox"))) + { + OUString aStr; + uno::Sequence<sal_Int16> aIntSeq; + uno::Sequence<OUString> aStrSeq; + + m_aRun.append(OUStringToOString(OUString(FieldString(ww::eFORMDROPDOWN)), m_rExport.eCurrentEncoding)); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD "{"); + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFTYPE "2"); // 2 = list + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFHASLISTBOX); + + xPropSet->getPropertyValue(C2U("DefaultSelection")) >>= aIntSeq; + if( aIntSeq.getLength() ) + { + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFDEFRES); + // a dropdown list can have only one 'selected item by default' + m_aRun.append((sal_Int32)aIntSeq[0]); + } + + xPropSet->getPropertyValue(C2U("SelectedItems")) >>= aIntSeq; + if( aIntSeq.getLength() ) + { + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFRES); + // a dropdown list can have only one 'currently selected item' + m_aRun.append((sal_Int32)aIntSeq[0]); + } + + sName = C2U("Name"); + if (xPropSetInfo->hasPropertyByName(sName)) + { + xPropSet->getPropertyValue(sName) >>= aStr; + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFNAME " "); + m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + + sName = C2U("HelpText"); + if (xPropSetInfo->hasPropertyByName(sName)) + { + xPropSet->getPropertyValue(sName) >>= aStr; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNHELP); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " "); + m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + + sName = C2U("HelpF1Text"); + if (xPropSetInfo->hasPropertyByName(sName)) + { + xPropSet->getPropertyValue(sName) >>= aStr; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNSTAT); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " "); + m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + + + xPropSet->getPropertyValue(C2U("StringItemList")) >>= aStrSeq; + sal_uInt32 nListItems = aStrSeq.getLength(); + for (sal_uInt32 i = 0; i < nListItems; i++) + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFL " ") + .append(OUStringToOString(aStrSeq[i], m_rExport.eCurrentEncoding)).append('}'); + + m_aRun.append("}}"); + + // field result is empty, ffres already contains the form result + m_aRun.append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " "); + } + else + OSL_TRACE("%s unhandled form control: '%s'", OSL_THIS_FUNC, + OUStringToOString(xInfo->getImplementationName(), m_rExport.eCurrentEncoding).getStr()); + m_aRun.append('}'); + } + } + + m_aRun.append('}'); + } + break; + case sw::Frame::eOle: + { + const SwFrmFmt &rFrmFmt = rFrame.GetFrmFmt(); + const SdrObject *pSdrObj = rFrmFmt.FindRealSdrObject(); + if ( pSdrObj ) + { + SwNodeIndex aIdx(*rFrmFmt.GetCntnt().GetCntntIdx(), 1); + SwOLENode& rOLENd = *aIdx.GetNode().GetOLENode(); + FlyFrameOLE(dynamic_cast<const SwFlyFrmFmt*>( &rFrmFmt ), rOLENd, rFrame.GetLayoutSize()); + } + } + break; + default: + OSL_TRACE("%s: unknown type (%d)", OSL_THIS_FUNC, rFrame.GetWriterType()); + break; + } +} + +void RtfAttributeOutput::CharCaseMap( const SvxCaseMapItem& rCaseMap ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + switch ( rCaseMap.GetValue() ) + { + case SVX_CASEMAP_KAPITAELCHEN: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SCAPS); + break; + case SVX_CASEMAP_VERSALIEN: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CAPS); + break; + default: // Something that rtf does not support + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SCAPS); + m_aStyles.append((sal_Int32)0); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CAPS); + m_aStyles.append((sal_Int32)0); + break; + } +} + +void RtfAttributeOutput::CharColor( const SvxColorItem& rColor ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const Color aColor( rColor.GetValue() ); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CF); + m_aStyles.append( (sal_Int32)m_rExport.GetColor( aColor )); +} + +void RtfAttributeOutput::CharContour( const SvxContourItem& rContour ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_OUTL); + if ( !rContour.GetValue() ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::CharCrossedOut( const SvxCrossedOutItem& rCrossedOut ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + switch ( rCrossedOut.GetStrikeout() ) + { + case STRIKEOUT_NONE: + if (!m_bStrikeDouble) + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_STRIKE); + else + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_STRIKED); + m_aStyles.append((sal_Int32)0); + break; + case STRIKEOUT_DOUBLE: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_STRIKED); + m_aStyles.append((sal_Int32)1); + break; + default: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_STRIKE); + break; + } +} + +void RtfAttributeOutput::CharEscapement( const SvxEscapementItem& rEsc ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const char * pUpDn; + + SwTwips nH = ((SvxFontHeightItem&)m_rExport.GetItem( RES_CHRATR_FONTSIZE )).GetHeight(); + + if( 0 < rEsc.GetEsc() ) + pUpDn = OOO_STRING_SVTOOLS_RTF_UP; + else if( 0 > rEsc.GetEsc() ) + { + pUpDn = OOO_STRING_SVTOOLS_RTF_DN; + nH = -nH; + } + else + return; + + short nEsc = rEsc.GetEsc(); + short nProp = rEsc.GetProp() * 100; + if( DFLT_ESC_AUTO_SUPER == nEsc ) + { + nEsc = 100 - rEsc.GetProp(); + ++nProp; + } + else if( DFLT_ESC_AUTO_SUB == nEsc ) + { + nEsc = - 100 + rEsc.GetProp(); + ++nProp; + } + + m_aStyles.append('{'); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_IGNORE); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_UPDNPROP); + m_aStyles.append( (sal_Int32)nProp ); + m_aStyles.append('}'); + m_aStyles.append(pUpDn); + + /* + * Calculate the act. FontSize and the percentage of the displacement; + * RTF file expects half points, while internally it's in twips. + * Formally : (FontSize * 1/20 ) pts x * 2 + * ----------------------- = ------------ + * 100% Escapement + */ + + m_aStyles.append( (sal_Int32) ( (long( nEsc ) * nH) + 500L ) / 1000L ); + // 500L to round !! +} + +void RtfAttributeOutput::CharFont( const SvxFontItem& rFont) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LOCH); + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_F); + m_aStylesEnd.append((sal_Int32)m_rExport.maFontHelper.GetId(rFont)); + m_rExport.eCurrentEncoding = rtl_getTextEncodingFromWindowsCharset(sw::ms::rtl_TextEncodingToWinCharset(rFont.GetCharSet())); +} + +void RtfAttributeOutput::CharFontSize( const SvxFontHeightItem& rFontSize) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + switch ( rFontSize.Which() ) + { + case RES_CHRATR_FONTSIZE: + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_FS); + m_aStylesEnd.append((sal_Int32)(rFontSize.GetHeight() / 10 )); + break; + case RES_CHRATR_CJK_FONTSIZE: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_FS); + m_aStyles.append((sal_Int32)(rFontSize.GetHeight() / 10 )); + break; + case RES_CHRATR_CTL_FONTSIZE: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_AFS); + m_aStyles.append((sal_Int32)(rFontSize.GetHeight() / 10 )); + break; + } +} + +void RtfAttributeOutput::CharKerning( const SvxKerningItem& rKerning ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // in quater points then in twips + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_EXPND); + m_aStyles.append((sal_Int32)(rKerning.GetValue() / 5)); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_EXPNDTW); + m_aStyles.append((sal_Int32)(rKerning.GetValue())); +} + +void RtfAttributeOutput::CharLanguage( const SvxLanguageItem& rLanguage ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + switch (rLanguage.Which()) + { + case RES_CHRATR_LANGUAGE: + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LANG); + m_aStylesEnd.append((sal_Int32)rLanguage.GetLanguage()); + break; + case RES_CHRATR_CJK_LANGUAGE: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LANGFE); + m_aStyles.append((sal_Int32)rLanguage.GetLanguage()); + break; + case RES_CHRATR_CTL_LANGUAGE: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LANG); + m_aStyles.append((sal_Int32)rLanguage.GetLanguage()); + break; + } +} + +void RtfAttributeOutput::CharPosture( const SvxPostureItem& rPosture ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_I); + if ( rPosture.GetPosture() == ITALIC_NONE ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::CharShadow( const SvxShadowedItem& rShadow ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SHAD); + if ( !rShadow.GetValue() ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::CharUnderline( const SvxUnderlineItem& rUnderline ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const char* pStr = 0; + const SfxPoolItem* pItem = m_rExport.HasItem( RES_CHRATR_WORDLINEMODE ); + bool bWord = false; + if (pItem) + bWord = ((const SvxWordLineModeItem*)pItem)->GetValue() ? true : false; + switch(rUnderline.GetLineStyle() ) + { + case UNDERLINE_SINGLE: + pStr = bWord ? OOO_STRING_SVTOOLS_RTF_ULW : OOO_STRING_SVTOOLS_RTF_UL; + break; + case UNDERLINE_DOUBLE: + pStr = OOO_STRING_SVTOOLS_RTF_ULDB; + break; + case UNDERLINE_NONE: + pStr = OOO_STRING_SVTOOLS_RTF_ULNONE; + break; + case UNDERLINE_DOTTED: + pStr = OOO_STRING_SVTOOLS_RTF_ULD; + break; + case UNDERLINE_DASH: + pStr = OOO_STRING_SVTOOLS_RTF_ULDASH; + break; + case UNDERLINE_DASHDOT: + pStr = OOO_STRING_SVTOOLS_RTF_ULDASHD; + break; + case UNDERLINE_DASHDOTDOT: + pStr = OOO_STRING_SVTOOLS_RTF_ULDASHDD; + break; + case UNDERLINE_BOLD: + pStr = OOO_STRING_SVTOOLS_RTF_ULTH; + break; + case UNDERLINE_WAVE: + pStr = OOO_STRING_SVTOOLS_RTF_ULWAVE; + break; + case UNDERLINE_BOLDDOTTED: + pStr = OOO_STRING_SVTOOLS_RTF_ULTHD; + break; + case UNDERLINE_BOLDDASH: + pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASH; + break; + case UNDERLINE_LONGDASH: + pStr = OOO_STRING_SVTOOLS_RTF_ULLDASH; + break; + case UNDERLINE_BOLDLONGDASH: + pStr = OOO_STRING_SVTOOLS_RTF_ULTHLDASH; + break; + case UNDERLINE_BOLDDASHDOT: + pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASHD; + break; + case UNDERLINE_BOLDDASHDOTDOT: + pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASHDD; + break; + case UNDERLINE_BOLDWAVE: + pStr = OOO_STRING_SVTOOLS_RTF_ULHWAVE; + break; + case UNDERLINE_DOUBLEWAVE: + pStr = OOO_STRING_SVTOOLS_RTF_ULULDBWAVE; + break; + default: + break; + } + + if( pStr ) + { + m_aStyles.append(pStr); + // NEEDSWORK looks like here rUnderline.GetColor() is always black, + // even if the color in the odt is for example green... + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ULC); + m_aStyles.append( (sal_Int32)m_rExport.GetColor(rUnderline.GetColor()) ); + } +} + +void RtfAttributeOutput::CharWeight( const SvxWeightItem& rWeight ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_B); + if ( rWeight.GetWeight() != WEIGHT_BOLD ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::CharAutoKern( const SvxAutoKernItem& rAutoKern) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_KERNING); + m_aStyles.append((sal_Int32) (rAutoKern.GetValue() ? 1 : 0)); +} + +void RtfAttributeOutput::CharAnimatedText( const SvxBlinkItem& rBlink ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ANIMTEXT); + m_aStyles.append((sal_Int32) (rBlink.GetValue() ? 2 : 0)); +} + +void RtfAttributeOutput::CharBackground( const SvxBrushItem& rBrush ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if( !rBrush.GetColor().GetTransparency() ) + { + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CHCBPAT); + m_aStyles.append((sal_Int32)m_rExport.GetColor(rBrush.GetColor())); + } +} + +void RtfAttributeOutput::CharFontCJK( const SvxFontItem& rFont ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HICH); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_AF); + m_aStyles.append((sal_Int32)m_rExport.maFontHelper.GetId(rFont)); +} + +void RtfAttributeOutput::CharFontSizeCJK( const SvxFontHeightItem& rFontSize ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + CharFontSize( rFontSize ); +} + +void RtfAttributeOutput::CharLanguageCJK( const SvxLanguageItem& rLanguageItem ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + CharLanguage( rLanguageItem ); +} + +void RtfAttributeOutput::CharPostureCJK( const SvxPostureItem& rPosture ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_I); + if ( rPosture.GetPosture() == ITALIC_NONE ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::CharWeightCJK( const SvxWeightItem& rWeight ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_B); + if ( rWeight.GetWeight() != WEIGHT_BOLD ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::CharFontCTL( const SvxFontItem& rFont ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_DBCH); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_AF); + m_aStyles.append((sal_Int32)m_rExport.maFontHelper.GetId(rFont)); +} + +void RtfAttributeOutput::CharFontSizeCTL( const SvxFontHeightItem& rFontSize ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + CharFontSize( rFontSize ); +} + +void RtfAttributeOutput::CharLanguageCTL( const SvxLanguageItem& rLanguageItem ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + CharLanguage( rLanguageItem ); +} + +void RtfAttributeOutput::CharPostureCTL( const SvxPostureItem& rPosture) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_AI); + if ( rPosture.GetPosture() == ITALIC_NONE ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::CharWeightCTL( const SvxWeightItem& rWeight ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_AB); + if ( rWeight.GetWeight() != WEIGHT_BOLD ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::CharRotate( const SvxCharRotateItem& rRotate) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HORZVERT); + m_aStyles.append((sal_Int32)(rRotate.IsFitToLine() ? 1 : 0)); +} + +void RtfAttributeOutput::CharEmphasisMark( const SvxEmphasisMarkItem& rEmphasisMark ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const sal_Char* pStr; + switch( rEmphasisMark.GetEmphasisMark()) + { + case EMPHASISMARK_NONE: pStr = OOO_STRING_SVTOOLS_RTF_ACCNONE; break; + case EMPHASISMARK_SIDE_DOTS: pStr = OOO_STRING_SVTOOLS_RTF_ACCCOMMA; break; + default: pStr = OOO_STRING_SVTOOLS_RTF_ACCDOT; break; + } + m_aStyles.append(pStr); +} + +void RtfAttributeOutput::CharTwoLines( const SvxTwoLinesItem& rTwoLines ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if( rTwoLines.GetValue() ) + { + sal_Unicode cStart = rTwoLines.GetStartBracket(); + sal_Unicode cEnd = rTwoLines.GetEndBracket(); + + USHORT nType; + if( !cStart && !cEnd ) + nType = 0; + else if( '{' == cStart || '}' == cEnd ) + nType = 4; + else if( '<' == cStart || '>' == cEnd ) + nType = 3; + else if( '[' == cStart || ']' == cEnd ) + nType = 2; + else // all other kind of brackets + nType = 1; + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_TWOINONE); + m_aStyles.append((sal_Int32)nType); + } +} + +void RtfAttributeOutput::CharScaleWidth( const SvxCharScaleWidthItem& rScaleWidth ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CHARSCALEX); + m_aStyles.append((sal_Int32)rScaleWidth.GetValue()); +} + +void RtfAttributeOutput::CharRelief( const SvxCharReliefItem& rRelief ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const sal_Char* pStr; + switch (rRelief.GetValue()) + { + case RELIEF_EMBOSSED: + pStr = OOO_STRING_SVTOOLS_RTF_EMBO; + break; + case RELIEF_ENGRAVED: + pStr = OOO_STRING_SVTOOLS_RTF_IMPR; + break; + default: + pStr = 0; + break; + } + + if (pStr) + m_aStyles.append(pStr); +} + +void RtfAttributeOutput::CharHidden( const SvxCharHiddenItem& rHidden ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_V); + if ( !rHidden.GetValue() ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::TextINetFormat( const SwFmtINetFmt& rURL ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if( rURL.GetValue().Len() ) + { + const SwCharFmt* pFmt; + const SwTxtINetFmt* pTxtAtr = rURL.GetTxtINetFmt(); + + m_aStyles.append("{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " "); + if( pTxtAtr && 0 != ( pFmt = pTxtAtr->GetCharFmt() )) + { + USHORT nStyle = m_rExport.GetId( *pFmt ); + OString* pString = m_rExport.GetStyle(nStyle); + if (pString) + m_aStyles.append(*pString); + } + } +} + +void RtfAttributeOutput::TextCharFormat( const SwFmtCharFmt& rCharFmt ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + USHORT nStyle = m_rExport.GetId( *rCharFmt.GetCharFmt() ); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_CS); + m_aStyles.append((sal_Int32)nStyle); + OString* pString = m_rExport.GetStyle(nStyle); + if (pString) + m_aStyles.append(*pString); +} + +void RtfAttributeOutput::WriteTextFootnoteNumStr(const SwFmtFtn& rFootnote) +{ + if (!rFootnote.GetNumStr().Len()) + m_aRun.append(OOO_STRING_SVTOOLS_RTF_CHFTN); + else + m_aRun.append(m_rExport.OutString(rFootnote.GetNumStr(), m_rExport.eCurrentEncoding)); +} + +void RtfAttributeOutput::TextFootnote_Impl( const SwFmtFtn& rFootnote ) +{ + OSL_TRACE("%s start", OSL_THIS_FUNC); + + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_SUPER " "); + WriteTextFootnoteNumStr(rFootnote); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FOOTNOTE); + if( rFootnote.IsEndNote() ) + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FTNALT); + m_aRun.append(' '); + WriteTextFootnoteNumStr(rFootnote); + + /* + * The footnote contains a whole paragraph, so we have to: + * 1) Reset, then later restore the contents of our run buffer. + * 2) Buffer the output of the whole paragraph, as we do so for section headers already. + */ + const SwNodeIndex* pIndex = rFootnote.GetTxtFtn()->GetStartNode(); + OStringBuffer aRun = m_aRun; + m_aRun.setLength(0); + m_bBufferSectionHeaders = true; + m_rExport.WriteSpecialText( pIndex->GetIndex() + 1, + pIndex->GetNode().EndOfSectionIndex(), + !rFootnote.IsEndNote() ? TXT_FTN : TXT_EDN); + m_bBufferSectionHeaders = false; + m_aRun = aRun; + m_aRun.append(m_aSectionHeaders.makeStringAndClear()); + + m_aRun.append("}"); + m_aRun.append("}"); + + OSL_TRACE("%s end", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::ParaLineSpacing_Impl( short nSpace, short nMulti ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SL); + m_aStyles.append((sal_Int32)nSpace); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SLMULT); + m_aStyles.append((sal_Int32)nMulti); + +} + +void RtfAttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + switch ( rAdjust.GetAdjust() ) + { + case SVX_ADJUST_LEFT: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_QL); + break; + case SVX_ADJUST_RIGHT: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_QR); + break; + case SVX_ADJUST_BLOCKLINE: + case SVX_ADJUST_BLOCK: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_QJ); + break; + case SVX_ADJUST_CENTER: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_QC); + break; + default: + break; + } +} + +void RtfAttributeOutput::ParaSplit( const SvxFmtSplitItem& rSplit ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if( !rSplit.GetValue() ) + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_KEEP); +} + +void RtfAttributeOutput::ParaWidows( const SvxWidowsItem& rWidows ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if (rWidows.GetValue()) + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_WIDCTLPAR); + else + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_NOWIDCTLPAR); +} + +void RtfAttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStop ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + long nOffset = ((SvxLRSpaceItem&)m_rExport.GetItem( RES_LR_SPACE )).GetTxtLeft(); + for( USHORT n = 0; n < rTabStop.Count(); n++ ) + { + const SvxTabStop & rTS = rTabStop[ n ]; + if( SVX_TAB_ADJUST_DEFAULT != rTS.GetAdjustment() ) + { + const char* pFill = 0; + switch( rTS.GetFill() ) + { + case cDfltFillChar: + break; + + case '.': pFill = OOO_STRING_SVTOOLS_RTF_TLDOT; break; + case '_': pFill = OOO_STRING_SVTOOLS_RTF_TLUL; break; + case '-': pFill = OOO_STRING_SVTOOLS_RTF_TLTH; break; + case '=': pFill = OOO_STRING_SVTOOLS_RTF_TLEQ; break; + default: + break; + } + if( pFill ) + m_aStyles.append(pFill); + + const sal_Char* pAdjStr = 0; + switch (rTS.GetAdjustment()) + { + case SVX_TAB_ADJUST_RIGHT: + pAdjStr = OOO_STRING_SVTOOLS_RTF_TQR; + break; + case SVX_TAB_ADJUST_DECIMAL: + pAdjStr = OOO_STRING_SVTOOLS_RTF_TQDEC; + break; + case SVX_TAB_ADJUST_CENTER: + pAdjStr = OOO_STRING_SVTOOLS_RTF_TQC; + break; + default: + break; + } + if (pAdjStr) + m_aStyles.append(pAdjStr); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_TX); + m_aStyles.append((sal_Int32)(rTS.GetTabPos() + nOffset)); + } + else + { + m_aTabStop.append( OOO_STRING_SVTOOLS_RTF_DEFTAB ); + m_aTabStop.append( (sal_Int32)rTabStop[0].GetTabPos() ); + } + } +} + +void RtfAttributeOutput::ParaHyphenZone( const SvxHyphenZoneItem& rHyphenZone ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + sal_Int32 nFlags = rHyphenZone.IsHyphen() ? 1 : 0; + if( rHyphenZone.IsPageEnd() ) + nFlags += 2; + m_aStyles.append('{'); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_IGNORE); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HYPHEN); + m_aStyles.append((sal_Int32)nFlags); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HYPHLEAD); + m_aStyles.append((sal_Int32)rHyphenZone.GetMinLead()); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HYPHTRAIL); + m_aStyles.append((sal_Int32)rHyphenZone.GetMinTrail()); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HYPHMAX); + m_aStyles.append((sal_Int32)rHyphenZone.GetMaxHyphens()); + m_aStyles.append('}'); +} + +void RtfAttributeOutput::ParaNumRule_Impl( const SwTxtNode* pTxtNd, sal_Int32 nLvl, sal_Int32 nNumId ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( USHRT_MAX == nNumId || 0 == nNumId || 0 == pTxtNd) + return; + + const SwNumRule* pRule = pTxtNd->GetNumRule(); + + // --> OD 2008-03-18 #refactorlists# + // if( pRule && MAXLEVEL > pTxtNd->GetActualListLevel() ) + if( pRule && pTxtNd->IsInList() ) + // <-- + { + // --> OD 2008-03-18 #refactorlists# + ASSERT( pTxtNd->GetActualListLevel() >= 0 && pTxtNd->GetActualListLevel() < MAXLEVEL, + "<SwRTFWriter::OutListNum(..)> - text node does not have valid list level. Serious defect -> please inform OD" ); + // <-- + + const bool bExportNumRule = USHRT_MAX != nNumId; + const SwNumFmt* pFmt = pRule->GetNumFmt( nLvl ); + if( !pFmt ) + pFmt = &pRule->Get( nLvl ); + + const SfxItemSet& rNdSet = pTxtNd->GetSwAttrSet(); + + if ( bExportNumRule ) { + m_aStyles.append('{'); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LISTTEXT); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_PARD); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_PLAIN); + m_aStyles.append(' '); + } + + SvxLRSpaceItem aLR( (SvxLRSpaceItem&)rNdSet.Get( RES_LR_SPACE ) ); + aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetIndentAt() ); + aLR.SetTxtFirstLineOfst( pFmt->GetFirstLineOffset() ); + + USHORT nStyle = m_rExport.GetId( *pFmt->GetCharFmt() ); + OString* pString = m_rExport.GetStyle(nStyle); + if (pString) + m_aStyles.append(*pString); + + { + String sTxt; + if( SVX_NUM_CHAR_SPECIAL == pFmt->GetNumberingType() || SVX_NUM_BITMAP == pFmt->GetNumberingType() ) + sTxt = pFmt->GetBulletChar(); + else + sTxt = pTxtNd->GetNumString(); + + m_aStyles.append(' '); + + if (sTxt.Len()) + { + m_aStyles.append(m_rExport.OutString(sTxt, m_rExport.eDefaultEncoding)); + } + + if( bExportNumRule ) + { + if( OUTLINE_RULE != pRule->GetRuleType() ) + { + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_TAB); + m_aStyles.append('}'); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ILVL); + if( nLvl > 8 ) // RTF knows only 9 levels + { + m_aStyles.append((sal_Int32)8); + m_aStyles.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SOUTLVL); + m_aStyles.append((sal_Int32)nLvl); + m_aStyles.append('}'); + } + else + m_aStyles.append((sal_Int32)nLvl); + } + else + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_TAB "}"); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LS); + m_aStyles.append((sal_Int32)m_rExport.GetId(*pRule)+1); + m_aStyles.append(' '); + } + else if( sTxt.Len() ) + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_TAB); + } + FormatLRSpace(aLR); + } +} + +void RtfAttributeOutput::ParaScriptSpace( const SfxBoolItem& rScriptSpace ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if (!rScriptSpace.GetValue( )) + return; + switch ( rScriptSpace.Which( ) ) + { + case RES_PARATR_SCRIPTSPACE: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ASPALPHA); + break; + /* Is this needed? + case RES_PARATR_HANGINGPUNCTUATION: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_NOOVERFLOW); + break; + case RES_PARATR_FORBIDDEN_RULES: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_NOCWRAP); + break;*/ + default: + break; + } +} + +void RtfAttributeOutput::ParaVerticalAlign( const SvxParaVertAlignItem& rAlign ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const char* pStr; + switch ( rAlign.GetValue() ) + { + case SvxParaVertAlignItem::TOP: pStr = OOO_STRING_SVTOOLS_RTF_FAHANG; break; + case SvxParaVertAlignItem::BOTTOM: pStr = OOO_STRING_SVTOOLS_RTF_FAVAR; break; + case SvxParaVertAlignItem::CENTER: pStr = OOO_STRING_SVTOOLS_RTF_FACENTER; break; + case SvxParaVertAlignItem::BASELINE: pStr = OOO_STRING_SVTOOLS_RTF_FAROMAN; break; + // default == SvxParaVertAlignItem::AUTOMATIC + default: pStr = OOO_STRING_SVTOOLS_RTF_FAAUTO; break; + } + m_aStyles.append(pStr); +} + +void RtfAttributeOutput::ParaSnapToGrid( const SvxParaGridItem& /*rGrid*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::FormatFrameSize( const SwFmtFrmSize& rSize ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( m_rExport.bOutFlyFrmAttrs && m_rExport.bRTFFlySyntax ) + { + if( rSize.GetWidth() ) + { + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_ABSW); + m_aRunText.append((sal_Int32)rSize.GetWidth()); + } + + if( rSize.GetHeight() ) + { + long nH = rSize.GetHeight(); + if( ATT_FIX_SIZE == rSize.GetHeightSizeType() ) + nH = -nH; + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_ABSH); + m_aRunText.append((sal_Int32)nH); + } + } + else if (m_rExport.bOutPageDescs) + { + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_PGWSXN); + m_aSectionBreaks.append((sal_Int32)rSize.GetWidth()); + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_PGHSXN); + m_aSectionBreaks.append((sal_Int32)rSize.GetHeight()); + if (!m_bBufferSectionBreaks) + m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear(); + } +} + +void RtfAttributeOutput::FormatPaperBin( const SvxPaperBinItem& ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::FormatLRSpace( const SvxLRSpaceItem& rLRSpace ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( !m_rExport.bOutFlyFrmAttrs ) + { + if( m_rExport.bOutPageDescs ) + { + if( rLRSpace.GetLeft() ) + { + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGLSXN); + m_aSectionBreaks.append((sal_Int32)rLRSpace.GetLeft()); + } + if( rLRSpace.GetRight() ) + { + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGRSXN); + m_aSectionBreaks.append((sal_Int32)rLRSpace.GetRight()); + } + if (!m_bBufferSectionBreaks) + m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear(); + } + else + { + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LI); + m_aStyles.append( (sal_Int32) rLRSpace.GetTxtLeft() ); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_RI); + m_aStyles.append( (sal_Int32) rLRSpace.GetRight() ); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LIN); + m_aStyles.append( (sal_Int32) rLRSpace.GetTxtLeft() ); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_RIN); + m_aStyles.append( (sal_Int32) rLRSpace.GetRight() ); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_FI); + m_aStyles.append( (sal_Int32) rLRSpace.GetTxtFirstLineOfst() ); + } + } + else if (rLRSpace.GetLeft() == rLRSpace.GetRight() && m_rExport.bRTFFlySyntax) + { + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_DFRMTXTX; + m_rExport.OutLong( rLRSpace.GetLeft() ); + } +} + +void RtfAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( !m_rExport.bOutFlyFrmAttrs ) + { + if( m_rExport.bOutPageDescs ) + { + + ASSERT( m_rExport.GetCurItemSet(), "Impossible" ); + if ( !m_rExport.GetCurItemSet() ) + return; + + HdFtDistanceGlue aDistances( *m_rExport.GetCurItemSet() ); + + if ( aDistances.HasHeader() ) + { + if( aDistances.dyaTop ) + { + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGTSXN); + m_aSectionBreaks.append((sal_Int32)aDistances.dyaTop); + } + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_HEADERY); + m_aSectionBreaks.append((sal_Int32)aDistances.dyaHdrTop); + } + + if( aDistances.HasFooter() ) + { + if( aDistances.dyaBottom ) + { + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGBSXN); + m_aSectionBreaks.append((sal_Int32)aDistances.dyaBottom); + } + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_FOOTERY); + m_aSectionBreaks.append((sal_Int32)aDistances.dyaHdrBottom); + } + if (!m_bBufferSectionBreaks) + m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear(); + } + else + { + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SB); + m_aStyles.append( (sal_Int32) rULSpace.GetUpper() ); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SA); + m_aStyles.append( (sal_Int32) rULSpace.GetLower() ); + } + } + else if (rULSpace.GetUpper() == rULSpace.GetLower() && m_rExport.bRTFFlySyntax) + { + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_DFRMTXTY; + m_rExport.OutLong( rULSpace.GetLower() ); + } +} + +void RtfAttributeOutput::FormatSurround( const SwFmtSurround& rSurround ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( m_rExport.bOutFlyFrmAttrs && !m_rExport.bRTFFlySyntax ) + { + SwSurround eSurround = rSurround.GetSurround(); + BOOL bGold = SURROUND_IDEAL == eSurround; + if( bGold ) + eSurround = SURROUND_PARALLEL; + RTFSurround aMC( bGold, static_cast< BYTE >(eSurround) ); + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYMAINCNT); + m_aRunText.append( (sal_Int32) aMC.GetValue() ); + } +} + +void RtfAttributeOutput::FormatVertOrientation( const SwFmtVertOrient& rFlyVert ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( m_rExport.bOutFlyFrmAttrs && m_rExport.bRTFFlySyntax ) + { + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_PVPARA); + + switch (rFlyVert.GetVertOrient()) + { + case text::VertOrientation::TOP: + case text::VertOrientation::LINE_TOP: + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_POSYT); + break; + case text::VertOrientation::BOTTOM: + case text::VertOrientation::LINE_BOTTOM: + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_POSYB); + break; + case text::VertOrientation::CENTER: + case text::VertOrientation::LINE_CENTER: + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_POSYC); + break; + case text::VertOrientation::NONE: + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_POSY); + m_aRunText.append((sal_Int32)rFlyVert.GetPos()); + break; + default: + break; + } + } + else if ( !m_rExport.bRTFFlySyntax ) + { + RTFVertOrient aVO( static_cast< USHORT >(rFlyVert.GetVertOrient()), static_cast< USHORT >(rFlyVert.GetRelationOrient()) ); + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYVERT); + m_aRunText.append((sal_Int32)aVO.GetValue()); + } +} + +void RtfAttributeOutput::FormatHorizOrientation( const SwFmtHoriOrient& rFlyHori ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( m_rExport.bOutFlyFrmAttrs && m_rExport.bRTFFlySyntax ) + { + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_PHCOL); + + const char* pS = 0; + switch(rFlyHori.GetHoriOrient()) + { + case text::HoriOrientation::RIGHT: + pS = rFlyHori.IsPosToggle() ? OOO_STRING_SVTOOLS_RTF_POSXO : OOO_STRING_SVTOOLS_RTF_POSXR; + break; + case text::HoriOrientation::LEFT: + pS = rFlyHori.IsPosToggle() ? OOO_STRING_SVTOOLS_RTF_POSXI : OOO_STRING_SVTOOLS_RTF_POSXL; + break; + case text::HoriOrientation::CENTER: + pS = OOO_STRING_SVTOOLS_RTF_POSXC; + break; + case text::HoriOrientation::NONE: + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_POSX); + m_aRunText.append((sal_Int32)rFlyHori.GetPos()); + break; + default: + break; + } + if (pS) + m_aRunText.append(pS); + } else if ( !m_rExport.bRTFFlySyntax ) + { + RTFHoriOrient aHO( static_cast< USHORT >(rFlyHori.GetHoriOrient()), + static_cast< USHORT >(rFlyHori.GetRelationOrient()) ); + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYHORZ); + m_aRunText.append((sal_Int32)aHO.GetValue()); + } +} + +void RtfAttributeOutput::FormatAnchor( const SwFmtAnchor& rAnchor ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( !m_rExport.bRTFFlySyntax ) + { + USHORT nId = static_cast< USHORT >(rAnchor.GetAnchorId()); + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYANCHOR); + m_aRunText.append((sal_Int32)nId); + switch( nId ) + { + case FLY_AT_PAGE: + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYPAGE); + m_aRunText.append((sal_Int32)rAnchor.GetPageNum()); + break; + case FLY_AT_PARA: + case FLY_AS_CHAR: + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYCNTNT); + break; + } + } +} + +void RtfAttributeOutput::FormatBackground( const SvxBrushItem& rBrush ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if( !rBrush.GetColor().GetTransparency() ) + { + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CBPAT); + m_aStyles.append((sal_Int32)m_rExport.GetColor(rBrush.GetColor())); + } +} + +void RtfAttributeOutput::FormatBox( const SvxBoxItem& rBox ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + static USHORT __READONLY_DATA aBorders[] = { + BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT }; + static const sal_Char* aBorderNames[] = { + OOO_STRING_SVTOOLS_RTF_BRDRT, OOO_STRING_SVTOOLS_RTF_BRDRL, OOO_STRING_SVTOOLS_RTF_BRDRB, OOO_STRING_SVTOOLS_RTF_BRDRR }; + + USHORT nDist = rBox.GetDistance(); + + if ( m_rExport.bRTFFlySyntax ) + return; + + if( rBox.GetTop() && rBox.GetBottom() && + rBox.GetLeft() && rBox.GetRight() && + *rBox.GetTop() == *rBox.GetBottom() && + *rBox.GetTop() == *rBox.GetLeft() && + *rBox.GetTop() == *rBox.GetRight() && + nDist == rBox.GetDistance( BOX_LINE_TOP ) && + nDist == rBox.GetDistance( BOX_LINE_LEFT ) && + nDist == rBox.GetDistance( BOX_LINE_BOTTOM ) && + nDist == rBox.GetDistance( BOX_LINE_RIGHT )) + m_aSectionBreaks.append(OutBorderLine( m_rExport, rBox.GetTop(), OOO_STRING_SVTOOLS_RTF_BOX, nDist )); + else + { + const USHORT* pBrd = aBorders; + const sal_Char** pBrdNms = (const sal_Char**)aBorderNames; + for(int i = 0; i < 4; ++i, ++pBrd, ++pBrdNms) + { + if (const SvxBorderLine* pLn = rBox.GetLine(*pBrd)) + { + m_aSectionBreaks.append(OutBorderLine(m_rExport, pLn, *pBrdNms, + rBox.GetDistance(*pBrd))); + } + } + } + + const USHORT* pBrd = aBorders; + const sal_Char** pBrdNms = (const sal_Char**)aBorderNames; + for( int i = 0; i < 4; ++i, ++pBrd, ++pBrdNms ) + { + const SvxBorderLine* pLn = rBox.GetLine( *pBrd ); + if( pLn ) + { + m_aSectionBreaks.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE); + m_aSectionBreaks.append(OutBorderLine( m_rExport, pLn, *pBrdNms )); + m_aSectionBreaks.append("}" OOO_STRING_SVTOOLS_RTF_BRSP); + m_aSectionBreaks.append((sal_Int32)rBox.GetDistance( *pBrd )); + } + } + + if (!m_bBufferSectionBreaks) + m_aStyles.append(m_aSectionBreaks.makeStringAndClear()); +} + +void RtfAttributeOutput::FormatColumns_Impl( USHORT nCols, const SwFmtCol& rCol, bool bEven, SwTwips nPageSize ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLS; + m_rExport.OutLong( nCols ); + + if( bEven ) + { + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLSX; + m_rExport.OutLong( rCol.GetGutterWidth( TRUE ) ); + } + else + { + const SwColumns & rColumns = rCol.GetColumns( ); + for( USHORT n = 0; n < nCols; ) + { + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLNO; + m_rExport.OutLong( n+1 ); + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLW; + m_rExport.OutLong( rCol.CalcPrtColWidth( n, nPageSize ) ); + + if( ++n != nCols ) + { + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLSR; + m_rExport.OutLong( rColumns[ n-1 ]->GetRight() + + rColumns[ n ]->GetLeft() ); + } + } + } +} + +void RtfAttributeOutput::FormatKeep( const SvxFmtKeepItem& rItem ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if( rItem.GetValue() ) + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_KEEPN); +} + +void RtfAttributeOutput::FormatTextGrid( const SwTextGridItem& /*rGrid*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::FormatLineNumbering( const SwFmtLineNumber& rNumbering ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( !rNumbering.IsCount( ) ) + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_NOLINE); +} + +void RtfAttributeOutput::FormatFrameDirection( const SvxFrameDirectionItem& rDirection ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if (!m_rExport.bOutPageDescs) + { + if (rDirection.GetValue() == FRMDIR_HORI_RIGHT_TOP) + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_RTLPAR); + else + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LTRPAR); + } +} + +void RtfAttributeOutput::WriteExpand( const SwField* /*pFld*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::RefField( const SwField& /*rFld*/, const String& /*rRef*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::HiddenField( const SwField& /*rFld*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::SetField( const SwField& /*rFld*/, ww::eField /*eType*/, const String& /*rCmd*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::PostitField( const SwField* pFld ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SwPostItField& rPFld = *(SwPostItField*)pFld; + + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_ATNID " "); + m_aRunText.append(OUStringToOString(OUString(rPFld.GetPar1()), m_rExport.eCurrentEncoding)); + m_aRunText.append("}"); + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_ATNAUTHOR " "); + m_aRunText.append(OUStringToOString(OUString(rPFld.GetPar1()), m_rExport.eCurrentEncoding)); + m_aRunText.append("}"); + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_CHATN); + + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_ANNOTATION); + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_ATNDATE " "); + m_aRunText.append((sal_Int32)sw::ms::DateTime2DTTM(rPFld.GetDate())); + m_aRunText.append('}'); + m_aRunText.append(OUStringToOString(OUString(rPFld.GetTxt()), m_rExport.eCurrentEncoding)); + m_aRunText.append('}'); +} + +bool RtfAttributeOutput::DropdownField( const SwField* /*pFld*/ ) +{ + // this is handled in OutputFlyFrame_Impl() + return true; +} + +RtfAttributeOutput::RtfAttributeOutput( RtfExport &rExport ) + : m_rExport( rExport ), + m_pTableWrt( NULL ), + m_bTableCellOpen( false ), + m_nTableDepth( 0 ), + m_bTblAfterCell( false ), + m_nColBreakNeeded( false ), + m_bBufferSectionBreaks( false ), + m_bBufferSectionHeaders( false ), + m_bLastTable( true ), + m_bWroteCellInfo( false ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); +} + +RtfAttributeOutput::~RtfAttributeOutput() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); +} + +MSWordExportBase& RtfAttributeOutput::GetExport() +{ + return m_rExport; +} + +// These are used by wwFont::WriteRtf() + +/// Start the font. +void RtfAttributeOutput::StartFont( const String& rFamilyName ) const +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << OUStringToOString( OUString( rFamilyName ), m_rExport.eCurrentEncoding ).getStr(); +} + +/// End the font. +void RtfAttributeOutput::EndFont() const +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << ";}"; +} + +/// Alternate name for the font. +void RtfAttributeOutput::FontAlternateName( const String& rName ) const +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_FALT << ' '; + m_rExport.Strm() << OUStringToOString( OUString( rName ), m_rExport.eCurrentEncoding ) << '}'; +} + +/// Font charset. +void RtfAttributeOutput::FontCharset( sal_uInt8 nCharSet ) const +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_FCHARSET; + m_rExport.OutULong( nCharSet ); + m_rExport.Strm() << ' '; +} + +/// Font family. +void RtfAttributeOutput::FontFamilyType( FontFamily eFamily, const wwFont &rFont ) const +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_F; + + const char* pStr = OOO_STRING_SVTOOLS_RTF_FNIL; + switch (eFamily) + { + case FAMILY_ROMAN: + pStr = OOO_STRING_SVTOOLS_RTF_FROMAN; + break; + case FAMILY_SWISS: + pStr = OOO_STRING_SVTOOLS_RTF_FSWISS; + break; + case FAMILY_MODERN: + pStr = OOO_STRING_SVTOOLS_RTF_FMODERN; + break; + case FAMILY_SCRIPT: + pStr = OOO_STRING_SVTOOLS_RTF_FSCRIPT; + break; + case FAMILY_DECORATIVE: + pStr = OOO_STRING_SVTOOLS_RTF_FDECOR; + break; + default: + break; + } + m_rExport.OutULong(m_rExport.maFontHelper.GetId(rFont)) << pStr; +} + +/// Font pitch. +void RtfAttributeOutput::FontPitchType( FontPitch ePitch ) const +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_FPRQ; + + USHORT nVal = 0; + switch (ePitch) + { + case PITCH_FIXED: + nVal = 1; + break; + case PITCH_VARIABLE: + nVal = 2; + break; + default: + break; + } + m_rExport.OutULong(nVal); +} + +static bool IsEMF(const sal_uInt8 *pGraphicAry, unsigned long nSize) +{ + if (pGraphicAry && (nSize > 0x2c )) + { + // check the magic number + if ( + (pGraphicAry[0x28] == 0x20 ) && (pGraphicAry[0x29] == 0x45) && + (pGraphicAry[0x2a] == 0x4d ) && (pGraphicAry[0x2b] == 0x46) + ) + { + //emf detected + return true; + } + } + return false; +} + +static bool StripMetafileHeader(const sal_uInt8 *&rpGraphicAry, unsigned long &rSize) +{ + if (rpGraphicAry && (rSize > 0x22)) + { + if ( + (rpGraphicAry[0] == 0xd7) && (rpGraphicAry[1] == 0xcd) && + (rpGraphicAry[2] == 0xc6) && (rpGraphicAry[3] == 0x9a) + ) + { // we have to get rid of the metafileheader + rpGraphicAry += 22; + rSize -= 22; + return true; + } + } + return false; +} + +static OString WriteHex(const sal_uInt8* pData, sal_uInt32 nSize, sal_uInt32 nLimit = 64) +{ + OStringBuffer aRet; + + sal_uInt32 nBreak = 0; + for (sal_uInt32 i = 0; i < nSize; i++) + { + OString sNo = OString::valueOf(sal_Int32(pData[i]), 16); + if (sNo.getLength() < 2) + aRet.append('0'); + aRet.append(sNo); + if (++nBreak == nLimit) + { + aRet.append(RtfExport::sNewLine); + nBreak = 0; + } + } + + return aRet.makeStringAndClear(); +} + +static OString WriteHex(sal_Int32 nNum) +{ + return WriteHex((sal_uInt8*)&nNum, sizeof(sal_Int32)); +} + +static OString WriteHex(OString sString) +{ + OStringBuffer aRet; + + aRet.append(WriteHex(sString.getLength()+1)); + aRet.append(WriteHex((sal_uInt8*)sString.getStr(), sString.getLength()+1)); + + return aRet.makeStringAndClear(); +} + +void lcl_AppendSP( OStringBuffer& rBuffer, + const char cName[], + const ::rtl::OUString& rValue, + const RtfExport& rExport ) +{ + rBuffer.append( "{" OOO_STRING_SVTOOLS_RTF_SP "{" ); // "{\sp{" + rBuffer.append( OOO_STRING_SVTOOLS_RTF_SN " " );//" \sn " + rBuffer.append( cName ); //"PropName" + rBuffer.append( "}{" OOO_STRING_SVTOOLS_RTF_SV " " ); +// "}{ \sv " + rBuffer.append( rExport.OutString( rValue, rExport.eCurrentEncoding ) ); + rBuffer.append( "}}" ); +} + +static OString ExportPICT( const SwFlyFrmFmt* pFlyFrmFmt, const Size &rOrig, const Size &rRendered, const Size &rMapped, + const SwCropGrf &rCr, const char *pBLIPType, const sal_uInt8 *pGraphicAry, + unsigned long nSize, const RtfExport& rExport ) +{ + OStringBuffer aRet; + bool bIsWMF = (const char *)pBLIPType == (const char *)OOO_STRING_SVTOOLS_RTF_WMETAFILE ? true : false; + if (pBLIPType && nSize && pGraphicAry) + { + aRet.append("{" OOO_STRING_SVTOOLS_RTF_PICT); + + if( pFlyFrmFmt ) + { + String sDescription = pFlyFrmFmt->GetObjDescription(); + //write picture properties - wzDescription at first + //looks like: "{\*\picprop{\sp{\sn PropertyName}{\sv PropertyValue}}}" + aRet.append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_PICPROP );//"{\*\picprop + lcl_AppendSP( aRet, "wzDescription", sDescription, rExport ); + String sName = pFlyFrmFmt->GetObjTitle(); + lcl_AppendSP( aRet, "wzName", sName, rExport ); + aRet.append( "}" ); //"}" + } + + long nXCroppedSize = rOrig.Width()-(rCr.GetLeft() + rCr.GetRight()); + long nYCroppedSize = rOrig.Height()-(rCr.GetTop() + rCr.GetBottom()); + /* #127543#: Graphic with a zero height or width, typically copied from webpages, caused + crashes. */ + if( !nXCroppedSize ) + nXCroppedSize = 100; + if( !nYCroppedSize ) + nYCroppedSize = 100; + + //Given the original size and taking cropping into account + //first, how much has the original been scaled to get the + //final rendered size + aRet.append(OOO_STRING_SVTOOLS_RTF_PICSCALEX); + aRet.append((sal_Int32)((100 * rRendered.Width()) / nXCroppedSize)); + aRet.append(OOO_STRING_SVTOOLS_RTF_PICSCALEY); + aRet.append((sal_Int32)((100 * rRendered.Height()) / nYCroppedSize)); + + aRet.append(OOO_STRING_SVTOOLS_RTF_PICCROPL); + aRet.append((sal_Int32)rCr.GetLeft()); + aRet.append(OOO_STRING_SVTOOLS_RTF_PICCROPR); + aRet.append((sal_Int32)rCr.GetRight()); + aRet.append(OOO_STRING_SVTOOLS_RTF_PICCROPT); + aRet.append((sal_Int32)rCr.GetTop()); + aRet.append(OOO_STRING_SVTOOLS_RTF_PICCROPB); + aRet.append((sal_Int32)rCr.GetBottom()); + + aRet.append(OOO_STRING_SVTOOLS_RTF_PICW); + aRet.append((sal_Int32)rMapped.Width()); + aRet.append(OOO_STRING_SVTOOLS_RTF_PICH); + aRet.append((sal_Int32)rMapped.Height()); + + aRet.append(OOO_STRING_SVTOOLS_RTF_PICWGOAL); + aRet.append((sal_Int32)rOrig.Width()); + aRet.append(OOO_STRING_SVTOOLS_RTF_PICHGOAL); + aRet.append((sal_Int32)rOrig.Height()); + + aRet.append(pBLIPType); + if (bIsWMF) + { + aRet.append((sal_Int32)8); + StripMetafileHeader(pGraphicAry, nSize); + } + aRet.append(RtfExport::sNewLine); + aRet.append(WriteHex(pGraphicAry, nSize)); + aRet.append('}'); + } + return aRet.makeStringAndClear(); +} + +void RtfAttributeOutput::FlyFrameOLEData( SwOLENode& rOLENode ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + uno::Reference < embed::XEmbeddedObject > xObj(const_cast<SwOLENode&>(rOLENode).GetOLEObj().GetOleRef()); + sal_Int64 nAspect = rOLENode.GetAspect(); + svt::EmbeddedObjectRef aObjRef( xObj, nAspect ); + SvGlobalName aObjName(aObjRef->getClassID()); + + if (SotExchange::IsMath(aObjName)) + { + // ObjectHeader + m_aRunText.append(WriteHex(0x00000501)); // OLEVersion + m_aRunText.append(WriteHex(0x00000002)); // FormatID + m_aRunText.append(WriteHex(OString("Equation.3"))); // ClassName + m_aRunText.append(WriteHex(0x00000000)); // TopicName + m_aRunText.append(WriteHex(0x00000000)); // ItemName + + // NativeData + SvMemoryStream *pStream = new SvMemoryStream; + SvStorage* pStorage = new SvStorage(*pStream); + m_rExport.pOLEExp->ExportOLEObject( aObjRef, *pStorage ); + pStream->Seek(STREAM_SEEK_TO_END); + sal_uInt32 nNativeDataSize = pStream->Tell(); + const sal_uInt8* pNativeData = (sal_uInt8*)pStream->GetData(); + m_aRunText.append(WriteHex(nNativeDataSize)); + m_aRunText.append(RtfExport::sNewLine); + m_aRunText.append(WriteHex(pNativeData, nNativeDataSize, 126)); + m_aRunText.append(RtfExport::sNewLine); + delete pStream; + + // MetaFilePresentationObject + pStream = new SvMemoryStream; + Graphic* pGraphic = rOLENode.GetGraphic(); + if (GraphicConverter::Export(*pStream, *pGraphic, CVT_WMF) != ERRCODE_NONE) + OSL_ENSURE(false, "failed to export the presentation data"); + pStream->Seek(STREAM_SEEK_TO_END); + sal_uInt32 nPresentationDataSize = pStream->Tell(); + const sal_uInt8* pPresentationData = (sal_uInt8*)pStream->GetData(); + m_aRunText.append(WriteHex(pPresentationData, nPresentationDataSize, 126)); + } +} + +void RtfAttributeOutput::FlyFrameOLE( const SwFlyFrmFmt* pFlyFrmFmt, SwOLENode& rOLENode, const Size& rSize ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + SvMemoryStream aStream; + const sal_uInt8* pGraphicAry = 0; + sal_uInt32 nSize = 0; + Graphic* pGraphic = rOLENode.GetGraphic(); + + Size aSize(sw::util::GetSwappedInSize(rOLENode)); + Size aRendered(aSize); + aRendered.Width() = rSize.Width(); + aRendered.Height() = rSize.Height(); + Size aMapped(pGraphic->GetPrefSize()); + const SwCropGrf &rCr = (const SwCropGrf &)rOLENode.GetAttr(RES_GRFATR_CROPGRF); + const sal_Char* pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE; + + if (GraphicConverter::Export(aStream, *pGraphic, CVT_WMF) != ERRCODE_NONE) + OSL_ENSURE(false, "failed to export the graphic"); + aStream.Seek(STREAM_SEEK_TO_END); + nSize = aStream.Tell(); + pGraphicAry = (sal_uInt8*)aStream.GetData(); + + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_OBJECT OOO_STRING_SVTOOLS_RTF_OBJEMB); + + // export the object data in the appropriate format; RTF requires the usage of the OLE 1.0 format + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_OBJDATA " "); + FlyFrameOLEData(rOLENode); + m_aRunText.append("}{" OOO_STRING_SVTOOLS_RTF_RESULT); + + SwTwips nHeight = aSize.Height(); + nHeight/=20; //nHeight was in twips, want it in half points, but then half of total height. + long nFontHeight = ((const SvxFontHeightItem&)m_rExport.GetItem(RES_CHRATR_FONTSIZE)).GetHeight(); + nHeight-=nFontHeight/20; + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_DN).append(nHeight); + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT); + m_aRunText.append(ExportPICT( pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport )); + m_aRunText.append("}}}}"); +} + +void RtfAttributeOutput::FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const SwGrfNode& rGrfNode, const Size& rSize ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + SvMemoryStream aStream; + const sal_uInt8* pGraphicAry = 0; + sal_uInt32 nSize = 0; + + Graphic aGraphic(rGrfNode.GetGrf()); + + // If there is no graphic there is not much point in parsing it + if(aGraphic.GetType()==GRAPHIC_NONE) + return; + + GfxLink aGraphicLink; + const sal_Char* pBLIPType = 0; + if (aGraphic.IsLink()) + { + aGraphicLink = aGraphic.GetLink(); + nSize = aGraphicLink.GetDataSize(); + pGraphicAry = aGraphicLink.GetData(); + switch (aGraphicLink.GetType()) + { + case GFX_LINK_TYPE_NATIVE_JPG: + pBLIPType = OOO_STRING_SVTOOLS_RTF_JPEGBLIP; + break; + case GFX_LINK_TYPE_NATIVE_PNG: + pBLIPType = OOO_STRING_SVTOOLS_RTF_PNGBLIP; + break; + case GFX_LINK_TYPE_NATIVE_WMF: + pBLIPType = + IsEMF(pGraphicAry, nSize) ? OOO_STRING_SVTOOLS_RTF_EMFBLIP : OOO_STRING_SVTOOLS_RTF_WMETAFILE; + break; + default: + break; + } + } + + GraphicType eGraphicType = aGraphic.GetType(); + if (!pGraphicAry) + { + if (ERRCODE_NONE == GraphicConverter::Export(aStream, aGraphic, + (eGraphicType == GRAPHIC_BITMAP) ? CVT_PNG : CVT_WMF)) + { + pBLIPType = (eGraphicType == GRAPHIC_BITMAP) ? + OOO_STRING_SVTOOLS_RTF_PNGBLIP : OOO_STRING_SVTOOLS_RTF_WMETAFILE; + aStream.Seek(STREAM_SEEK_TO_END); + nSize = aStream.Tell(); + pGraphicAry = (sal_uInt8*)aStream.GetData(); + } + } + + Size aMapped(eGraphicType == GRAPHIC_BITMAP ? aGraphic.GetSizePixel() : aGraphic.GetPrefSize()); + + const SwCropGrf &rCr = (const SwCropGrf &)rGrfNode.GetAttr(RES_GRFATR_CROPGRF); + + //Get original size in twips + Size aSize(sw::util::GetSwappedInSize(rGrfNode)); + Size aRendered(aSize); + aRendered.Width() = rSize.Width(); + aRendered.Height() = rSize.Height(); + + /* + If the graphic is not of type WMF then we will have to store two + graphics, one in the native format wrapped in shppict, and the other in + the wmf format wrapped in nonshppict, so as to keep wordpad happy. If its + a wmf already then we don't need any such wrapping + */ + bool bIsWMF = (const sal_Char*)pBLIPType == (const sal_Char*)OOO_STRING_SVTOOLS_RTF_WMETAFILE ? true : false; + if (!bIsWMF) + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT); + + if (pBLIPType) + m_aRunText.append(ExportPICT( pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport)); + else + { + aStream.Seek(0); + GraphicConverter::Export(aStream, aGraphic, CVT_WMF); + pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE; + aStream.Seek(STREAM_SEEK_TO_END); + nSize = aStream.Tell(); + pGraphicAry = (sal_uInt8*)aStream.GetData(); + + m_aRunText.append(ExportPICT(pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport )); + } + + if (!bIsWMF) + { + m_aRunText.append("}" "{" OOO_STRING_SVTOOLS_RTF_NONSHPPICT); + + aStream.Seek(0); + GraphicConverter::Export(aStream, aGraphic, CVT_WMF); + pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE; + aStream.Seek(STREAM_SEEK_TO_END); + nSize = aStream.Tell(); + pGraphicAry = (sal_uInt8*)aStream.GetData(); + + m_aRunText.append(ExportPICT(pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport )); + + m_aRunText.append('}'); + } + + m_aRunText.append(m_rExport.sNewLine); +} + +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx new file mode 100644 index 0000000000..0d153b843f --- /dev/null +++ b/sw/source/filter/ww8/rtfattributeoutput.hxx @@ -0,0 +1,590 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2010 Miklos Vajna. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _RTFATTRIBUTEOUTPUT_HXX_ +#define _RTFATTRIBUTEOUTPUT_HXX_ + +#include <set> +#include "attributeoutputbase.hxx" +#include "fields.hxx" + +#include <vcl/vclenum.hxx> + +#include <fldbas.hxx> +#include <rtl/strbuf.hxx> + +#include <vector> + +class RtfExport; + +class SwGrfNode; +class SwOLENode; +class SdrObject; +class SwFlyFrmFmt; + +class RtfAttributeOutput : public AttributeOutputBase +{ +public: + /// Export the state of RTL/CJK. + virtual void RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript ); + + /// Start of the paragraph. + virtual void StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo ); + + /// End of the paragraph. + virtual void EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ); + + /// Empty paragraph. + virtual void EmptyParagraph(); + + /// Called before we start outputting the attributes. + virtual void StartParagraphProperties( const SwTxtNode& rNode ); + + /// Called after we end outputting the attributes. + virtual void EndParagraphProperties(); + + /// Start of the text run. + virtual void StartRun( const SwRedlineData* pRedlineData ); + + /// End of the text run. + virtual void EndRun(); + + /// Called before we start outputting the attributes. + virtual void StartRunProperties(); + + /// Called after we end outputting the attributes. + virtual void EndRunProperties( const SwRedlineData* pRedlineData ); + + /// Output text (inside a run). + virtual void RunText( const String& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8 ); + + // Access to (anyway) private buffers, used by the sdr exporter + rtl::OStringBuffer& RunText(); + rtl::OStringBuffer& Styles(); + + /// Output text (without markup). + virtual void RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ); + + /// Output ruby start. + virtual void StartRuby( const SwTxtNode& rNode, const SwFmtRuby& rRuby ); + + /// Output ruby end. + virtual void EndRuby(); + + /// Output URL start. + virtual bool StartURL( const String& rUrl, const String& rTarget ); + + /// Output URL end. + virtual bool EndURL(); + + virtual void FieldVanish( const String& rTxt, ww::eField eType ); + + /// Output redlining. + /// + /// The common attribute that can be among the run properties. + virtual void Redline( const SwRedlineData* pRedline ); + + virtual void FormatDrop( const SwTxtNode& rNode, const SwFmtDrop& rSwFmtDrop, USHORT nStyle, ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ); + + /// Output style. + virtual void ParagraphStyle( USHORT nStyle ); + + virtual void TableInfoCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t pNodeInfo ); + + virtual void TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner ); + + virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableRowEnd( sal_uInt32 nDepth ); + + /// Start of the styles table. + virtual void StartStyles(); + + /// End of the styles table. + virtual void EndStyles( USHORT nNumberOfStyles ); + + /// Write default style. + virtual void DefaultStyle( USHORT nStyle ); + + /// Start of a style in the styles table. + virtual void StartStyle( const String& rName, bool bPapFmt, + USHORT nBase, USHORT nNext, USHORT nWwId, USHORT nId ); + + /// End of a style in the styles table. + virtual void EndStyle(); + + /// Start of (paragraph or run) properties of a style. + virtual void StartStyleProperties( bool bParProp, USHORT nStyle ); + + /// End of (paragraph or run) properties of a style. + virtual void EndStyleProperties( bool bParProp ); + + /// Numbering rule and Id. + virtual void OutlineNumbering( BYTE nLvl, const SwNumFmt &rNFmt, const SwFmt &rFmt ); + + /// Page break + /// As a paragraph property - the paragraph should be on the next page. + virtual void PageBreakBefore( bool bBreak ); + + /// Write a section break + /// msword::ColumnBreak or msword::PageBreak + virtual void SectionBreak( BYTE nC, const WW8_SepInfo* pSectionInfo = NULL ); + + /// Start of the section properties. + virtual void StartSection(); + + /// End of the section properties. + virtual void EndSection(); + + /// Protection of forms. + virtual void SectionFormProtection( bool bProtected ); + + /// Numbering of the lines in the document. + virtual void SectionLineNumbering( ULONG nRestartNo, const SwLineNumberInfo& rLnNumInfo ); + + /// Has different headers/footers for the title page. + virtual void SectionTitlePage(); + + /// Description of the page borders. + virtual void SectionPageBorders( const SwFrmFmt* pFmt, const SwFrmFmt* pFirstPageFmt ); + + /// Columns populated from right/numbers on the right side? + virtual void SectionBiDi( bool bBiDi ); + + /// The style of the page numbers. + /// + /// nPageRestartNumberr being 0 means no restart. + virtual void SectionPageNumbering( USHORT nNumType, USHORT nPageRestartNumber ); + + /// The type of breaking. + virtual void SectionType( BYTE nBreakCode ); + + /// Definition of a numbering instance. + virtual void NumberingDefinition( USHORT nId, const SwNumRule &rRule ); + + /// Start of the abstract numbering definition instance. + virtual void StartAbstractNumbering( USHORT nId ); + + /// End of the abstract numbering definition instance. + virtual void EndAbstractNumbering(); + + /// All the numbering level information. + virtual void NumberingLevel( BYTE nLevel, + USHORT nStart, + USHORT nNumberingType, + SvxAdjust eAdjust, + const BYTE *pNumLvlPos, + BYTE nFollow, + const wwFont *pFont, + const SfxItemSet *pOutSet, + sal_Int16 nIndentAt, + sal_Int16 nFirstLineIndex, + sal_Int16 nListTabPos, + const String &rNumberingString ); + + void WriteField_Impl( const SwField* pFld, ww::eField eType, const String& rFldCmd, BYTE nMode ); + void WriteBookmarks_Impl( std::vector< rtl::OUString >& rStarts, std::vector< rtl::OUString >& rEnds ); + void WriteHeaderFooter_Impl( const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr ); + +protected: + /// Output frames - the implementation. + virtual void OutputFlyFrame_Impl( const sw::Frame& rFmt, const Point& rNdTopLeft ); + + /// Sfx item Sfx item RES_CHRATR_CASEMAP + virtual void CharCaseMap( const SvxCaseMapItem& rCaseMap ); + + /// Sfx item Sfx item RES_CHRATR_COLOR + virtual void CharColor( const SvxColorItem& rColor); + + /// Sfx item Sfx item RES_CHRATR_CONTOUR + virtual void CharContour( const SvxContourItem& rContour ); + + /// Sfx item RES_CHRATR_CROSSEDOUT + virtual void CharCrossedOut( const SvxCrossedOutItem& rCrossedOut ); + + /// Sfx item RES_CHRATR_ESCAPEMENT + virtual void CharEscapement( const SvxEscapementItem& rEscapement ); + + /// Sfx item RES_CHRATR_FONT + virtual void CharFont( const SvxFontItem& rFont ); + + /// Sfx item RES_CHRATR_FONTSIZE + virtual void CharFontSize( const SvxFontHeightItem& rFontSize ); + + /// Sfx item RES_CHRATR_KERNING + virtual void CharKerning( const SvxKerningItem& rKerning ); + + /// Sfx item RES_CHRATR_LANGUAGE + virtual void CharLanguage( const SvxLanguageItem& rLanguage ); + + /// Sfx item RES_CHRATR_POSTURE + virtual void CharPosture( const SvxPostureItem& rPosture ); + + /// Sfx item RES_CHRATR_SHADOWED + virtual void CharShadow( const SvxShadowedItem& rShadow ); + + /// Sfx item RES_CHRATR_UNDERLINE + virtual void CharUnderline( const SvxUnderlineItem& rUnderline ); + + /// Sfx item RES_CHRATR_WEIGHT + virtual void CharWeight( const SvxWeightItem& rWeight ); + + /// Sfx item RES_CHRATR_AUTOKERN + virtual void CharAutoKern( const SvxAutoKernItem& ); + + /// Sfx item RES_CHRATR_BLINK + virtual void CharAnimatedText( const SvxBlinkItem& rBlink ); + + /// Sfx item RES_CHRATR_BACKGROUND + virtual void CharBackground( const SvxBrushItem& rBrush ); + + /// Sfx item RES_CHRATR_CJK_FONT + virtual void CharFontCJK( const SvxFontItem& rFont ); + + /// Sfx item RES_CHRATR_CJK_FONTSIZE + virtual void CharFontSizeCJK( const SvxFontHeightItem& rFontSize ); + + /// Sfx item RES_CHRATR_CJK_LANGUAGE + virtual void CharLanguageCJK( const SvxLanguageItem& rLanguageItem ); + + /// Sfx item RES_CHRATR_CJK_POSTURE + virtual void CharPostureCJK( const SvxPostureItem& rPosture ); + + /// Sfx item RES_CHRATR_CJK_WEIGHT + virtual void CharWeightCJK( const SvxWeightItem& rWeight ); + + /// Sfx item RES_CHRATR_CTL_FONT + virtual void CharFontCTL( const SvxFontItem& rFont ); + + /// Sfx item RES_CHRATR_CTL_FONTSIZE + virtual void CharFontSizeCTL( const SvxFontHeightItem& rFontSize ); + + /// Sfx item RES_CHRATR_CTL_LANGUAGE + virtual void CharLanguageCTL( const SvxLanguageItem& rLanguageItem ); + + /// Sfx item RES_CHRATR_CTL_POSTURE + virtual void CharPostureCTL( const SvxPostureItem& rWeight ); + + /// Sfx item RES_CHRATR_CTL_WEIGHT + virtual void CharWeightCTL( const SvxWeightItem& rWeight ); + + /// Sfx item RES_CHRATR_ROTATE + virtual void CharRotate( const SvxCharRotateItem& rRotate ); + + /// Sfx item RES_CHRATR_EMPHASIS_MARK + virtual void CharEmphasisMark( const SvxEmphasisMarkItem& rEmphasisMark ); + + /// Sfx item RES_CHRATR_TWO_LINES + virtual void CharTwoLines( const SvxTwoLinesItem& rTwoLines ); + + /// Sfx item RES_CHRATR_SCALEW + virtual void CharScaleWidth( const SvxCharScaleWidthItem& rScaleWidth ); + + /// Sfx item RES_CHRATR_RELIEF + virtual void CharRelief( const SvxCharReliefItem& rRelief); + + /// Sfx item RES_CHRATR_HIDDEN + virtual void CharHidden( const SvxCharHiddenItem& rHidden ); + + /// Sfx item RES_TXTATR_INETFMT + virtual void TextINetFormat( const SwFmtINetFmt& ); + + /// Sfx item RES_TXTATR_CHARFMT + virtual void TextCharFormat( const SwFmtCharFmt& ); + + /// Sfx item RES_TXTATR_FTN + virtual void TextFootnote_Impl( const SwFmtFtn& ); + + /// Sfx item RES_PARATR_LINESPACING + virtual void ParaLineSpacing_Impl( short nSpace, short nMulti ); + + /// Sfx item RES_PARATR_ADJUST + virtual void ParaAdjust( const SvxAdjustItem& rAdjust ); + + /// Sfx item RES_PARATR_SPLIT + virtual void ParaSplit( const SvxFmtSplitItem& rSplit ); + + /// Sfx item RES_PARATR_WIDOWS + virtual void ParaWidows( const SvxWidowsItem& rWidows ); + + /// Sfx item RES_PARATR_TABSTOP + virtual void ParaTabStop( const SvxTabStopItem& rTabStop ); + + /// Sfx item RES_PARATR_HYPHENZONE + virtual void ParaHyphenZone( const SvxHyphenZoneItem& ); + + /// Sfx item RES_PARATR_NUMRULE + virtual void ParaNumRule_Impl( const SwTxtNode *pTxtNd, sal_Int32 nLvl, sal_Int32 nNumId ); + + /// Sfx item RES_PARATR_SCRIPTSPACE + virtual void ParaScriptSpace( const SfxBoolItem& ); + + /// Sfx item RES_PARATR_VERTALIGN + virtual void ParaVerticalAlign( const SvxParaVertAlignItem& rAlign ); + + /// Sfx item RES_PARATR_SNAPTOGRID + virtual void ParaSnapToGrid( const SvxParaGridItem& ); + + /// Sfx item RES_FRM_SIZE + virtual void FormatFrameSize( const SwFmtFrmSize& ); + + /// Sfx item RES_PAPER_BIN + virtual void FormatPaperBin( const SvxPaperBinItem& ); + + /// Sfx item RES_LR_SPACE + virtual void FormatLRSpace( const SvxLRSpaceItem& rLRSpace ); + + /// Sfx item RES_UL_SPACE + virtual void FormatULSpace( const SvxULSpaceItem& rULSpace ); + + /// Sfx item RES_SURROUND + virtual void FormatSurround( const SwFmtSurround& ); + + /// Sfx item RES_VERT_ORIENT + virtual void FormatVertOrientation( const SwFmtVertOrient& ); + + /// Sfx item RES_HORI_ORIENT + virtual void FormatHorizOrientation( const SwFmtHoriOrient& ); + + /// Sfx item RES_ANCHOR + virtual void FormatAnchor( const SwFmtAnchor& ); + + /// Sfx item RES_BACKGROUND + virtual void FormatBackground( const SvxBrushItem& ); + + /// Sfx item RES_BOX + virtual void FormatBox( const SvxBoxItem& ); + + /// Sfx item RES_COL + virtual void FormatColumns_Impl( USHORT nCols, const SwFmtCol & rCol, bool bEven, SwTwips nPageSize ); + + /// Sfx item RES_KEEP + virtual void FormatKeep( const SvxFmtKeepItem& ); + + /// Sfx item RES_TEXTGRID + virtual void FormatTextGrid( const SwTextGridItem& ); + + /// Sfx item RES_LINENUMBER + virtual void FormatLineNumbering( const SwFmtLineNumber& ); + + /// Sfx item RES_FRAMEDIR + virtual void FormatFrameDirection( const SvxFrameDirectionItem& ); + + /// Write the expanded field + virtual void WriteExpand( const SwField* pFld ); + + virtual void RefField( const SwField& rFld, const String& rRef ); + virtual void HiddenField( const SwField& rFld ); + virtual void SetField( const SwField& rFld, ww::eField eType, const String& rCmd ); + virtual void PostitField( const SwField* pFld ); + virtual bool DropdownField( const SwField* pFld ); + + /// Reference to the export, where to get the data from + RtfExport &m_rExport; + +private: + + /// Output graphic fly frames. + void FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const SwGrfNode& rGrfNode, const Size& rSize ); + void FlyFrameOLE( const SwFlyFrmFmt* pFlyFrmFmt, SwOLENode& rOLENode, const Size& rSize ); + void FlyFrameOLEData( SwOLENode& rOLENode ); + + /* + * Table methods. + */ + + void InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + void StartTable( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + void StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + void StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + void TableCellProperties( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + void EndTableCell( ); + + void EndTableRow( ); + + void EndTable(); + + /// End cell, row, and even the entire table if necessary. + void FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer_t pInner, bool bForceEmptyParagraph = false ); + + void WriteTextFootnoteNumStr(const SwFmtFtn& rFootnote); + + /* + * Current style name and its ID. + */ + String m_rStyleName; + USHORT m_nStyleId; + /* + * Current list ID. + */ + USHORT m_nListId; + /* + * This is needed because the call order is: run text, run properties, paragraph properties. + * What we need is the opposite. + */ + rtl::OStringBuffer m_aRun; + rtl::OStringBuffer m_aRunText; + /* + * This is written after runs. + */ + rtl::OStringBuffer m_aAfterRuns; + /* + * Same for colors and stylesheets: first we just want to output colors, + * need to buffer the stylesheet table to output it after the color one. + */ + rtl::OStringBuffer m_aStylesheet; + /* + * This one just holds the style commands in the current style. + */ + rtl::OStringBuffer m_aStyles; + /* + * This is the same as m_aStyles but the conents of it is written last. + */ + rtl::OStringBuffer m_aStylesEnd; + + /* + * We just get a "end of strike" mark at the end of strike, store here what to finish: single or double strike. + */ + bool m_bStrikeDouble; + + /* + * The current table helper. + */ + SwWriteTable *m_pTableWrt; + + /* + * Remember if we are in an open cell, or not. + */ + bool m_bTableCellOpen; + + /* + * Remember the current table depth. + */ + sal_uInt32 m_nTableDepth; + + /* + * Remember if we wrote a \cell or not. + */ + bool m_bTblAfterCell; + + /* + * For late output of row definitions. + */ + rtl::OStringBuffer m_aRowDefs; + + /* + * Is a column break needed after the next \par? + */ + bool m_nColBreakNeeded; + + /* + * If section breaks should be buffered to m_aSectionBreaks + */ + bool m_bBufferSectionBreaks; + rtl::OStringBuffer m_aSectionBreaks; + + /* + * If section headers (and footers) should be buffered to + * m_aSectionHeaders. + */ + bool m_bBufferSectionHeaders; + rtl::OStringBuffer m_aSectionHeaders; + + /* + * Support for starting multiple tables at the same cell. + * If the current table is the last started one. + */ + bool m_bLastTable; + /* + * List of already started but not yet defined tables (need to be defined + * after the nested tables). + */ + std::vector< rtl::OString > m_aTables; + /* + * If cell info is already output. + */ + bool m_bWroteCellInfo; + +public: + RtfAttributeOutput( RtfExport &rExport ); + + virtual ~RtfAttributeOutput(); + + /// Return the right export class. + virtual MSWordExportBase& GetExport(); + + rtl::OStringBuffer m_aTabStop; + + // These are used by wwFont::WriteRtf() + /// Start the font. + void StartFont( const String& rFamilyName ) const; + + /// End the font. + void EndFont() const; + + /// Alternate name for the font. + void FontAlternateName( const String& rName ) const; + + /// Font charset. + void FontCharset( sal_uInt8 nCharSet ) const; + + /// Font family. + void FontFamilyType( FontFamily eFamily, const wwFont &rFont ) const; + + /// Font pitch. + void FontPitchType( FontPitch ePitch ) const; +}; + +#endif // _RTFATTRIBUTEOUTPUT_HXX_ + +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx new file mode 100644 index 0000000000..b6192e1027 --- /dev/null +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -0,0 +1,1269 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2010 Miklos Vajna. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "rtfexport.hxx" +#include "rtfexportfilter.hxx" +#include "rtfsdrexport.hxx" + +#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> +#include <com/sun/star/document/XDocumentProperties.hpp> +#include <com/sun/star/i18n/ScriptType.hdl> +#include <com/sun/star/frame/XModel.hpp> + +#include <map> +#include <algorithm> +#include <iostream> +#include <iomanip> +#include <string> +#include <sstream> + +#include <IMark.hxx> +#include <docsh.hxx> +#include <ndtxt.hxx> +#include <wrtww8.hxx> +#include <fltini.hxx> +#include <fmtline.hxx> +#include <fmtpdsc.hxx> +#include <frmfmt.hxx> +#include <section.hxx> +#include <pagedesc.hxx> +#include <swtable.hxx> +#include <fmtfsize.hxx> +#include <frmatr.hxx> +#include <ftninfo.hxx> +#include <fmthdft.hxx> +#include <editeng/fontitem.hxx> +#include <editeng/colritem.hxx> +#include <editeng/udlnitem.hxx> +#include <editeng/boxitem.hxx> +#include <editeng/brshitem.hxx> +#include <editeng/shaditem.hxx> +#include <editeng/lrspitem.hxx> +#include <editeng/ulspitem.hxx> +#include <editeng/paperinf.hxx> +#include <editeng/protitem.hxx> + +#include <docary.hxx> +#include <numrule.hxx> +#include <charfmt.hxx> +#include <lineinfo.hxx> +#include <swmodule.hxx> + +#include "ww8par.hxx" +#include "ww8scan.hxx" + +#include <comphelper/string.hxx> +#include <rtl/ustrbuf.hxx> +#include <vcl/font.hxx> +#include <svtools/rtfkeywd.hxx> +#include <unotools/configmgr.hxx> + +using namespace ::comphelper; +using namespace ::com::sun::star; + +using rtl::OString; +using rtl::OUString; +using rtl::OStringBuffer; +using rtl::OUStringBuffer; + +using sw::mark::IMark; + +#if defined(UNX) +const sal_Char RtfExport::sNewLine = '\012'; +#else +const sal_Char __FAR_DATA RtfExport::sNewLine[] = "\015\012"; +#endif + +// the default text encoding for the export, if it doesn't fit unicode will +// be used +#define DEF_ENCODING RTL_TEXTENCODING_ASCII_US + +AttributeOutputBase& RtfExport::AttrOutput() const +{ + return *m_pAttrOutput; +} + +MSWordSections& RtfExport::Sections() const +{ + return *m_pSections; +} + +RtfSdrExport& RtfExport::SdrExporter() const +{ + return *m_pSdrExport; +} + +bool RtfExport::CollapseScriptsforWordOk( USHORT nScript, USHORT nWhich ) +{ + // FIXME is this actually true for rtf? - this is copied from DOCX + if ( nScript == i18n::ScriptType::ASIAN ) + { + // for asian in ww8, there is only one fontsize + // and one fontstyle (posture/weight) + switch ( nWhich ) + { + case RES_CHRATR_FONTSIZE: + case RES_CHRATR_POSTURE: + case RES_CHRATR_WEIGHT: + return false; + default: + break; + } + } + else if ( nScript != i18n::ScriptType::COMPLEX ) + { + // for western in ww8, there is only one fontsize + // and one fontstyle (posture/weight) + switch ( nWhich ) + { + case RES_CHRATR_CJK_FONTSIZE: + case RES_CHRATR_CJK_POSTURE: + case RES_CHRATR_CJK_WEIGHT: + return false; + default: + break; + } + } + return true; +} + +void RtfExport::AppendBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + std::vector< OUString > aStarts; + std::vector< OUString > aEnds; + + IMarkVector aMarks; + if ( GetBookmarks( rNode, nAktPos, nAktPos + nLen, aMarks ) ) + { + for ( IMarkVector::const_iterator it = aMarks.begin(), end = aMarks.end(); + it < end; ++it ) + { + IMark* pMark = (*it); + xub_StrLen nStart = pMark->GetMarkStart().nContent.GetIndex(); + xub_StrLen nEnd = pMark->GetMarkEnd().nContent.GetIndex(); + + if ( nStart == nAktPos ) + aStarts.push_back( pMark->GetName() ); + + if ( nEnd == nAktPos ) + aEnds.push_back( pMark->GetName() ); + } + } + + m_pAttrOutput->WriteBookmarks_Impl( aStarts, aEnds ); +} + +void RtfExport::AppendBookmark( const OUString& rName, bool /*bSkip*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + std::vector<OUString> aStarts; + std::vector<OUString> aEnds; + + aStarts.push_back(rName); + aEnds.push_back(rName); + + m_pAttrOutput->WriteBookmarks_Impl(aStarts, aEnds); +} + +void RtfExport::WriteChar( sal_Unicode ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* WriteChar() has nothing to do for rtf. */ +} + +static bool IsExportNumRule( const SwNumRule& rRule, BYTE* pEnd = 0 ) +{ + BYTE nEnd = MAXLEVEL; + while( nEnd-- && !rRule.GetNumFmt( nEnd )) + ; + ++nEnd; + + const SwNumFmt* pNFmt; + BYTE nLvl; + + for( nLvl = 0; nLvl < nEnd; ++nLvl ) + if( SVX_NUM_NUMBER_NONE != ( pNFmt = &rRule.Get( nLvl )) + ->GetNumberingType() || pNFmt->GetPrefix().Len() || + (pNFmt->GetSuffix().Len() && pNFmt->GetSuffix() != aDotStr )) + break; + + if( pEnd ) + *pEnd = nEnd; + return nLvl != nEnd; +} + +void RtfExport::BuildNumbering() +{ + const SwNumRuleTbl& rListTbl = pDoc->GetNumRuleTbl(); + + for( USHORT n = rListTbl.Count()+1; n; ) + { + SwNumRule* pRule; + --n; + if( n == rListTbl.Count() ) + pRule = (SwNumRule*)pDoc->GetOutlineNumRule(); + else + { + pRule = rListTbl[ n ]; + if( !pDoc->IsUsed( *pRule )) + continue; + } + + if( IsExportNumRule( *pRule )) + GetId( *pRule ); + } +} + +void RtfExport::WriteNumbering() +{ + OSL_TRACE("%s start", OSL_THIS_FUNC); + + if ( !pUsedNumTbl ) + return; // no numbering is used + + Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_LISTTABLE; + AbstractNumberingDefinitions(); + Strm() << '}'; + + Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTOVERRIDETABLE; + NumberingDefinitions(); + Strm() << '}'; + + OSL_TRACE("%s end", OSL_THIS_FUNC); +} + +void RtfExport::WriteRevTab() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + int nRevAuthors = pDoc->GetRedlineTbl().Count(); + + if (nRevAuthors < 1) + return; + + // RTF always seems to use Unknown as the default first entry + String sUnknown(RTL_CONSTASCII_USTRINGPARAM("Unknown")); + GetRedline(sUnknown); + + for( USHORT i = 0; i < pDoc->GetRedlineTbl().Count(); ++i ) + { + const SwRedline* pRedl = pDoc->GetRedlineTbl()[ i ]; + + GetRedline(SW_MOD()->GetRedlineAuthor(pRedl->GetAuthor())); + } + + // Now write the table + Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_REVTBL << ' '; + for(USHORT i = 0; i < m_aRedlineTbl.size(); ++i) + { + const String* pAuthor = GetRedline(i); + Strm() << '{'; + if (pAuthor) + Strm() << OutString(*pAuthor, eDefaultEncoding); + Strm() << ";}"; + } + Strm() << '}' << sNewLine; +} + +void RtfExport::WriteHeadersFooters( BYTE nHeadFootFlags, + const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt, BYTE /*nBreakCode*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // headers + if ( nHeadFootFlags & nsHdFtFlags::WW8_HEADER_EVEN ) + WriteHeaderFooter( rLeftFmt, true, OOO_STRING_SVTOOLS_RTF_HEADERL ); + + if ( nHeadFootFlags & nsHdFtFlags::WW8_HEADER_ODD ) + WriteHeaderFooter( rFmt, true, OOO_STRING_SVTOOLS_RTF_HEADER ); + + if ( nHeadFootFlags & nsHdFtFlags::WW8_HEADER_FIRST ) + WriteHeaderFooter( rFirstPageFmt, true, OOO_STRING_SVTOOLS_RTF_HEADERF ); + + // footers + if ( nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_EVEN ) + WriteHeaderFooter( rLeftFmt, false, OOO_STRING_SVTOOLS_RTF_FOOTERL ); + + if ( nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_ODD ) + WriteHeaderFooter( rFmt, false, OOO_STRING_SVTOOLS_RTF_FOOTER ); + + if ( nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_FIRST ) + WriteHeaderFooter( rFirstPageFmt, false, OOO_STRING_SVTOOLS_RTF_FOOTERF ); +} + +void RtfExport::OutputField( const SwField* pFld, ww::eField eFldType, const String& rFldCmd, BYTE nMode ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_pAttrOutput->WriteField_Impl( pFld, eFldType, rFldCmd, nMode ); +} + +void RtfExport::WriteFormData( const ::sw::mark::IFieldmark& /*rFieldmark*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfExport::WriteHyperlinkData( const ::sw::mark::IFieldmark& /*rFieldmark*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfExport::DoComboBox(const rtl::OUString& /*rName*/, + const rtl::OUString& /*rHelp*/, + const rtl::OUString& /*rToolTip*/, + const rtl::OUString& /*rSelected*/, + uno::Sequence<rtl::OUString>& /*rListItems*/) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // this is handled in RtfAttributeOutput::OutputFlyFrame_Impl +} + +void RtfExport::DoFormText(const SwInputField* pFld ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + ::rtl::OUString sResult = pFld->ExpandField(pDoc->IsClipBoard()); + ::rtl::OUString sHelp( pFld->GetHelp() ); + ::rtl::OUString sName = pFld->GetPar2(); + ::rtl::OUString sStatus = pFld->GetToolTip(); + m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_FIELD "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FLDINST "{ FORMTEXT }"); + m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD " {" OOO_STRING_SVTOOLS_RTF_FFTYPE "0" ); + if( sHelp.getLength() ) + m_pAttrOutput->RunText().append( OOO_STRING_SVTOOLS_RTF_FFOWNHELP ); + if( sStatus.getLength() ) + m_pAttrOutput->RunText().append( OOO_STRING_SVTOOLS_RTF_FFOWNSTAT ); + m_pAttrOutput->RunText().append( OOO_STRING_SVTOOLS_RTF_FFTYPETXT "0" ); + + if( sName.getLength() ) + m_pAttrOutput->RunText().append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFNAME " ").append( OutString( sName, eDefaultEncoding )).append( "}" ); + if( sHelp.getLength() ) + m_pAttrOutput->RunText().append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " ").append( OutString( sHelp, eDefaultEncoding )).append( "}" ); + m_pAttrOutput->RunText().append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFDEFTEXT " ").append( OutString( sResult, eDefaultEncoding )).append( "}" ); + if( sStatus.getLength() ) + m_pAttrOutput->RunText().append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " ").append( OutString( sStatus, eDefaultEncoding )).append( "}"); + m_pAttrOutput->RunText().append( "}}}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " " ); + m_pAttrOutput->RunText().append( OutString( sResult, eDefaultEncoding )).append( "}}" ); +} + +ULONG RtfExport::ReplaceCr( BYTE ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // Completely unused for Rtf export... only here for code sharing + // purpose with binary export + + return 0; +} + +void RtfExport::WriteFonts() +{ + Strm() << sNewLine << '{' << OOO_STRING_SVTOOLS_RTF_FONTTBL; + maFontHelper.WriteFontTable( *m_pAttrOutput ); + Strm() << '}'; +} + +void RtfExport::WriteStyles() +{ + OSL_TRACE("%s start", OSL_THIS_FUNC); + pStyles->OutputStylesTable(); + OSL_TRACE("%s end", OSL_THIS_FUNC); +} + +void RtfExport::WriteMainText() +{ + OSL_TRACE("%s start", OSL_THIS_FUNC); + pCurPam->GetPoint()->nNode = pDoc->GetNodes().GetEndOfContent().StartOfSectionNode()->GetIndex(); + WriteText(); + OSL_TRACE("%s end", OSL_THIS_FUNC); +} + +void RtfExport::WriteInfo() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + Strm() << '{' << OOO_STRING_SVTOOLS_RTF_INFO; + + SwDocShell *pDocShell(pDoc->GetDocShell()); + uno::Reference<document::XDocumentProperties> xDocProps; + if (pDocShell) { + uno::Reference<document::XDocumentPropertiesSupplier> xDPS( + pDocShell->GetModel(), uno::UNO_QUERY); + xDocProps.set(xDPS->getDocumentProperties()); + } + + if (xDocProps.is()) { + OutUnicode(OOO_STRING_SVTOOLS_RTF_TITLE, xDocProps->getTitle()); + OutUnicode(OOO_STRING_SVTOOLS_RTF_SUBJECT, xDocProps->getSubject()); + + OutUnicode(OOO_STRING_SVTOOLS_RTF_KEYWORDS, + ::comphelper::string::convertCommaSeparated(xDocProps->getKeywords())); + OutUnicode(OOO_STRING_SVTOOLS_RTF_DOCCOMM, xDocProps->getDescription()); + + OutUnicode(OOO_STRING_SVTOOLS_RTF_AUTHOR, xDocProps->getAuthor()); + OutDateTime(OOO_STRING_SVTOOLS_RTF_CREATIM, xDocProps->getCreationDate()); + + OutUnicode(OOO_STRING_SVTOOLS_RTF_AUTHOR,xDocProps->getModifiedBy()); + OutDateTime(OOO_STRING_SVTOOLS_RTF_REVTIM, xDocProps->getModificationDate()); + + OutDateTime(OOO_STRING_SVTOOLS_RTF_PRINTIM, xDocProps->getPrintDate()); + } + + Strm() << '{' << OOO_STRING_SVTOOLS_RTF_COMMENT << " "; + OUString sProduct; + utl::ConfigManager::GetDirectConfigProperty(utl::ConfigManager::PRODUCTNAME) >>= sProduct; + Strm() << OUStringToOString( sProduct, eCurrentEncoding) << "}{" << OOO_STRING_SVTOOLS_RTF_VERN; + OutULong( SUPD*10 ) << '}'; + Strm() << '}'; +} + +void RtfExport::WritePageDescTable() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // Write page descriptions (page styles) + USHORT nSize = pDoc->GetPageDescCnt(); + if( !nSize ) + return; + + Strm() << sNewLine; // a separator + bOutPageDescs = TRUE; + Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_PGDSCTBL; + for( USHORT n = 0; n < nSize; ++n ) + { + const SwPageDesc& rPageDesc = + const_cast<const SwDoc*>(pDoc)->GetPageDesc( n ); + + Strm() << sNewLine << '{' << OOO_STRING_SVTOOLS_RTF_PGDSC; + OutULong( n ) << OOO_STRING_SVTOOLS_RTF_PGDSCUSE; + OutULong( rPageDesc.ReadUseOn() ); + + OutPageDescription( rPageDesc, FALSE, FALSE ); + + // search for the next page description + USHORT i = nSize; + while( i ) + if( rPageDesc.GetFollow() == + &const_cast<const SwDoc *>(pDoc)->GetPageDesc( --i ) ) + break; + Strm() << OOO_STRING_SVTOOLS_RTF_PGDSCNXT; + OutULong( i ) << ' '; + Strm() << OutString( rPageDesc.GetName(), eDefaultEncoding) << ";}"; + } + Strm() << '}' << sNewLine; + bOutPageDescs = FALSE; +} + +void RtfExport::ExportDocument_Impl() +{ +#ifdef DEBUG + // MSWordExportBase::WriteText and others write debug messages to std::clog + // which is not interesting while debugging RtfExport + std::ostringstream aOss; + std::streambuf *pOldBuf = std::clog.rdbuf(aOss.rdbuf()); +#endif + + // Make the header + Strm() << '{' << OOO_STRING_SVTOOLS_RTF_RTF << '1' + << OOO_STRING_SVTOOLS_RTF_ANSI; + Strm() << OOO_STRING_SVTOOLS_RTF_DEFF; + OutULong( maFontHelper.GetId( (SvxFontItem&)pDoc->GetAttrPool().GetDefaultItem( + RES_CHRATR_FONT ) )); + // If this not exist, MS don't understand our ansi characters (0x80-0xff). + Strm() << "\\adeflang1025"; + + // Font table + WriteFonts(); + + pStyles = new MSWordStyles( *this ); + // Color and stylesheet table + WriteStyles(); + + // List table + BuildNumbering(); + WriteNumbering(); + + WriteRevTab(); + + WriteInfo(); + // Default TabSize + Strm() << m_pAttrOutput->m_aTabStop.makeStringAndClear() << sNewLine; + // Page description + WritePageDescTable(); + + // Enable form protection by default if needed, as there is no switch to + // enable it on a per-section basis. OTOH don't always enable it as it + // breaks moving of drawings - so write it only in case there is really a + // protected section in the document. + { + const SfxItemPool& rPool = pDoc->GetAttrPool(); + USHORT nMaxItem = rPool.GetItemCount2(RES_PROTECT); + for( USHORT n = 0; n < nMaxItem; ++n ) + { + const SvxProtectItem* pProtect = (const SvxProtectItem*)rPool.GetItem2(RES_PROTECT, n); + if (pProtect && pProtect->IsCntntProtected()) + { + Strm() << OOO_STRING_SVTOOLS_RTF_FORMPROT; + break; + } + } + } + + // enable form field shading + Strm() << OOO_STRING_SVTOOLS_RTF_FORMSHADE; + + // size and empty margins of the page + if( pDoc->GetPageDescCnt() ) + { + //JP 06.04.99: Bug 64361 - Seeking the first SwFmtPageDesc. If + // no set, the default is valid + const SwFmtPageDesc* pSttPgDsc = 0; + { + const SwNode& rSttNd = *pDoc->GetNodes()[ + pDoc->GetNodes().GetEndOfExtras().GetIndex() + 2 ]; + const SfxItemSet* pSet = 0; + + if( rSttNd.IsCntntNode() ) + pSet = &rSttNd.GetCntntNode()->GetSwAttrSet(); + else if( rSttNd.IsTableNode() ) + pSet = &rSttNd.GetTableNode()->GetTable(). + GetFrmFmt()->GetAttrSet(); + else if( rSttNd.IsSectionNode() ) + pSet = &rSttNd.GetSectionNode()->GetSection(). + GetFmt()->GetAttrSet(); + + if( pSet ) + { + USHORT nPosInDoc; + pSttPgDsc = (SwFmtPageDesc*)&pSet->Get( RES_PAGEDESC ); + if( !pSttPgDsc->GetPageDesc() ) + pSttPgDsc = 0; + else if( pDoc->FindPageDescByName( pSttPgDsc-> + GetPageDesc()->GetName(), &nPosInDoc )) + { + Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_PGDSCNO; + OutULong( nPosInDoc ) << '}'; + } + } + } + const SwPageDesc& rPageDesc = pSttPgDsc ? *pSttPgDsc->GetPageDesc() + : const_cast<const SwDoc *>(pDoc)->GetPageDesc( 0 ); + const SwFrmFmt &rFmtPage = rPageDesc.GetMaster(); + + { + if( rPageDesc.GetLandscape() ) + Strm() << OOO_STRING_SVTOOLS_RTF_LANDSCAPE; + + const SwFmtFrmSize& rSz = rFmtPage.GetFrmSize(); + // Clipboard document is always created without a printer, then + // the size will be always LONG_MAX! Solution then is to use A4 + if( LONG_MAX == rSz.GetHeight() || LONG_MAX == rSz.GetWidth() ) + { + Strm() << OOO_STRING_SVTOOLS_RTF_PAPERH; + Size a4 = SvxPaperInfo::GetPaperSize(PAPER_A4); + OutULong( a4.Height() ) << OOO_STRING_SVTOOLS_RTF_PAPERW; + OutULong( a4.Width() ); + } + else + { + Strm() << OOO_STRING_SVTOOLS_RTF_PAPERH; + OutULong( rSz.GetHeight() ) << OOO_STRING_SVTOOLS_RTF_PAPERW; + OutULong( rSz.GetWidth() ); + } + } + + { + const SvxLRSpaceItem& rLR = rFmtPage.GetLRSpace(); + Strm() << OOO_STRING_SVTOOLS_RTF_MARGL; + OutLong( rLR.GetLeft() ) << OOO_STRING_SVTOOLS_RTF_MARGR; + OutLong( rLR.GetRight() ); + } + + { + const SvxULSpaceItem& rUL = rFmtPage.GetULSpace(); + Strm() << OOO_STRING_SVTOOLS_RTF_MARGT; + OutLong( rUL.GetUpper() ) << OOO_STRING_SVTOOLS_RTF_MARGB; + OutLong( rUL.GetLower() ); + } + + Strm() << OOO_STRING_SVTOOLS_RTF_SECTD << OOO_STRING_SVTOOLS_RTF_SBKNONE; + // All sections are unlocked by default + Strm() << OOO_STRING_SVTOOLS_RTF_SECTUNLOCKED; + OutLong(1); + OutPageDescription( rPageDesc, FALSE, TRUE ); // Changed bCheckForFirstPage to TRUE so headers + // following title page are correctly added - i13107 + if( pSttPgDsc ) + { + pAktPageDesc = &rPageDesc; + } + } + + // line numbering + const SwLineNumberInfo& rLnNumInfo = pDoc->GetLineNumberInfo(); + if ( rLnNumInfo.IsPaintLineNumbers() ) + AttrOutput().SectionLineNumbering( 0, rLnNumInfo ); + + { + // write the footnotes and endnotes-out Info + const SwFtnInfo& rFtnInfo = pDoc->GetFtnInfo(); + + const char* pOut = FTNPOS_CHAPTER == rFtnInfo.ePos + ? OOO_STRING_SVTOOLS_RTF_ENDDOC + : OOO_STRING_SVTOOLS_RTF_FTNBJ; + Strm() << pOut << OOO_STRING_SVTOOLS_RTF_FTNSTART; + OutLong( rFtnInfo.nFtnOffset + 1 ); + + switch( rFtnInfo.eNum ) + { + case FTNNUM_PAGE: pOut = OOO_STRING_SVTOOLS_RTF_FTNRSTPG; break; + case FTNNUM_DOC: pOut = OOO_STRING_SVTOOLS_RTF_FTNRSTCONT; break; + // case FTNNUM_CHAPTER: + default: pOut = OOO_STRING_SVTOOLS_RTF_FTNRESTART; break; + } + Strm() << pOut; + + switch( rFtnInfo.aFmt.GetNumberingType() ) + { + case SVX_NUM_CHARS_LOWER_LETTER: + case SVX_NUM_CHARS_LOWER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_FTNNALC; break; + case SVX_NUM_CHARS_UPPER_LETTER: + case SVX_NUM_CHARS_UPPER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_FTNNAUC; break; + case SVX_NUM_ROMAN_LOWER: pOut = OOO_STRING_SVTOOLS_RTF_FTNNRLC; break; + case SVX_NUM_ROMAN_UPPER: pOut = OOO_STRING_SVTOOLS_RTF_FTNNRUC; break; + case SVX_NUM_CHAR_SPECIAL: pOut = OOO_STRING_SVTOOLS_RTF_FTNNCHI; break; + // case SVX_NUM_ARABIC: + default: pOut = OOO_STRING_SVTOOLS_RTF_FTNNAR; break; + } + Strm() << pOut; + + + const SwEndNoteInfo& rEndNoteInfo = pDoc->GetEndNoteInfo(); + + Strm() << OOO_STRING_SVTOOLS_RTF_AENDDOC << OOO_STRING_SVTOOLS_RTF_AFTNRSTCONT + << OOO_STRING_SVTOOLS_RTF_AFTNSTART; + OutLong( rEndNoteInfo.nFtnOffset + 1 ); + + switch( rEndNoteInfo.aFmt.GetNumberingType() ) + { + case SVX_NUM_CHARS_LOWER_LETTER: + case SVX_NUM_CHARS_LOWER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNALC; break; + case SVX_NUM_CHARS_UPPER_LETTER: + case SVX_NUM_CHARS_UPPER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNAUC; break; + case SVX_NUM_ROMAN_LOWER: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNRLC; break; + case SVX_NUM_ROMAN_UPPER: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNRUC; break; + case SVX_NUM_CHAR_SPECIAL: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNCHI; break; + // case SVX_NUM_ARABIC: + default: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNAR; break; + } + Strm() << pOut; + } + + Strm() << sNewLine; + + // Init sections + m_pSections = new MSWordSections( *this ); + + WriteMainText(); + + Strm() << '}'; + +#ifdef DEBUG + std::clog.rdbuf(pOldBuf); +#endif +} + +void RtfExport::PrepareNewPageDesc( const SfxItemSet* pSet, + const SwNode& rNd, const SwFmtPageDesc* pNewPgDescFmt, + const SwPageDesc* pNewPgDesc ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + const SwSectionFmt* pFmt = GetSectionFormat( rNd ); + const ULONG nLnNm = GetSectionLineNo( pSet, rNd ); + + OSL_ENSURE( pNewPgDescFmt || pNewPgDesc, "Neither page desc format nor page desc provided." ); + + if ( pNewPgDescFmt ) + m_pSections->AppendSection( *pNewPgDescFmt, rNd, pFmt, nLnNm ); + else if ( pNewPgDesc ) + m_pSections->AppendSection( pNewPgDesc, rNd, pFmt, nLnNm ); + + AttrOutput().SectionBreak( msword::PageBreak, m_pSections->CurrentSectionInfo() ); +} + +bool RtfExport::DisallowInheritingOutlineNumbering( const SwFmt& rFmt ) +{ + bool bRet( false ); + + OSL_TRACE("%s", OSL_THIS_FUNC); + + if (SFX_ITEM_SET != rFmt.GetItemState(RES_PARATR_NUMRULE, false)) + { + if (const SwFmt *pParent = rFmt.DerivedFrom()) + { + if (((const SwTxtFmtColl*)pParent)->IsAssignedToListLevelOfOutlineStyle()) + { + // Level 9 disables the outline + Strm() << OOO_STRING_SVTOOLS_RTF_LEVEL << 9; + + bRet = true; + } + } + } + + return bRet; +} + +void RtfExport::OutputGrfNode( const SwGrfNode& ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* noop, see RtfAttributeOutput::FlyFrameGraphic */ +} + +void RtfExport::OutputOLENode( const SwOLENode& ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* noop, see RtfAttributeOutput::FlyFrameOLE */ +} + +void RtfExport::AppendSection( const SwPageDesc* pPageDesc, const SwSectionFmt* pFmt, ULONG nLnNum ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_pSections->AppendSection( pPageDesc, pFmt, nLnNum ); + AttrOutput().SectionBreak( msword::PageBreak, m_pSections->CurrentSectionInfo() ); +} + +RtfExport::RtfExport( RtfExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam, Writer* pWriter ) + : MSWordExportBase( pDocument, pCurrentPam, pOriginalPam ), + m_pFilter( pFilter ), + m_pWriter( pWriter ), + m_pAttrOutput( NULL ), + m_pSections( NULL ), + m_pSdrExport( NULL ), + eDefaultEncoding( + rtl_getTextEncodingFromWindowsCharset( + sw::ms::rtl_TextEncodingToWinCharset(DEF_ENCODING))), + eCurrentEncoding(eDefaultEncoding), + bRTFFlySyntax(false) +{ + mbExportModeRTF = true; + // the attribute output for the document + m_pAttrOutput = new RtfAttributeOutput( *this ); + // that just causes problems for RTF + bSubstituteBullets = false; + // needed to have a complete font table + maFontHelper.bLoadAllFonts = true; + // the related SdrExport + m_pSdrExport = new RtfSdrExport( *this ); + + if (!m_pWriter) + m_pWriter = &m_pFilter->m_aWriter; +} + +RtfExport::~RtfExport() +{ + delete m_pAttrOutput, m_pAttrOutput = NULL; + delete m_pSdrExport, m_pSdrExport = NULL; +} + +SvStream& RtfExport::Strm() +{ + return m_pWriter->Strm(); +} + +SvStream& RtfExport::OutULong( ULONG nVal ) +{ + return m_pWriter->OutULong( Strm(), nVal ); +} + +SvStream& RtfExport::OutLong( long nVal ) +{ + return m_pWriter->OutLong( Strm(), nVal ); +} + +void RtfExport::OutUnicode(const sal_Char *pToken, const String &rContent) +{ + if (rContent.Len()) + { + Strm() << '{' << pToken << ' '; + Strm() << OutString( rContent, eCurrentEncoding ).getStr(); + Strm() << '}'; + } +} + +OString RtfExport::OutHex(ULONG nHex, BYTE nLen) +{ + sal_Char aNToABuf[] = "0000000000000000"; + + OSL_ENSURE( nLen < sizeof(aNToABuf), "nLen is too big" ); + if( nLen >= sizeof(aNToABuf) ) + nLen = (sizeof(aNToABuf)-1); + + // Set pointer to the buffer end + sal_Char* pStr = aNToABuf + (sizeof(aNToABuf)-1); + for( BYTE n = 0; n < nLen; ++n ) + { + *(--pStr) = (sal_Char)(nHex & 0xf ) + 48; + if( *pStr > '9' ) + *pStr += 39; + nHex >>= 4; + } + return OString(pStr); +} + +OString RtfExport::OutChar(sal_Unicode c, int *pUCMode, rtl_TextEncoding eDestEnc) +{ + OStringBuffer aBuf; + const sal_Char* pStr = 0; + // 0x0b instead of \n, etc because of the replacements in SwAttrIter::GetSnippet() + switch (c) + { + case 0x0b: + // hard line break + pStr = OOO_STRING_SVTOOLS_RTF_LINE; + break; + case '\t': + pStr = OOO_STRING_SVTOOLS_RTF_TAB; + break; + case '\\': + case '}': + case '{': + aBuf.append('\\'); + aBuf.append((sal_Char)c); + break; + case 0xa0: + // non-breaking space + pStr = "\\~"; + break; + case 0x1e: + // non-breaking hyphen + pStr = "\\_"; + break; + case 0x1f: + // optional hyphen + pStr = "\\-"; + break; + default: + if (c >= ' ' && c <= '~') + aBuf.append((sal_Char)c); + else { + //If we can't convert to the dest encoding, or if + //its an uncommon multibyte sequence which most + //readers won't be able to handle correctly, then + //If we can't convert to the dest encoding, then + //export as unicode + OUString sBuf(&c, 1); + OString sConverted; + sal_uInt32 nFlags = + RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR | + RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR; + bool bWriteAsUnicode = !(sBuf.convertToString(&sConverted, + eDestEnc, nFlags)) + || (RTL_TEXTENCODING_UTF8==eDestEnc); // #i43933# do not export UTF-8 chars in RTF; + if (bWriteAsUnicode) + sBuf.convertToString(&sConverted, + eDestEnc, OUSTRING_TO_OSTRING_CVTFLAGS); + const sal_Int32 nLen = sConverted.getLength(); + + if (bWriteAsUnicode && pUCMode) + { + // then write as unicode - character + if (*pUCMode != nLen) + { + aBuf.append("\\uc"); + aBuf.append((sal_Int32)nLen); + // #i47831# add an additional whitespace, so that "document whitespaces" are not ignored. + aBuf.append(' '); + *pUCMode = nLen; + } + aBuf.append("\\u"); + aBuf.append((sal_Int32)c); + } + + for (sal_Int32 nI = 0; nI < nLen; ++nI) + { + aBuf.append("\\'"); + aBuf.append(OutHex(sConverted.getStr()[nI], 2)); + } + } + } + if (pStr) { + aBuf.append(pStr); + aBuf.append(' '); + } + return aBuf.makeStringAndClear(); +} + +OString RtfExport::OutString(const String &rStr, rtl_TextEncoding eDestEnc) +{ + OSL_TRACE("%s, rStr = '%s'", OSL_THIS_FUNC, + OUStringToOString( OUString( rStr ), eDestEnc ).getStr()); + OStringBuffer aBuf; + int nUCMode = 1; + for (xub_StrLen n = 0; n < rStr.Len(); ++n) + aBuf.append(OutChar(rStr.GetChar(n), &nUCMode, eDestEnc)); + if (nUCMode != 1) { + aBuf.append(OOO_STRING_SVTOOLS_RTF_UC); + aBuf.append((sal_Int32)1); + aBuf.append(" "); // #i47831# add an additional whitespace, so that "document whitespaces" are not ignored.; + } + return aBuf.makeStringAndClear(); +} + +void RtfExport::OutDateTime(const sal_Char* pStr, const util::DateTime& rDT ) +{ + Strm() << '{' << pStr << OOO_STRING_SVTOOLS_RTF_YR; + OutULong( rDT.Year ) << OOO_STRING_SVTOOLS_RTF_MO; + OutULong( rDT.Month ) << OOO_STRING_SVTOOLS_RTF_DY; + OutULong( rDT.Day ) << OOO_STRING_SVTOOLS_RTF_HR; + OutULong( rDT.Hours ) << OOO_STRING_SVTOOLS_RTF_MIN; + OutULong( rDT.Minutes ) << '}'; +} + +USHORT RtfExport::GetColor( const Color& rColor ) const +{ + for (RtfColorTbl::const_iterator it=m_aColTbl.begin() ; it != m_aColTbl.end(); it++ ) + if ((*it).second == rColor) { + OSL_TRACE("%s returning %d (%d,%d,%d)", OSL_THIS_FUNC, (*it).first, rColor.GetRed(), rColor.GetGreen(), rColor.GetBlue()); + return (*it).first; + } + OSL_ENSURE( FALSE, "No such Color in m_aColTbl!" ); + return 0; +} + +void RtfExport::InsColor( const Color& rCol ) +{ + USHORT n; + for (RtfColorTbl::iterator it=m_aColTbl.begin() ; it != m_aColTbl.end(); it++ ) + if ((*it).second == rCol) + return; // Already in the table + if (rCol.GetColor() == COL_AUTO) + n = 0; + else + { + n = m_aColTbl.size(); + // Fix for the case when first a !COL_AUTO gets inserted as #0, then + // gets overwritten by COL_AUTO + if (!n) + n++; + } + m_aColTbl.insert(std::pair<USHORT,Color>( n, rCol )); +} + +void RtfExport::InsColorLine( const SvxBoxItem& rBox ) +{ + const SvxBorderLine* pLine = 0; + + if( rBox.GetTop() ) + InsColor( (pLine = rBox.GetTop())->GetColor() ); + if( rBox.GetBottom() && pLine != rBox.GetBottom() ) + InsColor( (pLine = rBox.GetBottom())->GetColor() ); + if( rBox.GetLeft() && pLine != rBox.GetLeft() ) + InsColor( (pLine = rBox.GetLeft())->GetColor() ); + if( rBox.GetRight() && pLine != rBox.GetRight() ) + InsColor( rBox.GetRight()->GetColor() ); +} +void RtfExport::OutColorTable() +{ + // Build the table from rPool since the colors provided to + // RtfAttributeOutput callbacks are too late. + USHORT n, nMaxItem; + const SfxItemPool& rPool = pDoc->GetAttrPool(); + + // char color + { + const SvxColorItem* pCol = (const SvxColorItem*)GetDfltAttr( + RES_CHRATR_COLOR ); + InsColor( pCol->GetValue() ); + if( 0 != ( pCol = (const SvxColorItem*)rPool.GetPoolDefaultItem( + RES_CHRATR_COLOR ) )) + InsColor( pCol->GetValue() ); + nMaxItem = rPool.GetItemCount2(RES_CHRATR_COLOR); + for( n = 0; n < nMaxItem; ++n ) + { + if( 0 != (pCol = (const SvxColorItem*)rPool.GetItem2( + RES_CHRATR_COLOR, n ) ) ) + InsColor( pCol->GetValue() ); + } + + const SvxUnderlineItem* pUnder = (const SvxUnderlineItem*)GetDfltAttr( RES_CHRATR_UNDERLINE ); + InsColor( pUnder->GetColor() ); + nMaxItem = rPool.GetItemCount2(RES_CHRATR_UNDERLINE); + for( n = 0; n < nMaxItem;n++) + { + if( 0 != (pUnder = (const SvxUnderlineItem*)rPool.GetItem2( RES_CHRATR_UNDERLINE, n ) ) ) + InsColor( pUnder->GetColor() ); + + } + + const SvxOverlineItem* pOver = (const SvxOverlineItem*)GetDfltAttr( RES_CHRATR_OVERLINE ); + InsColor( pOver->GetColor() ); + nMaxItem = rPool.GetItemCount2(RES_CHRATR_OVERLINE); + for( n = 0; n < nMaxItem;n++) + { + if( 0 != (pOver = (const SvxOverlineItem*)rPool.GetItem2( RES_CHRATR_OVERLINE, n ) ) ) + InsColor( pOver->GetColor() ); + + } + + } + + // background color + static const USHORT aBrushIds[] = { + RES_BACKGROUND, RES_CHRATR_BACKGROUND, 0 }; + + for( const USHORT* pIds = aBrushIds; *pIds; ++pIds ) + { + const SvxBrushItem* pBkgrd = (const SvxBrushItem*)GetDfltAttr( *pIds ); + InsColor( pBkgrd->GetColor() ); + if( 0 != ( pBkgrd = (const SvxBrushItem*)rPool.GetPoolDefaultItem( + *pIds ) )) + { + InsColor( pBkgrd->GetColor() ); + } + nMaxItem = rPool.GetItemCount2( *pIds ); + for( n = 0; n < nMaxItem; ++n ) + if( 0 != (pBkgrd = (const SvxBrushItem*)rPool.GetItem2( + *pIds , n ) )) + { + InsColor( pBkgrd->GetColor() ); + } + } + + // shadow color + { + const SvxShadowItem* pShadow = (const SvxShadowItem*)GetDfltAttr( + RES_SHADOW ); + InsColor( pShadow->GetColor() ); + if( 0 != ( pShadow = (const SvxShadowItem*)rPool.GetPoolDefaultItem( + RES_SHADOW ) )) + { + InsColor( pShadow->GetColor() ); + } + nMaxItem = rPool.GetItemCount2(RES_SHADOW); + for( n = 0; n < nMaxItem; ++n ) + if( 0 != (pShadow = (const SvxShadowItem*)rPool.GetItem2( + RES_SHADOW, n ) ) ) + { + InsColor( pShadow->GetColor() ); + } + } + + // frame border color + { + const SvxBoxItem* pBox; + if( 0 != ( pBox = (const SvxBoxItem*)rPool.GetPoolDefaultItem( + RES_BOX ) )) + InsColorLine( *pBox ); + nMaxItem = rPool.GetItemCount2(RES_BOX); + for( n = 0; n < nMaxItem; ++n ) + if( 0 != (pBox = (const SvxBoxItem*)rPool.GetItem2( RES_BOX, n ) )) + InsColorLine( *pBox ); + } + + for( n = 0; n < m_aColTbl.size(); n++ ) + { + const Color& rCol = m_aColTbl[ n ]; + if( n || COL_AUTO != rCol.GetColor() ) + { + Strm() << OOO_STRING_SVTOOLS_RTF_RED; + OutULong( rCol.GetRed() ) << OOO_STRING_SVTOOLS_RTF_GREEN; + OutULong( rCol.GetGreen() ) << OOO_STRING_SVTOOLS_RTF_BLUE; + OutULong( rCol.GetBlue() ); + } + Strm() << ';'; + } +} + +void RtfExport::InsStyle( USHORT nId, const OString& rStyle ) +{ + m_aStyTbl.insert(std::pair<USHORT,OString>(nId, rStyle) ); +} + +OString* RtfExport::GetStyle( USHORT nId ) +{ + std::map<USHORT,OString>::iterator i = m_aStyTbl.find(nId); + if (i != m_aStyTbl.end()) + return &i->second; + return NULL; +} + +USHORT RtfExport::GetRedline( const String& rAuthor ) +{ + std::map<String,USHORT>::iterator i = m_aRedlineTbl.find(rAuthor); + if (i != m_aRedlineTbl.end()) + return i->second; + else + { + int nId = m_aRedlineTbl.size(); + m_aRedlineTbl.insert(std::pair<String,USHORT>(rAuthor,nId)); + return nId; + } +} + +const String* RtfExport::GetRedline( USHORT nId ) +{ + for(std::map<String,USHORT>::iterator aIter = m_aRedlineTbl.begin(); aIter != m_aRedlineTbl.end(); ++aIter) + if ((*aIter).second == nId) + return &(*aIter).first; + return NULL; +} + +void RtfExport::OutPageDescription( const SwPageDesc& rPgDsc, BOOL bWriteReset, BOOL bCheckForFirstPage ) +{ + OSL_TRACE("%s start", OSL_THIS_FUNC); + const SwPageDesc *pSave = pAktPageDesc; + + pAktPageDesc = &rPgDsc; + if( bCheckForFirstPage && pAktPageDesc->GetFollow() && + pAktPageDesc->GetFollow() != pAktPageDesc ) + pAktPageDesc = pAktPageDesc->GetFollow(); + + if( bWriteReset ) + { + if( pCurPam->GetPoint()->nNode == pOrigPam->Start()->nNode ) + Strm() << OOO_STRING_SVTOOLS_RTF_SECTD << OOO_STRING_SVTOOLS_RTF_SBKNONE; + else + Strm() << OOO_STRING_SVTOOLS_RTF_SECT << OOO_STRING_SVTOOLS_RTF_SECTD; + } + + if( pAktPageDesc->GetLandscape() ) + Strm() << OOO_STRING_SVTOOLS_RTF_LNDSCPSXN; + + const SwFmt *pFmt = &pAktPageDesc->GetMaster(); //GetLeft(); + bOutPageDescs = true; + OutputFormat(*pFmt, true, false); + bOutPageDescs = false; + + // normal header / footer (without a style) + const SfxPoolItem* pItem; + if( pAktPageDesc->GetLeft().GetAttrSet().GetItemState( RES_HEADER, FALSE, + &pItem ) == SFX_ITEM_SET) + WriteHeaderFooter(*pItem, true); + if( pAktPageDesc->GetLeft().GetAttrSet().GetItemState( RES_FOOTER, FALSE, + &pItem ) == SFX_ITEM_SET) + WriteHeaderFooter(*pItem, false); + + // title page + if( pAktPageDesc != &rPgDsc ) + { + pAktPageDesc = &rPgDsc; + Strm() << OOO_STRING_SVTOOLS_RTF_TITLEPG; + if( pAktPageDesc->GetMaster().GetAttrSet().GetItemState( RES_HEADER, + FALSE, &pItem ) == SFX_ITEM_SET ) + WriteHeaderFooter(*pItem, true); + if( pAktPageDesc->GetMaster().GetAttrSet().GetItemState( RES_FOOTER, + FALSE, &pItem ) == SFX_ITEM_SET ) + WriteHeaderFooter(*pItem, false); + } + + // numbering type + AttrOutput().SectionPageNumbering(pAktPageDesc->GetNumType().GetNumberingType(), 0); + + pAktPageDesc = pSave; + //bOutPageDesc = bOldOut; + OSL_TRACE("%s end", OSL_THIS_FUNC); +} + +void RtfExport::WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader) +{ + if (bHeader) + { + const SwFmtHeader& rHeader = (const SwFmtHeader&)rItem; + if (!rHeader.IsActive()) + return; + } + else + { + const SwFmtFooter& rFooter = (const SwFmtFooter&)rItem; + if (!rFooter.IsActive()) + return; + } + + OSL_TRACE("%s start", OSL_THIS_FUNC); + + const sal_Char* pStr = (bHeader ? OOO_STRING_SVTOOLS_RTF_HEADER : OOO_STRING_SVTOOLS_RTF_FOOTER); + /* is this a title page? */ + if( pAktPageDesc->GetFollow() && pAktPageDesc->GetFollow() != pAktPageDesc ) + { + Strm() << OOO_STRING_SVTOOLS_RTF_TITLEPG; + pStr = (bHeader ? OOO_STRING_SVTOOLS_RTF_HEADERF : OOO_STRING_SVTOOLS_RTF_FOOTERF); + } + Strm() << '{' << pStr; + WriteHeaderFooterText(pAktPageDesc->GetMaster(), bHeader); + Strm() << '}'; + + OSL_TRACE("%s end", OSL_THIS_FUNC); +} + +void RtfExport::WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr) +{ + OSL_TRACE("%s start", OSL_THIS_FUNC); + + m_pAttrOutput->WriteHeaderFooter_Impl( rFmt, bHeader, pStr ); + + OSL_TRACE("%s end", OSL_THIS_FUNC); +} + +class SwRTFWriter : public Writer +{ + public: + SwRTFWriter( const String& rFilterName, const String& rBaseURL ); + virtual ~SwRTFWriter(); + virtual ULONG WriteStream(); +}; + +SwRTFWriter::SwRTFWriter( const String& /*rFltName*/, const String & rBaseURL ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + SetBaseURL( rBaseURL ); +} + +SwRTFWriter::~SwRTFWriter() +{} + +ULONG SwRTFWriter::WriteStream() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + RtfExport aExport( NULL, pDoc, new SwPaM( *pCurPam->End(), *pCurPam->Start() ), pCurPam, this ); + aExport.ExportDocument( true ); + return 0; +} + +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL ExportRTF( const String& rFltName, const String& rBaseURL, WriterRef& xRet ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + xRet = new SwRTFWriter( rFltName, rBaseURL ); +} + +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx new file mode 100644 index 0000000000..9b866f673d --- /dev/null +++ b/sw/source/filter/ww8/rtfexport.hxx @@ -0,0 +1,212 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2010 Miklos Vajna. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _RTFEXPORT_HXX_ +#define _RTFEXPORT_HXX_ + +#include <set> +#include "rtfattributeoutput.hxx" +#include "wrtww8.hxx" + +#include <rtl/ustring.hxx> + +#include <cstdio> +#include <map> + +class RtfExportFilter; +class RtfSdrExport; +typedef std::map<USHORT,Color> RtfColorTbl; +typedef std::map<USHORT,rtl::OString> RtfStyleTbl; +typedef std::map<String,USHORT> RtfRedlineTbl; +class SwNode; +class SwEndNode; +class SwTableNode; +class SwTxtNode; +class SwGrfNode; +class SwOLENode; +class SwSectionNode; +class SwNumRuleTbl; + +namespace com { namespace sun { namespace star { + namespace frame { class XModel; } +} } } + +/// The class that does all the actual RTF export-related work. +class RtfExport : public MSWordExportBase +{ + /// Pointer to the filter that owns us. + RtfExportFilter *m_pFilter; + Writer* m_pWriter; + + /// Attribute output for document. + RtfAttributeOutput *m_pAttrOutput; + + /// Sections/headers/footers + MSWordSections *m_pSections; + + RtfSdrExport *m_pSdrExport; + +public: + /// Access to the attribute output class. + virtual AttributeOutputBase& AttrOutput() const; + + /// Access to the sections/headers/footres. + virtual MSWordSections& Sections() const; + + /// Access to the Rtf Sdr exporter. + virtual RtfSdrExport& SdrExporter() const; + + /// Hack, unfortunately necessary at some places for now. + virtual bool HackIsWW8OrHigher() const { return false; } + + /// Guess the script (asian/western). + virtual bool CollapseScriptsforWordOk( USHORT nScript, USHORT nWhich ); + + virtual void AppendBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen ); + + virtual void AppendBookmark( const rtl::OUString& rName, bool bSkip = false ); + + virtual void WriteCR( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner = ww8::WW8TableNodeInfoInner::Pointer_t()*/ ) { /* no-op for rtf, most probably should not even be in MSWordExportBase */ } + virtual void WriteChar( sal_Unicode ); + + /// Write the numbering table. + virtual void WriteNumbering(); + + /// Write the revision table. + virtual void WriteRevTab(); + + /// Output the actual headers and footers. + virtual void WriteHeadersFooters( BYTE nHeadFootFlags, + const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt, BYTE nBreakCode ); + + /// Write the field + virtual void OutputField( const SwField* pFld, ww::eField eFldType, + const String& rFldCmd, BYTE nMode = nsFieldFlags::WRITEFIELD_ALL ); + + /// Write the data of the form field + virtual void WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ); + virtual void WriteHyperlinkData( const ::sw::mark::IFieldmark& rFieldmark ); + + virtual void DoComboBox(const rtl::OUString &rName, + const rtl::OUString &rHelp, + const rtl::OUString &ToolTip, + const rtl::OUString &rSelected, + com::sun::star::uno::Sequence<rtl::OUString> &rListItems); + + virtual void DoFormText(const SwInputField * pFld); + + virtual ULONG ReplaceCr( BYTE nChar ); + +protected: + /// Format-dependant part of the actual export. + virtual void ExportDocument_Impl(); + + virtual void SectionBreaksAndFrames( const SwTxtNode& /*rNode*/ ) {} + + /// Get ready for a new section. + virtual void PrepareNewPageDesc( const SfxItemSet* pSet, + const SwNode& rNd, + const SwFmtPageDesc* pNewPgDescFmt = 0, + const SwPageDesc* pNewPgDesc = 0 ); + + /// Return value indicates if an inherited outline numbering is suppressed. + virtual bool DisallowInheritingOutlineNumbering(const SwFmt &rFmt); + + /// Output SwGrfNode + virtual void OutputGrfNode( const SwGrfNode& ); + + /// Output SwOLENode + virtual void OutputOLENode( const SwOLENode& ); + + virtual void AppendSection( const SwPageDesc *pPageDesc, const SwSectionFmt* pFmt, ULONG nLnNum ); + +public: + /// Pass the pDocument, pCurrentPam and pOriginalPam to the base class. + RtfExport( RtfExportFilter *pFilter, SwDoc *pDocument, + SwPaM *pCurrentPam, SwPaM *pOriginalPam, Writer* pWriter ); + + /// Destructor. + virtual ~RtfExport(); + +#if defined(UNX) + static const sal_Char sNewLine; // \012 or \015 +#else + static const sal_Char __FAR_DATA sNewLine[]; // \015\012 +#endif + + rtl_TextEncoding eDefaultEncoding; + rtl_TextEncoding eCurrentEncoding; + /// This is used by OutputFlyFrame_Impl() to control the written syntax + bool bRTFFlySyntax; + + BOOL m_bOutStyleTab : 1; + SvStream& Strm(); + SvStream& OutULong( ULONG nVal ); + SvStream& OutLong( long nVal ); + void OutUnicode(const sal_Char *pToken, const String &rContent); + void OutDateTime(const sal_Char* pStr, const util::DateTime& rDT ); + static rtl::OString OutChar(sal_Unicode c, int *pUCMode, rtl_TextEncoding eDestEnc); + static rtl::OString OutString(const String &rStr, rtl_TextEncoding eDestEnc); + static rtl::OString OutHex(ULONG nHex, BYTE nLen); + void OutPageDescription( const SwPageDesc& rPgDsc, BOOL bWriteReset, BOOL bCheckForFirstPage ); + + USHORT GetColor( const Color& rColor ) const; + void InsColor( const Color& rCol ); + void InsColorLine( const SvxBoxItem& rBox ); + void OutColorTable(); + USHORT GetRedline( const String& rAuthor ); + const String* GetRedline( USHORT nId ); + + void InsStyle( USHORT nId, const rtl::OString& rStyle ); + rtl::OString* GetStyle( USHORT nId ); + +private: + /// No copying. + RtfExport( const RtfExport& ); + + /// No copying. + RtfExport& operator=( const RtfExport& ); + + void WriteFonts(); + void WriteStyles(); + void WriteMainText(); + void WriteInfo(); + /// Writes the writer-specific \pgdsctbl group. + void WritePageDescTable(); + /// This is necessary to have the numbering table ready before the main text is being processed. + void BuildNumbering(); + void WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader); + void WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr); + + RtfColorTbl m_aColTbl; + RtfStyleTbl m_aStyTbl; + RtfRedlineTbl m_aRedlineTbl; +}; + +#endif // _RTFEXPORT_HXX_ +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfexportfilter.cxx b/sw/source/filter/ww8/rtfexportfilter.cxx new file mode 100644 index 0000000000..ff4ed180d0 --- /dev/null +++ b/sw/source/filter/ww8/rtfexportfilter.cxx @@ -0,0 +1,226 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2010 Miklos Vajna. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <rtfexportfilter.hxx> +#include <rtfexport.hxx> +#include <rtfimportfilter.hxx> + +#include <docsh.hxx> +#include <doc.hxx> +#include <pam.hxx> +#include <unotxdoc.hxx> + +#include <cppuhelper/factory.hxx> +#include <comphelper/mediadescriptor.hxx> +#include <unotools/ucbstreamhelper.hxx> + +using namespace ::comphelper; +using namespace ::com::sun::star; +using ::rtl::OUString; + +RtfExportFilter::RtfExportFilter( const uno::Reference< lang::XMultiServiceFactory >& xMSF) : + m_xMSF( xMSF ) +{ +} + +RtfExportFilter::~RtfExportFilter() +{ +} + +sal_Bool RtfExportFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescriptor ) + throw (uno::RuntimeException) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + MediaDescriptor aMediaDesc = aDescriptor; + ::uno::Reference< io::XStream > xStream = + aMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_STREAMFOROUTPUT(), uno::Reference< io::XStream >() ); + m_pStream = utl::UcbStreamHelper::CreateStream( xStream, sal_True ); + m_aWriter.SetStream(m_pStream); + + // get SwDoc* + uno::Reference< uno::XInterface > xIfc( m_xSrcDoc, uno::UNO_QUERY ); + SwXTextDocument *pTxtDoc = dynamic_cast< SwXTextDocument * >( xIfc.get() ); + if ( !pTxtDoc ) { + return sal_False; + } + + SwDoc *pDoc = pTxtDoc->GetDocShell()->GetDoc(); + if ( !pDoc ) { + return sal_False; + } + + // get SwPaM* + // we get SwPaM for the entire document; copy&paste is handled internally, not via UNO + SwPaM aPam( pDoc->GetNodes().GetEndOfContent() ); + aPam.SetMark(); + aPam.Move( fnMoveBackward, fnGoDoc ); + + SwPaM *pCurPam = new SwPaM( *aPam.End(), *aPam.Start() ); + + // export the document + // (in a separate block so that it's destructed before the commit) + { + RtfExport aExport( this, pDoc, pCurPam, &aPam, NULL ); + aExport.ExportDocument( true ); + } + + // delete the pCurPam + if ( pCurPam ) + { + while ( pCurPam->GetNext() != pCurPam ) + delete pCurPam->GetNext(); + delete pCurPam; + } + delete m_pStream; + + return sal_True; +} + + +void RtfExportFilter::cancel( ) throw (uno::RuntimeException) +{ +} + +void RtfExportFilter::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc ) + throw (lang::IllegalArgumentException, uno::RuntimeException) +{ + m_xSrcDoc = xDoc; +} + +////////////////////////////////////////////////////////////////////////// +// UNO helpers +////////////////////////////////////////////////////////////////////////// + +OUString RtfExport_getImplementationName() +{ + return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPL_NAME_RTFEXPORT ) ); +} + +uno::Sequence< OUString > SAL_CALL RtfExport_getSupportedServiceNames() throw() +{ + const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.ExportFilter" ) ); + const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); + return aSeq; +} + +uno::Reference< uno::XInterface > SAL_CALL RtfExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception ) +{ + return (cppu::OWeakObject*) new RtfExportFilter( rSMgr ); +} +#ifdef __cplusplus +extern "C" +{ +#endif + +SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ ) +{ + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} + +SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey ) +{ + sal_Bool bRet = sal_False; + + if( pRegistryKey ) + { + try + { + uno::Reference< registry::XRegistryKey > xNewKey1( + static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey( + OUString::createFromAscii( IMPL_NAME_RTFEXPORT "/UNO/SERVICES/" ) ) ); + xNewKey1->createKey( RtfExport_getSupportedServiceNames().getConstArray()[0] ); + + bRet = sal_True; + } + catch( registry::InvalidRegistryException& ) + { + OSL_ENSURE( sal_False, "### InvalidRegistryException (rtfexport)!" ); + } + + try + { + uno::Reference< registry::XRegistryKey > xNewKey1( + static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey( + OUString::createFromAscii( IMPL_NAME_RTFIMPORT "/UNO/SERVICES/" ) ) ); + xNewKey1->createKey( RtfExport_getSupportedServiceNames().getConstArray()[0] ); + + bRet = sal_True; + } + catch( registry::InvalidRegistryException& ) + { + OSL_ENSURE( sal_False, "### InvalidRegistryException (rtfimport)!" ); + } + } + + return bRet; +} + +// ------------------------ +// - component_getFactory - +// ------------------------ + +SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ ) +{ + OSL_TRACE("%s, pImplName is '%s'", OSL_THIS_FUNC, pImplName); + uno::Reference< lang::XSingleServiceFactory > xFactory; + void* pRet = 0; + + if ( rtl_str_compare( pImplName, IMPL_NAME_RTFEXPORT ) == 0 ) { + const OUString aServiceName( OUString::createFromAscii( IMPL_NAME_RTFEXPORT ) ); + + xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory( + reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), + RtfExport_getImplementationName(), + RtfExport_createInstance, + RtfExport_getSupportedServiceNames() ) ); + } + else if ( rtl_str_compare( pImplName, IMPL_NAME_RTFIMPORT ) == 0 ) { + const OUString aServiceName( OUString::createFromAscii( IMPL_NAME_RTFIMPORT ) ); + + xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory( + reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), + RtfImport_getImplementationName(), + RtfImport_createInstance, + RtfImport_getSupportedServiceNames() ) ); + } + + if ( xFactory.is() ) + { + xFactory->acquire(); + pRet = xFactory.get(); + } + + return pRet; +} + +#ifdef __cplusplus +} +#endif + +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfexportfilter.hxx b/sw/source/filter/ww8/rtfexportfilter.hxx new file mode 100644 index 0000000000..e3ccc3a9d3 --- /dev/null +++ b/sw/source/filter/ww8/rtfexportfilter.hxx @@ -0,0 +1,85 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2010 Miklos Vajna. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _RTFEXPORTFILTER_HXX_ +#define _RTFEXPORTFILTER_HXX_ + +#include <com/sun/star/document/XFilter.hpp> +#include <com/sun/star/document/XExporter.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <cppuhelper/implbase2.hxx> +#include <tools/stream.hxx> +#include <shellio.hxx> + +// This is just here so that we don't have to copy&paste its string format methods +class RtfWriter : public Writer +{ +protected: + ULONG WriteStream() { return 0; } +}; + +/// The physical access to the RTF document (for writing). +class RtfExportFilter : public cppu::WeakImplHelper2 +< + com::sun::star::document::XFilter, + com::sun::star::document::XExporter +> +{ +protected: + ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMSF; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xSrcDoc; + SvStream* m_pStream; +public: + RtfExportFilter( const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMSF ); + virtual ~RtfExportFilter(); + + // XFilter + virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL cancel( ) + throw (::com::sun::star::uno::RuntimeException); + + // XExporter + virtual void SAL_CALL setSourceDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + RtfWriter m_aWriter; +}; + +::rtl::OUString RtfExport_getImplementationName(); +::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL RtfExport_getSupportedServiceNames() + throw(); +::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL RtfExport_createInstance( + const ::com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory > &xMSF) + throw( ::com::sun::star::uno::Exception ); + +#define IMPL_NAME_RTFEXPORT "com.sun.star.comp.Writer.RtfExport" + +#endif // _RTFEXPORTFILTER_HXX_ +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfimportfilter.cxx b/sw/source/filter/ww8/rtfimportfilter.cxx new file mode 100644 index 0000000000..d44a42db4f --- /dev/null +++ b/sw/source/filter/ww8/rtfimportfilter.cxx @@ -0,0 +1,137 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2010 Miklos Vajna. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "rtfimportfilter.hxx" +#include "../rtf/swparrtf.hxx" + +#include <docsh.hxx> +#include <doc.hxx> +#include <pam.hxx> +#include <unotxdoc.hxx> +#include <swerror.h> + +#include <cppuhelper/factory.hxx> +#include <comphelper/mediadescriptor.hxx> +#include <unotools/ucbstreamhelper.hxx> + +#include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/frame/XComponentLoader.hpp> + +using namespace ::comphelper; +using namespace ::com::sun::star; +using ::rtl::OUString; +using rtl::OUStringToOString; + +RtfImportFilter::RtfImportFilter( const uno::Reference< lang::XMultiServiceFactory >& xMSF) : + m_xMSF( xMSF ) +{ +} + +RtfImportFilter::~RtfImportFilter() +{ +} + +sal_Bool RtfImportFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescriptor ) + throw (uno::RuntimeException) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + MediaDescriptor aMediaDesc = aDescriptor; + ::uno::Reference< io::XInputStream > xInputStream = + aMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_INPUTSTREAM(), uno::Reference< io::XInputStream >() ); + SvStream* pStream = utl::UcbStreamHelper::CreateStream( xInputStream, sal_True ); + if (!pStream) + return sal_False; + + // get SwDoc* + uno::Reference< uno::XInterface > xIfc( m_xDstDoc, uno::UNO_QUERY ); + SwXTextDocument *pTxtDoc = dynamic_cast< SwXTextDocument * >( xIfc.get() ); + if (!pTxtDoc) + return sal_False; + SwDoc *pDoc = pTxtDoc->GetDocShell()->GetDoc(); + if (!pDoc) + return sal_False; + + // get SwPaM* + // NEEDSWORK should we care about partial imports? For now we just import + // the whole document + SwPaM aPam( pDoc->GetNodes().GetEndOfContent() ); + aPam.SetMark(); + aPam.Move( fnMoveBackward, fnGoDoc ); + SwPaM *pCurPam = new SwPaM( *aPam.End(), *aPam.Start() ); + + String aURL; + OUString sTemp; + for ( sal_Int32 i = 0; i < aDescriptor.getLength(); i++ ) + { + if( aDescriptor[i].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("URL")) ) + { + aDescriptor[i].Value >>= sTemp; + aURL = sTemp; + } + } + + RtfReader aReader; + sal_Bool bRet = aReader.Read(pStream, *pDoc, aURL, *pCurPam) == 0; + delete pStream; + return bRet; +} + + +void RtfImportFilter::cancel( ) throw (uno::RuntimeException) +{ +} + +void RtfImportFilter::setTargetDocument( const uno::Reference< lang::XComponent >& xDoc ) + throw (lang::IllegalArgumentException, uno::RuntimeException) +{ + m_xDstDoc = xDoc; +} + +////////////////////////////////////////////////////////////////////////// +// UNO helpers +////////////////////////////////////////////////////////////////////////// + +OUString RtfImport_getImplementationName() +{ + return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPL_NAME_RTFIMPORT ) ); +} + +uno::Sequence< OUString > SAL_CALL RtfImport_getSupportedServiceNames() throw() +{ + const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.ImportFilter" ) ); + const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); + return aSeq; +} + +uno::Reference< uno::XInterface > SAL_CALL RtfImport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception ) +{ + return (cppu::OWeakObject*) new RtfImportFilter( rSMgr ); +} + +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfimportfilter.hxx b/sw/source/filter/ww8/rtfimportfilter.hxx new file mode 100644 index 0000000000..9026d63573 --- /dev/null +++ b/sw/source/filter/ww8/rtfimportfilter.hxx @@ -0,0 +1,75 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2010 Miklos Vajna. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _RTFIMPORTFILTER_HXX_ +#define _RTFIMPORTFILTER_HXX_ + +#include <com/sun/star/document/XFilter.hpp> +#include <com/sun/star/document/XImporter.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <cppuhelper/implbase2.hxx> +#include <tools/stream.hxx> +#include <shellio.hxx> + +/// The physical access to the RTF document (for reading). +class RtfImportFilter : public cppu::WeakImplHelper2 +< + com::sun::star::document::XFilter, + com::sun::star::document::XImporter +> +{ +protected: + ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMSF; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xDstDoc; +public: + RtfImportFilter( const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMSF ); + virtual ~RtfImportFilter(); + + // XFilter + virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL cancel( ) + throw (::com::sun::star::uno::RuntimeException); + + // XImporter + virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); +}; + +::rtl::OUString RtfImport_getImplementationName(); +::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL RtfImport_getSupportedServiceNames() + throw(); +::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL RtfImport_createInstance( + const ::com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory > &xMSF) + throw( ::com::sun::star::uno::Exception ); + +#define IMPL_NAME_RTFIMPORT "com.sun.star.comp.Writer.RtfImport" + +#endif // _RTFIMPORTFILTER_HXX_ +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx new file mode 100644 index 0000000000..9953ffb871 --- /dev/null +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -0,0 +1,586 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2010 Miklos Vajna. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "rtfsdrexport.hxx" +#include "rtfexport.hxx" +#include "writerhelper.hxx" + +#include <com/sun/star/i18n/ScriptType.hdl> +#include <osl/diagnose.h> +#include <rtl/strbuf.hxx> +#include <rtl/ustring.hxx> +#include <svl/itemiter.hxx> +#include <svtools/rtfkeywd.hxx> +#include <editeng/editdata.hxx> +#include <editeng/editobj.hxx> +#include <editeng/flditem.hxx> +#include <editeng/fontitem.hxx> +#include <svx/svdotext.hxx> +#include <tools/stream.hxx> +#include <breakit.hxx> + +using rtl::OString; +using rtl::OStringBuffer; +using rtl::OUString; +using rtl::OUStringBuffer; +using namespace sw::util; + +/// Implementation of an empty stream that silently succeeds, but does nothing. +/// +/// In fact, this is a hack. The right solution is to abstract EscherEx to be +/// able to work without SvStream; but at the moment it is better to live with +/// this I guess. +class SvNullStream : public SvStream +{ +protected: + virtual sal_Size GetData( void* pData, sal_Size nSize ) { memset( pData, 0, nSize ); return nSize; } + virtual sal_Size PutData( const void*, sal_Size nSize ) { return nSize; } + virtual sal_Size SeekPos( sal_Size nPos ) { return nPos; } + virtual void SetSize( sal_Size ) {} + virtual void FlushData() {} + +public: + SvNullStream() : SvStream() {} + virtual ~SvNullStream() {} +}; + +RtfSdrExport::RtfSdrExport( RtfExport &rExport ) + : EscherEx( EscherExGlobalRef( new EscherExGlobal ), *( new SvNullStream )), + m_rExport( rExport ), + m_rAttrOutput( (RtfAttributeOutput&)m_rExport.AttrOutput() ), + m_nShapeType( ESCHER_ShpInst_Nil ), + m_pShapeStyle( new OStringBuffer( 200 ) ), + m_pShapeTypeWritten( new bool[ ESCHER_ShpInst_COUNT ] ) +{ + mnGroupLevel = 1; + memset( m_pShapeTypeWritten, 0, ESCHER_ShpInst_COUNT * sizeof( bool ) ); +} + +RtfSdrExport::~RtfSdrExport() +{ + delete mpOutStrm, mpOutStrm = NULL; + delete m_pShapeStyle, m_pShapeStyle = NULL; + delete[] m_pShapeTypeWritten, m_pShapeTypeWritten = NULL; +} + +void RtfSdrExport::OpenContainer( UINT16 nEscherContainer, int nRecInstance ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + EscherEx::OpenContainer( nEscherContainer, nRecInstance ); + + if ( nEscherContainer == ESCHER_SpContainer ) + { + m_nShapeType = ESCHER_ShpInst_Nil; + if ( m_pShapeStyle->getLength() ) + m_pShapeStyle->makeStringAndClear(); + m_pShapeStyle->ensureCapacity( 200 ); + m_aShapeProps.clear(); + } +} + +void RtfSdrExport::CloseContainer() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( mRecTypes.back() == ESCHER_SpContainer ) + { + // write the shape now when we have all the info + sal_Int32 nShapeElement = StartShape(); + EndShape( nShapeElement ); + + // cleanup + m_nShapeType = ESCHER_ShpInst_Nil; + } + + EscherEx::CloseContainer(); +} + +UINT32 RtfSdrExport::EnterGroup( const String& /*rShapeName*/, const Rectangle* /*pRect*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + return GenerateShapeId(); +} + +void RtfSdrExport::LeaveGroup() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* noop */ +} + +void RtfSdrExport::AddShape( UINT32 nShapeType, UINT32 nShapeFlags, UINT32 /*nShapeId*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_nShapeType = nShapeType; + m_nShapeFlags = nShapeFlags; +} + +inline sal_uInt16 impl_GetUInt16( const sal_uInt8* &pVal ) +{ + sal_uInt16 nRet = *pVal++; + nRet += ( *pVal++ ) << 8; + return nRet; +} + +inline sal_Int32 impl_GetPointComponent( const sal_uInt8* &pVal, sal_uInt16 nPointSize ) +{ + sal_Int32 nRet = 0; + if ( ( nPointSize == 0xfff0 ) || ( nPointSize == 4 ) ) + { + sal_uInt16 nUnsigned = *pVal++; + nUnsigned += ( *pVal++ ) << 8; + + nRet = sal_Int16( nUnsigned ); + } + else if ( nPointSize == 8 ) + { + sal_uInt32 nUnsigned = *pVal++; + nUnsigned += ( *pVal++ ) << 8; + nUnsigned += ( *pVal++ ) << 16; + nUnsigned += ( *pVal++ ) << 24; + + nRet = nUnsigned; + } + + return nRet; +} + +void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( m_nShapeType == ESCHER_ShpInst_Nil ) + return; + + if ( m_nShapeType == ESCHER_ShpInst_Line ) + AddLineDimensions( rRect ); + else + AddRectangleDimensions( *m_pShapeStyle, rRect ); + + // properties + const EscherProperties &rOpts = rProps.GetOpts(); + for ( EscherProperties::const_iterator it = rOpts.begin(); it != rOpts.end(); ++it ) + { + sal_uInt16 nId = ( it->nPropId & 0x0FFF ); + + switch ( nId ) + { + case ESCHER_Prop_WrapText: + { + int nWrapType = 0; + switch ( it->nPropValue ) + { + case ESCHER_WrapSquare: nWrapType = 2; break; + case ESCHER_WrapByPoints: nWrapType = 4; break; + case ESCHER_WrapNone: nWrapType = 3; break; + case ESCHER_WrapTopBottom: nWrapType = 1; break; + case ESCHER_WrapThrough: nWrapType = 5; break; + } + if ( nWrapType ) + m_pShapeStyle->append(OOO_STRING_SVTOOLS_RTF_SHPWR).append((sal_Int32)nWrapType); + } + break; + case ESCHER_Prop_fillColor: + m_aShapeProps.insert(std::pair<OString,OString>(OString("fillColor"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_fillBackColor: + m_aShapeProps.insert(std::pair<OString,OString>(OString("fillBackColor"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_AnchorText: + m_aShapeProps.insert(std::pair<OString,OString>(OString("anchorText"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_fNoFillHitTest: + if (it->nPropValue) + m_aShapeProps.insert(std::pair<OString,OString>(OString("fNoFillHitTest"), OString::valueOf(sal_Int32(1)))); + break; + case ESCHER_Prop_fNoLineDrawDash: + // for some reason the value is set to 0x90000 if lines are switched off + if( it->nPropValue == 0x90000 ) + m_aShapeProps.insert(std::pair<OString,OString>(OString("fLine"), OString::valueOf(sal_Int32(0)))); + break; + case ESCHER_Prop_lineColor: + m_aShapeProps.insert(std::pair<OString,OString>(OString("lineColor"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_lineBackColor: + m_aShapeProps.insert(std::pair<OString,OString>(OString("lineBackColor"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_lineJoinStyle: + m_aShapeProps.insert(std::pair<OString,OString>(OString("lineJoinStyle"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_fshadowObscured: + if (it->nPropValue) + m_aShapeProps.insert(std::pair<OString,OString>(OString("fshadowObscured"), OString::valueOf(sal_Int32(1)))); + break; + case ESCHER_Prop_geoLeft: + case ESCHER_Prop_geoTop: + { + sal_uInt32 nLeft = 0, nTop = 0; + + if ( nId == ESCHER_Prop_geoLeft ) + { + nLeft = it->nPropValue; + rProps.GetOpt( ESCHER_Prop_geoTop, nTop ); + } + else + { + nTop = it->nPropValue; + rProps.GetOpt( ESCHER_Prop_geoLeft, nLeft ); + } + + m_aShapeProps.insert(std::pair<OString,OString>(OString("geoLeft"), + OString::valueOf(sal_Int32(sal_Int32( nLeft ))))); + m_aShapeProps.insert(std::pair<OString,OString>(OString("geoTop"), + OString::valueOf(sal_Int32(sal_Int32( nTop ))))); + } + break; + + case ESCHER_Prop_geoRight: + case ESCHER_Prop_geoBottom: + { + sal_uInt32 nLeft = 0, nRight = 0, nTop = 0, nBottom = 0; + rProps.GetOpt( ESCHER_Prop_geoLeft, nLeft ); + rProps.GetOpt( ESCHER_Prop_geoTop, nTop ); + + if ( nId == ESCHER_Prop_geoRight ) + { + nRight = it->nPropValue; + rProps.GetOpt( ESCHER_Prop_geoBottom, nBottom ); + } + else + { + nBottom = it->nPropValue; + rProps.GetOpt( ESCHER_Prop_geoRight, nRight ); + } + + m_aShapeProps.insert(std::pair<OString,OString>(OString("geoRight"), + OString::valueOf(sal_Int32(sal_Int32( nRight ) - sal_Int32( nLeft ))))); + m_aShapeProps.insert(std::pair<OString,OString>(OString("geoBottom"), + OString::valueOf(sal_Int32(sal_Int32( nBottom ) - sal_Int32( nTop ))))); + } + break; + case ESCHER_Prop_pVertices: + case ESCHER_Prop_pSegmentInfo: + { + EscherPropSortStruct aVertices; + EscherPropSortStruct aSegments; + + if ( rProps.GetOpt( ESCHER_Prop_pVertices, aVertices ) && + rProps.GetOpt( ESCHER_Prop_pSegmentInfo, aSegments ) ) + { + const sal_uInt8 *pVerticesIt = aVertices.pBuf + 6; + const sal_uInt8 *pSegmentIt = aSegments.pBuf; + + OStringBuffer aSegmentInfo( 512 ); + OStringBuffer aVerticies( 512 ); + + sal_uInt16 nPointSize = aVertices.pBuf[4] + ( aVertices.pBuf[5] << 8 ); + + // number of segments + sal_uInt16 nSegments = impl_GetUInt16( pSegmentIt ); + sal_Int32 nVertices = 0; + aSegmentInfo.append("2;").append((sal_Int32)nSegments); + pSegmentIt += 4; + + for ( ; nSegments; --nSegments ) + { + sal_uInt16 nSeg = impl_GetUInt16( pSegmentIt ); + aSegmentInfo.append(';').append((sal_Int32)nSeg); + switch ( nSeg ) + { + case 0x0001: // lineto + case 0x4000: // moveto + { + sal_Int32 nX = impl_GetPointComponent( pVerticesIt, nPointSize ); + sal_Int32 nY = impl_GetPointComponent( pVerticesIt, nPointSize ); + aVerticies.append( ";(" ).append( nX ).append( "," ).append( nY ).append( ")" ); + nVertices ++; + } + break; + case 0x2001: // curveto + { + for (int i = 0; i < 3; i++) + { + sal_Int32 nX = impl_GetPointComponent( pVerticesIt, nPointSize ); + sal_Int32 nY = impl_GetPointComponent( pVerticesIt, nPointSize ); + aVerticies.append( ";(" ).append( nX ).append( "," ).append( nY ).append( ")" ); + nVertices ++; + } + } + break; + case 0xb300: + case 0xac00: + case 0xaa00: // nofill + case 0xab00: // nostroke + case 0x6001: // close + case 0x8000: // end + break; + default: + OSL_TRACE("%s: unhandled segment '%x' in the path", OSL_THIS_FUNC, nSeg); + break; + } + } + + if (aVerticies.getLength() ) + { + // We know the number of vertices at the end only, so we have to prepend them here. + OStringBuffer aBuf; + aBuf.append("8;").append((sal_Int32)nVertices); + aBuf.append(aVerticies.makeStringAndClear()); + m_aShapeProps.insert(std::pair<OString,OString>(OString("pVerticies"), aBuf.makeStringAndClear())); + } + if ( aSegmentInfo.getLength() ) + m_aShapeProps.insert(std::pair<OString,OString>(OString("pSegmentInfo"), aSegmentInfo.makeStringAndClear())); + } + else + OSL_TRACE("%s: unhandled shape path, missing either pVertices or pSegmentInfo", OSL_THIS_FUNC); + } + break; + case ESCHER_Prop_shapePath: + // noop, we use pSegmentInfo instead + break; + case ESCHER_Prop_fFillOK: + if (!it->nPropValue) + m_aShapeProps.insert(std::pair<OString,OString>(OString("fFillOK"), OString::valueOf(sal_Int32(0)))); + break; + case ESCHER_Prop_dxTextLeft: + m_aShapeProps.insert(std::pair<OString,OString>(OString("dxTextLeft"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_dyTextTop: + m_aShapeProps.insert(std::pair<OString,OString>(OString("dyTextTop"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_dxTextRight: + m_aShapeProps.insert(std::pair<OString,OString>(OString("dxTextRight"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_dyTextBottom: + m_aShapeProps.insert(std::pair<OString,OString>(OString("dyTextBottom"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_FitTextToShape: + // Size text to fit shape size: not supported by RTF + break; + case ESCHER_Prop_adjustValue: + m_aShapeProps.insert(std::pair<OString,OString>(OString("adjustValue"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_txflTextFlow: + m_aShapeProps.insert(std::pair<OString,OString>(OString("txflTextFlow"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + default: + OSL_TRACE("%s: unhandled property: %d (value: %d)", OSL_THIS_FUNC, nId, it->nPropValue); + break; + } + } +} + +void RtfSdrExport::AddLineDimensions( const Rectangle& rRectangle ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // We get the position relative to (the current?) character + m_aShapeProps.insert(std::pair<OString,OString>(OString("posrelh"), OString::valueOf(sal_Int32(3)))); + + switch ( m_nShapeFlags & 0xC0 ) + { + case 0x40: + m_aShapeProps.insert(std::pair<OString,OString>(OString("fFlipV"), OString::valueOf(sal_Int32(1)))); + break; + case 0x80: + m_aShapeProps.insert(std::pair<OString,OString>(OString("fFlipH"), OString::valueOf(sal_Int32(1)))); + break; + case 0xC0: + m_aShapeProps.insert(std::pair<OString,OString>(OString("fFlipV"), OString::valueOf(sal_Int32(1)))); + m_aShapeProps.insert(std::pair<OString,OString>(OString("fFlipH"), OString::valueOf(sal_Int32(1)))); + break; + } + + // the actual dimensions + m_pShapeStyle->append(OOO_STRING_SVTOOLS_RTF_SHPLEFT).append(rRectangle.Left()); + m_pShapeStyle->append(OOO_STRING_SVTOOLS_RTF_SHPTOP).append(rRectangle.Top()); + m_pShapeStyle->append(OOO_STRING_SVTOOLS_RTF_SHPRIGHT).append(rRectangle.Right()); + m_pShapeStyle->append(OOO_STRING_SVTOOLS_RTF_SHPBOTTOM).append(rRectangle.Bottom()); +} + +void RtfSdrExport::AddRectangleDimensions( rtl::OStringBuffer& rBuffer, const Rectangle& rRectangle ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // We get the position relative to (the current?) character + m_aShapeProps.insert(std::pair<OString,OString>(OString("posrelh"), OString::valueOf(sal_Int32(3)))); + + rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPLEFT).append(rRectangle.Left()); + rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPTOP).append(rRectangle.Top()); + rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPRIGHT).append(rRectangle.Right()); + rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPBOTTOM).append(rRectangle.Bottom()); +} + +void RtfSdrExport::AddShapeAttribute( sal_Int32 /*nAttribute*/, const rtl::OString& /*rValue*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* noop */ +} + +extern const char* pShapeTypes[]; + +void lcl_AppendSP( ::rtl::OStringBuffer& rRunText, const char cName[], const ::rtl::OString& rValue) +{ + rRunText.append('{').append(OOO_STRING_SVTOOLS_RTF_SP) + .append('{').append(OOO_STRING_SVTOOLS_RTF_SN " ").append(cName).append('}') + .append('{').append(OOO_STRING_SVTOOLS_RTF_SV " ").append(rValue).append('}') + .append('}'); +} +sal_Int32 RtfSdrExport::StartShape() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( m_nShapeType == ESCHER_ShpInst_Nil ) + return -1; + + m_aShapeProps.insert(std::pair<OString,OString>(OString("shapeType"), OString::valueOf(sal_Int32(m_nShapeType)))); + + m_rAttrOutput.RunText().append('{').append(OOO_STRING_SVTOOLS_RTF_SHP); + m_rAttrOutput.RunText().append('{').append(OOO_STRING_SVTOOLS_RTF_IGNORE).append(OOO_STRING_SVTOOLS_RTF_SHPINST); + + m_rAttrOutput.RunText().append(m_pShapeStyle->makeStringAndClear()); + // Ignore \shpbxpage, \shpbxmargin, and \shpbxcolumn, in favor of the posrelh property. + m_rAttrOutput.RunText().append(OOO_STRING_SVTOOLS_RTF_SHPBXIGNORE); + // Ignore \shpbypage, \shpbymargin, and \shpbycolumn, in favor of the posrelh property. + m_rAttrOutput.RunText().append(OOO_STRING_SVTOOLS_RTF_SHPBYIGNORE); + + for(std::map<OString,OString>::reverse_iterator i = m_aShapeProps.rbegin(); i != m_aShapeProps.rend(); i++) + lcl_AppendSP(m_rAttrOutput.RunText(), (*i).first, (*i).second ); + + lcl_AppendSP(m_rAttrOutput.RunText(), "wzDescription", RtfExport::OutString( m_pSdrObject->GetDescription(), m_rExport.eCurrentEncoding)); + lcl_AppendSP(m_rAttrOutput.RunText(), "wzName", RtfExport::OutString( m_pSdrObject->GetTitle(), m_rExport.eCurrentEncoding)); + + // now check if we have some text + const SdrTextObj* pTxtObj = PTR_CAST(SdrTextObj, m_pSdrObject); + if (pTxtObj) + { + const OutlinerParaObject* pParaObj = 0; + bool bOwnParaObj = false; + + /* + #i13885# + When the object is actively being edited, that text is not set into + the objects normal text object, but lives in a seperate object. + */ + if (pTxtObj->IsTextEditActive()) + { + pParaObj = pTxtObj->GetEditOutlinerParaObject(); + bOwnParaObj = true; + } + else + { + pParaObj = pTxtObj->GetOutlinerParaObject(); + } + + if( pParaObj ) + { + // this is reached only in case some text is attached to the shape + WriteOutliner(*pParaObj); + if( bOwnParaObj ) + delete pParaObj; + } + } + + return m_nShapeType; +} + +void RtfSdrExport::WriteOutliner(const OutlinerParaObject& rParaObj) +{ + OSL_TRACE("%s start", OSL_THIS_FUNC); + + const EditTextObject& rEditObj = rParaObj.GetTextObject(); + MSWord_SdrAttrIter aAttrIter( m_rExport, rEditObj, TXT_HFTXTBOX ); + + USHORT nPara = rEditObj.GetParagraphCount(); + + m_rAttrOutput.RunText().append('{').append(OOO_STRING_SVTOOLS_RTF_SHPTXT).append(' '); + for (USHORT n = 0; n < nPara; ++n) + { + if( n ) + aAttrIter.NextPara( n ); + + rtl_TextEncoding eChrSet = aAttrIter.GetNodeCharSet(); + + String aStr( rEditObj.GetText( n )); + xub_StrLen nAktPos = 0; + xub_StrLen nEnd = aStr.Len(); + + aAttrIter.OutParaAttr(false); + m_rAttrOutput.RunText().append(m_rAttrOutput.Styles().makeStringAndClear()); + + do { + xub_StrLen nNextAttr = aAttrIter.WhereNext(); + rtl_TextEncoding eNextChrSet = aAttrIter.GetNextCharSet(); + + if( nNextAttr > nEnd ) + nNextAttr = nEnd; + + aAttrIter.OutAttr( nAktPos ); + m_rAttrOutput.RunText().append('{').append(m_rAttrOutput.Styles().makeStringAndClear()).append(m_rExport.sNewLine); + bool bTxtAtr = aAttrIter.IsTxtAttr( nAktPos ); + if( !bTxtAtr ) + { + String aOut( aStr.Copy( nAktPos, nNextAttr - nAktPos ) ); + m_rAttrOutput.RunText().append( m_rExport.OutString( aOut, eChrSet ) ); + } + + m_rAttrOutput.RunText().append('}'); + + nAktPos = nNextAttr; + eChrSet = eNextChrSet; + aAttrIter.NextPos(); + } + while( nAktPos < nEnd ); + } + m_rAttrOutput.RunText().append(OOO_STRING_SVTOOLS_RTF_PAR).append('}'); + + OSL_TRACE("%s end", OSL_THIS_FUNC); +} + +void RtfSdrExport::EndShape( sal_Int32 nShapeElement ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( nShapeElement >= 0 ) + { + // end of the shape + m_rAttrOutput.RunText().append('}').append('}'); + } +} + +UINT32 RtfSdrExport::AddSdrObject( const SdrObject& rObj ) +{ + m_pSdrObject = &rObj; + return EscherEx::AddSdrObject(rObj); +} + +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfsdrexport.hxx b/sw/source/filter/ww8/rtfsdrexport.hxx new file mode 100644 index 0000000000..775e348eef --- /dev/null +++ b/sw/source/filter/ww8/rtfsdrexport.hxx @@ -0,0 +1,115 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2010 Miklos Vajna. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _RTFSdrEXPORT_HXX_ +#define _RTFSdrEXPORT_HXX_ + +#include <filter/msfilter/escherex.hxx> +#include <editeng/outlobj.hxx> +#include <rtl/strbuf.hxx> + +#include <map> + +class RtfExport; +class RtfAttributeOutput; + +class RtfSdrExport : public EscherEx +{ + RtfExport &m_rExport; + + RtfAttributeOutput &m_rAttrOutput; + + const SdrObject* m_pSdrObject; + + /// Remember the shape type. + sal_uInt32 m_nShapeType; + + /// Remember the shape flags. + sal_uInt32 m_nShapeFlags; + + /// Remember style, the most important shape attribute ;-) + rtl::OStringBuffer *m_pShapeStyle; + + std::map<rtl::OString,rtl::OString> m_aShapeProps; + + /// Remember which shape types we had already written. + bool *m_pShapeTypeWritten; + +public: + RtfSdrExport( RtfExport &rExport ); + virtual ~RtfSdrExport(); + + /// Export the sdr object as Sdr. + /// + /// Call this when you need to export the object as Sdr in RTF. + UINT32 AddSdrObject( const SdrObject& rObj ); + +protected: + /// Add an attribute to the generated shape element. + /// + /// This should be called from within StartShape() to ensure that the + /// added attribute is preserved. + void AddShapeAttribute( sal_Int32 nAttribute, const rtl::OString& sValue ); + + /// Start the shape for which we just collected the information. + /// + /// Returns the element's tag number, -1 means we wrote nothing. + using EscherEx::StartShape; + virtual sal_Int32 StartShape(); + + /// End the shape. + /// + /// The parameter is just what we got from StartShape(). + using EscherEx::EndShape; + virtual void EndShape( sal_Int32 nShapeElement ); + + virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect ); + +private: + + virtual void OpenContainer( UINT16 nEscherContainer, int nRecInstance = 0 ); + virtual void CloseContainer(); + + using EscherEx::EnterGroup; + virtual UINT32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 ); + virtual void LeaveGroup(); + + virtual void AddShape( UINT32 nShapeType, UINT32 nShapeFlags, UINT32 nShapeId = 0 ); + +private: + /// Add starting and ending point of a line to the m_pShapeAttrList. + void AddLineDimensions( const Rectangle& rRectangle ); + + /// Add position and size to the OStringBuffer. + void AddRectangleDimensions( rtl::OStringBuffer& rBuffer, const Rectangle& rRectangle ); + + void WriteOutliner(const OutlinerParaObject& rParaObj); +}; + +#endif // _RTFSdrEXPORT_HXX_ +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 652d8a4a12..2680ca7690 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -466,9 +466,21 @@ namespace sw } //SetLayer boilerplate end - void GetPoolItems(const SfxItemSet &rSet, PoolItems &rItems) + void GetPoolItems(const SfxItemSet &rSet, PoolItems &rItems, bool bExportParentItemSet ) { - if (rSet.Count()) + if( bExportParentItemSet ) + { + USHORT nTotal = rSet.TotalCount(); + for( USHORT nItem =0; nItem < nTotal; ++nItem ) + { + const SfxPoolItem* pItem = 0; + if( SFX_ITEM_SET == rSet.GetItemState( rSet.GetWhichByPos( nItem ), true, &pItem ) ) + { + rItems[pItem->Which()] = pItem; + } + } + } + else if( rSet.Count()) { SfxItemIter aIter(rSet); if (const SfxPoolItem *pItem = aIter.GetCurItem()) diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx index 94ea0bf08d..1606d0d0df 100644 --- a/sw/source/filter/ww8/writerhelper.hxx +++ b/sw/source/filter/ww8/writerhelper.hxx @@ -590,7 +590,7 @@ namespace sw @author <a href="mailto:cmc@openoffice.org">Caolán McNamara</a> */ - void GetPoolItems(const SfxItemSet &rSet, PoolItems &rItems); + void GetPoolItems(const SfxItemSet &rSet, PoolItems &rItems, bool bExportParentItemSet ); const SfxPoolItem *SearchPoolItems(const PoolItems &rItems, sal_uInt16 eType); diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 72dbabefd9..a573d9a6b7 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -343,7 +343,8 @@ void WW8Export::DoFormText(const SwInputField * pFld) OutputField(0, ww::eFORMTEXT, aEmptyStr, WRITEFIELD_CMD_END); - SwWW8Writer::WriteString16(Strm(), pFld->Expand(), false); + String const fieldStr( pFld->ExpandField(true) ); + SwWW8Writer::WriteString16(Strm(), fieldStr, false); static BYTE aArr2[] = { 0x03, 0x6a, 0x00, 0x00, 0x00, 0x00, // sprmCPicLocation @@ -811,49 +812,7 @@ void WW8Export::AppendFlyInFlys(const sw::Frame& rFrmFmt, OutputField(0, ww::eSHAPE, aEmptyStr, WRITEFIELD_CLOSE); } -class WW8_SdrAttrIter : public MSWordAttrIter -{ -private: - const EditTextObject* pEditObj; - const SfxItemPool* pEditPool; - EECharAttribArray aTxtAtrArr; - SvPtrarr aChrTxtAtrArr; - SvUShorts aChrSetArr; - USHORT nPara; - xub_StrLen nAktSwPos; - xub_StrLen nTmpSwPos; // fuer HasItem() - rtl_TextEncoding eNdChrSet; - USHORT nScript; - BYTE mnTyp; - - xub_StrLen SearchNext( xub_StrLen nStartPos ); - void SetCharSet(const EECharAttrib& rTxtAttr, bool bStart); - - //No copying - WW8_SdrAttrIter(const WW8_SdrAttrIter&); - WW8_SdrAttrIter& operator=(const WW8_SdrAttrIter&); -public: - WW8_SdrAttrIter( WW8Export& rWr, const EditTextObject& rEditObj, - BYTE nType ); - void NextPara( USHORT nPar ); - void OutParaAttr(bool bCharAttr); - void OutEEField(const SfxPoolItem& rHt); - - bool IsTxtAttr(xub_StrLen nSwPos); - - void NextPos() { nAktSwPos = SearchNext( nAktSwPos + 1 ); } - - void OutAttr( xub_StrLen nSwPos ); - virtual const SfxPoolItem* HasTextItem( USHORT nWhich ) const; - virtual const SfxPoolItem& GetItem( USHORT nWhich ) const; - bool OutAttrWithRange(xub_StrLen nPos); - xub_StrLen WhereNext() const { return nAktSwPos; } - rtl_TextEncoding GetNextCharSet() const; - rtl_TextEncoding GetNodeCharSet() const { return eNdChrSet; } -}; - - -WW8_SdrAttrIter::WW8_SdrAttrIter( WW8Export& rWr, +MSWord_SdrAttrIter::MSWord_SdrAttrIter( MSWordExportBase& rWr, const EditTextObject& rEditObj, BYTE nTyp ) : MSWordAttrIter( rWr ), pEditObj(&rEditObj), pEditPool(0), aTxtAtrArr( 0, 4 ), aChrTxtAtrArr( 0, 4 ), aChrSetArr( 0, 4 ), @@ -862,7 +821,7 @@ WW8_SdrAttrIter::WW8_SdrAttrIter( WW8Export& rWr, NextPara( 0 ); } -void WW8_SdrAttrIter::NextPara( USHORT nPar ) +void MSWord_SdrAttrIter::NextPara( USHORT nPar ) { nPara = nPar; // Attributwechsel an Pos 0 wird ignoriert, da davon ausgegangen @@ -885,7 +844,7 @@ void WW8_SdrAttrIter::NextPara( USHORT nPar ) nAktSwPos = SearchNext( 1 ); } -rtl_TextEncoding WW8_SdrAttrIter::GetNextCharSet() const +rtl_TextEncoding MSWord_SdrAttrIter::GetNextCharSet() const { if( aChrSetArr.Count() ) return (rtl_TextEncoding)aChrSetArr[ aChrSetArr.Count() - 1 ]; @@ -893,7 +852,7 @@ rtl_TextEncoding WW8_SdrAttrIter::GetNextCharSet() const } // der erste Parameter in SearchNext() liefert zurueck, ob es ein TxtAtr ist. -xub_StrLen WW8_SdrAttrIter::SearchNext( xub_StrLen nStartPos ) +xub_StrLen MSWord_SdrAttrIter::SearchNext( xub_StrLen nStartPos ) { xub_StrLen nPos; xub_StrLen nMinPos = STRING_MAXLEN; @@ -932,7 +891,7 @@ xub_StrLen WW8_SdrAttrIter::SearchNext( xub_StrLen nStartPos ) return nMinPos; } -void WW8_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart) +void MSWord_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart) { void* p = 0; rtl_TextEncoding eChrSet; @@ -962,7 +921,7 @@ void WW8_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart) } } -void WW8_SdrAttrIter::OutEEField(const SfxPoolItem& rHt) +void MSWord_SdrAttrIter::OutEEField(const SfxPoolItem& rHt) { const SvxFieldItem &rField = (const SvxFieldItem &)rHt; const SvxFieldData *pFld = rField.GetField(); @@ -981,7 +940,7 @@ void WW8_SdrAttrIter::OutEEField(const SfxPoolItem& rHt) } } -void WW8_SdrAttrIter::OutAttr( xub_StrLen nSwPos ) +void MSWord_SdrAttrIter::OutAttr( xub_StrLen nSwPos ) { OutParaAttr(true); @@ -1038,7 +997,7 @@ void WW8_SdrAttrIter::OutAttr( xub_StrLen nSwPos ) } } -bool WW8_SdrAttrIter::IsTxtAttr(xub_StrLen nSwPos) +bool MSWord_SdrAttrIter::IsTxtAttr(xub_StrLen nSwPos) { for (USHORT i = 0; i < aTxtAtrArr.Count(); ++i) { @@ -1063,7 +1022,7 @@ bool WW8_SdrAttrIter::IsTxtAttr(xub_StrLen nSwPos) // Attribut-Anfangposition fragen kann. // Es koennen nur Attribute mit Ende abgefragt werden. // Es wird mit bDeep gesucht -const SfxPoolItem* WW8_SdrAttrIter::HasTextItem(USHORT nWhich) const +const SfxPoolItem* MSWord_SdrAttrIter::HasTextItem(USHORT nWhich) const { const SfxPoolItem* pRet = 0; nWhich = sw::hack::TransformWhichBetweenPools(*pEditPool, @@ -1088,7 +1047,7 @@ const SfxPoolItem* WW8_SdrAttrIter::HasTextItem(USHORT nWhich) const return pRet; } -const SfxPoolItem& WW8_SdrAttrIter::GetItem( USHORT nWhich ) const +const SfxPoolItem& MSWord_SdrAttrIter::GetItem( USHORT nWhich ) const { using sw::hack::GetSetWhichFromSwDocWhich; const SfxPoolItem* pRet = HasTextItem(nWhich); @@ -1102,7 +1061,7 @@ const SfxPoolItem& WW8_SdrAttrIter::GetItem( USHORT nWhich ) const return *pRet; } -void WW8_SdrAttrIter::OutParaAttr(bool bCharAttr) +void MSWord_SdrAttrIter::OutParaAttr(bool bCharAttr) { SfxItemSet aSet( pEditObj->GetParaAttribs( nPara )); if( aSet.Count() ) @@ -1175,7 +1134,7 @@ void WW8Export::WriteOutliner(const OutlinerParaObject& rParaObj, BYTE nTyp) { bool bAnyWrite = false; const EditTextObject& rEditObj = rParaObj.GetTextObject(); - WW8_SdrAttrIter aAttrIter( *this, rEditObj, nTyp ); + MSWord_SdrAttrIter aAttrIter( *this, rEditObj, nTyp ); USHORT nPara = rEditObj.GetParagraphCount(); BYTE bNul = 0; diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index d22decdf9a..8099c3037f 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -540,7 +540,7 @@ void SwAttrIter::OutAttr( xub_StrLen nSwPos ) ClearOverridesFromSet( *pCharFmtItem, aExportSet ); sw::PoolItems aExportItems; - GetPoolItems( aExportSet, aExportItems ); + GetPoolItems( aExportSet, aExportItems, false ); sw::cPoolItemIter aEnd = aRangeItems.end(); for ( sw::cPoolItemIter aI = aRangeItems.begin(); aI != aEnd; ++aI ) @@ -1646,14 +1646,136 @@ void WW8AttributeOutput::FormatDrop( const SwTxtNode& rNode, const SwFmtDrop &rS m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() ); } -xub_StrLen MSWordExportBase::GetNextPos( SwAttrIter* aAttrIter, const SwTxtNode& /*rNode*/, xub_StrLen /*nAktPos*/ ) +xub_StrLen MSWordExportBase::GetNextPos( SwAttrIter* aAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos ) { - return aAttrIter->WhereNext(); + // Get the bookmarks for the normal run + xub_StrLen nNextPos = aAttrIter->WhereNext(); + + GetSortedBookmarks( rNode, nAktPos, nNextPos - nAktPos ); + + xub_StrLen nNextBookmark = nNextPos; + NearestBookmark( nNextPos, nAktPos, false ); + + return std::min( nNextPos, nNextBookmark ); +} + +void MSWordExportBase::UpdatePosition( SwAttrIter* aAttrIter, xub_StrLen nAktPos, xub_StrLen /*nEnd*/ ) +{ + xub_StrLen nNextPos; + + // go to next attribute if no bookmark is found of if the bookmark is behind the next attribute position + bool bNextBookmark = NearestBookmark( nNextPos, nAktPos, true ); + if( !bNextBookmark || nNextPos < aAttrIter->WhereNext() ) + aAttrIter->NextPos(); +} + +bool MSWordExportBase::GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt, + xub_StrLen nEnd, IMarkVector& rArr ) +{ + IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); + ULONG nNd = rNd.GetIndex( ); + + const sal_Int32 nMarks = pMarkAccess->getMarksCount(); + for ( sal_Int32 i = 0; i < nMarks; i++ ) + { + IMark* pMark = ( pMarkAccess->getMarksBegin() + i )->get(); + + // Only keep the bookmarks starting or ending in this node + if ( pMark->GetMarkStart().nNode == nNd || + pMark->GetMarkEnd().nNode == nNd ) + { + xub_StrLen nBStart = pMark->GetMarkStart().nContent.GetIndex(); + xub_StrLen nBEnd = pMark->GetMarkEnd().nContent.GetIndex(); + + // Keep only the bookmars starting or ending in the snippet + bool bIsStartOk = ( nBStart >= nStt ) && ( nBStart <= nEnd ); + bool bIsEndOk = ( nBEnd >= nStt ) && ( nBEnd <= nEnd ); + + if ( bIsStartOk || bIsEndOk ) + rArr.push_back( pMark ); + } + } + return ( rArr.size() > 0 ); } -void MSWordExportBase::UpdatePosition( SwAttrIter* aAttrIter, xub_StrLen /*nAktPos*/, xub_StrLen /*nEnd*/ ) +class CompareMarksEnd : public std::binary_function < const IMark *, const IMark *, bool > { - aAttrIter->NextPos(); +public: + inline bool operator() ( const IMark * pOneB, const IMark * pTwoB ) const + { + xub_StrLen nOEnd = pOneB->GetMarkEnd().nContent.GetIndex(); + xub_StrLen nTEnd = pTwoB->GetMarkEnd().nContent.GetIndex(); + + return nOEnd < nTEnd; + } +}; + +bool MSWordExportBase::NearestBookmark( xub_StrLen& rNearest, const xub_StrLen nAktPos, bool bNextPositionOnly ) +{ + bool bHasBookmark = false; + + if ( m_rSortedMarksStart.size( ) > 0 ) + { + IMark* pMarkStart = m_rSortedMarksStart.front(); + xub_StrLen nNext = pMarkStart->GetMarkStart().nContent.GetIndex(); + if( !bNextPositionOnly || (nNext > nAktPos )) + { + rNearest = nNext; + bHasBookmark = true; + } + } + + if ( m_rSortedMarksEnd.size( ) > 0 ) + { + IMark* pMarkEnd = m_rSortedMarksEnd[0]; + xub_StrLen nNext = pMarkEnd->GetMarkEnd().nContent.GetIndex(); + if( !bNextPositionOnly || nNext > nAktPos ) + { + if ( !bHasBookmark ) + rNearest = nNext; + else + rNearest = std::min( rNearest, nNext ); + bHasBookmark = true; + } + } + + return bHasBookmark; +} + +void MSWordExportBase::GetSortedBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen ) +{ + IMarkVector aMarksStart; + if ( GetBookmarks( rNode, nAktPos, nAktPos + nLen, aMarksStart ) ) + { + IMarkVector aSortedEnd; + IMarkVector aSortedStart; + for ( IMarkVector::const_iterator it = aMarksStart.begin(), end = aMarksStart.end(); + it < end; ++it ) + { + IMark* pMark = (*it); + + // Remove the positions egals to the current pos + xub_StrLen nStart = pMark->GetMarkStart().nContent.GetIndex(); + xub_StrLen nEnd = pMark->GetMarkEnd().nContent.GetIndex(); + + if ( nStart > nAktPos && ( pMark->GetMarkStart().nNode == rNode.GetIndex()) ) + aSortedStart.push_back( pMark ); + + if ( nEnd > nAktPos && nEnd <= ( nAktPos + nLen ) && (pMark->GetMarkEnd().nNode == rNode.GetIndex()) ) + aSortedEnd.push_back( pMark ); + } + + // Sort the bookmarks by end position + std::sort( aSortedEnd.begin(), aSortedEnd.end(), CompareMarksEnd() ); + + m_rSortedMarksStart.swap( aSortedStart ); + m_rSortedMarksEnd.swap( aSortedEnd ); + } + else + { + m_rSortedMarksStart.clear( ); + m_rSortedMarksEnd.clear( ); + } } void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) @@ -2188,7 +2310,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) pOutFmtNode = &rNode; // Pap-Attrs, so script is not necessary - OutputItemSet( *pNewSet, true, false, i18n::ScriptType::LATIN); + OutputItemSet( *pNewSet, true, false, i18n::ScriptType::LATIN, false); pStyAttr = 0; pOutFmtNode = pOldMod; diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index 2ed01f48a8..0fc020a84b 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -268,7 +268,7 @@ void WW8AttributeOutput::NumberingLevel( BYTE /*nLevel*/, m_rWW8Export.InsUInt16( nFontID ); } - m_rWW8Export.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN ); + m_rWW8Export.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rWW8Export.mbExportModeRTF ); m_rWW8Export.pO = pOldpO; } @@ -721,6 +721,9 @@ void MSWordExportBase::SubstituteBullet( String& rNumStr, StarSymbolToMSMultiFont *pConvert = 0; FontFamily eFamily = FAMILY_DECORATIVE; + if (!bSubstituteBullets) + return; + if (!pConvert) { pConvert = CreateStarSymbolToMSMultiFont(); diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 651c09e0ae..8a8b12ceb6 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -79,6 +79,7 @@ #include "ww8par.hxx" #include "ww8attributeoutput.hxx" #include "docxattributeoutput.hxx" +#include "rtfattributeoutput.hxx" using namespace sw::util; using namespace nsHdFtFlags; @@ -713,6 +714,17 @@ void wwFont::WriteDocx( const DocxAttributeOutput* rAttrOutput ) const } #endif +void wwFont::WriteRtf( const RtfAttributeOutput* rAttrOutput ) const +{ + rAttrOutput->FontFamilyType( meFamily, *this ); + rAttrOutput->FontPitchType( mePitch ); + rAttrOutput->FontCharset( sw::ms::rtl_TextEncodingToWinCharset( meChrSet ) ); + rAttrOutput->StartFont( msFamilyNm ); + if ( mbAlt ) + rAttrOutput->FontAlternateName( msAltNm ); + rAttrOutput->EndFont(); +} + bool operator<(const wwFont &r1, const wwFont &r2) { int nRet = memcmp(r1.maWW8_FFN, r2.maWW8_FFN, sizeof(r1.maWW8_FFN)); @@ -765,6 +777,22 @@ void wwFontHelper::InitFontTable(bool bWrtWW8,const SwDoc& rDoc) GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(), pFont->GetFamily(), pFont->GetCharSet(),bWrtWW8)); } + + if (!bLoadAllFonts) + return; + + const USHORT aTypes[] = { RES_CHRATR_FONT, RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_FONT, 0 }; + for (const USHORT* pId = aTypes; *pId; ++pId) + { + USHORT nMaxItem = rPool.GetItemCount2( *pId ); + for( USHORT nGet = 0; nGet < nMaxItem; ++nGet ) + if( 0 != (pFont = (const SvxFontItem*)rPool.GetItem2( + *pId, nGet )) ) + { + GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(), + pFont->GetFamily(), pFont->GetCharSet(),bWrtWW8)); + } + } } USHORT wwFontHelper::GetId(const Font& rFont) @@ -839,6 +867,14 @@ void wwFontHelper::WriteFontTable( const DocxAttributeOutput& rAttrOutput ) } #endif +void wwFontHelper::WriteFontTable( const RtfAttributeOutput& rAttrOutput ) +{ + ::std::vector<const wwFont *> aFontList( AsVector() ); + + ::std::for_each( aFontList.begin(), aFontList.end(), + ::std::bind2nd( ::std::mem_fun( &wwFont::WriteRtf ), &rAttrOutput ) ); +} + /* */ WW8_WrPlc0::WW8_WrPlc0( ULONG nOffset ) diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 2cf3a421e2..656059ac25 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1284,7 +1284,7 @@ void WW8_WrtBookmarks::Append( WW8_CP nStartCp, const String& rNm, const ::sw:: aSttCps.Insert(nStartCp, nPos); aEndCps.Insert(nStartCp, nPos); - aFieldMarks.Insert(BOOL(false), nPos); + aFieldMarks.insert(aFieldMarks.begin() + nPos, BOOL(false)); maSwBkmkNms.insert(aIter, rNm); } else @@ -2859,10 +2859,10 @@ void MSWordExportBase::CollectOutlineBookmarks(const SwDoc &rDoc) const SwTxtINetFmt* pTxtAttr; const SwTxtNode* pTxtNd; - USHORT n, nMaxItems = rDoc.GetAttrPool().GetItemCount( RES_TXTATR_INETFMT ); + sal_uInt32 n, nMaxItems = rDoc.GetAttrPool().GetItemCount2( RES_TXTATR_INETFMT ); for( n = 0; n < nMaxItems; ++n ) { - if( 0 != (pINetFmt = (SwFmtINetFmt*)rDoc.GetAttrPool().GetItem( + if( 0 != (pINetFmt = (SwFmtINetFmt*)rDoc.GetAttrPool().GetItem2( RES_TXTATR_INETFMT, n ) ) && 0 != ( pTxtAttr = pINetFmt->GetTxtINetFmt()) && 0 != ( pTxtNd = pTxtAttr->GetpTxtNode() ) && @@ -2873,10 +2873,10 @@ void MSWordExportBase::CollectOutlineBookmarks(const SwDoc &rDoc) } const SwFmtURL *pURL; - nMaxItems = rDoc.GetAttrPool().GetItemCount( RES_URL ); + nMaxItems = rDoc.GetAttrPool().GetItemCount2( RES_URL ); for( n = 0; n < nMaxItems; ++n ) { - if( 0 != (pURL = (SwFmtURL*)rDoc.GetAttrPool().GetItem( + if( 0 != (pURL = (SwFmtURL*)rDoc.GetAttrPool().GetItem2( RES_URL, n ) ) ) { AddLinkTarget( pURL->GetURL() ); @@ -3371,7 +3371,8 @@ MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM mpTableInfo(new ww8::WW8TableInfo()), nUniqueList(0), mnHdFtIndex(0), pAktPageDesc(0), pPapPlc(0), pChpPlc(0), pChpIter(0), pStyles( NULL ), - bHasHdr(false), bHasFtr(false), + bHasHdr(false), bHasFtr(false), bSubstituteBullets(true), + mbExportModeRTF( false ), pDoc( pDocument ), pCurPam( pCurrentPam ), pOrigPam( pOriginalPam ) diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 43211a962e..d170acbd7f 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -35,6 +35,7 @@ #define _SVSTDARR_ULONGS #include <svl/svstdarr.hxx> #endif +#include <editeng/editdata.hxx> #include <map> #include <vector> @@ -55,6 +56,7 @@ class SwAttrIter; class AttributeOutputBase; class DocxAttributeOutput; +class RtfAttributeOutput; class BitmapPalette; class SwEscherEx; class DateTime; @@ -296,6 +298,7 @@ public: #ifdef DOCX void WriteDocx( const DocxAttributeOutput* rAttrOutput ) const; #endif + void WriteRtf( const RtfAttributeOutput* rAttrOutput ) const; rtl::OUString GetFamilyName() const { return rtl::OUString( msFamilyNm ); } friend bool operator < (const wwFont &r1, const wwFont &r2); }; @@ -311,7 +314,7 @@ private: ::std::vector< const wwFont* > AsVector() const; public: - wwFontHelper() : mbWrtWW8(false) {} + wwFontHelper() : mbWrtWW8(false), bLoadAllFonts(false) {} /// rDoc used only to get the initial standard font(s) in use. void InitFontTable(bool bWrtWW8, const SwDoc& rDoc); USHORT GetId(const Font& rFont); @@ -321,6 +324,10 @@ public: #ifdef DOCX void WriteFontTable( const DocxAttributeOutput& rAttrOutput ); #endif + void WriteFontTable( const RtfAttributeOutput& rAttrOutput ); + + /// If true, all fonts are loaded before processing the document. + BYTE bLoadAllFonts: 1; }; class DrawObj @@ -539,6 +546,9 @@ public: BYTE bEndAtTxtEnd : 1; // true: all END at Textend BYTE bHasHdr : 1; BYTE bHasFtr : 1; + BYTE bSubstituteBullets : 1; // true: SubstituteBullet() gets called + + bool mbExportModeRTF; SwDoc *pDoc; SwPaM *pCurPam, *pOrigPam; @@ -546,6 +556,11 @@ public: /// Stack to remember the nesting (see MSWordSaveData for more) ::std::stack< MSWordSaveData > maSaveData; + /// Used to split the runs according to the bookmarks start and ends + typedef std::vector< ::sw::mark::IMark* > IMarkVector; + IMarkVector m_rSortedMarksStart; + IMarkVector m_rSortedMarksEnd; + public: /// The main function to export the document. void ExportDocument( bool bWriteAll ); @@ -584,7 +599,7 @@ public: void AppendWordBookmark( const String& rName ); /// Use OutputItem() on an item set according to the parameters. - void OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool bChpFmt, USHORT nScript ); + void OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool bChpFmt, USHORT nScript, bool bExportParentItemSet ); short GetDefaultFrameDirection( ) const; @@ -785,6 +800,17 @@ protected: /// One of OutputTextNode(), OutputGrfNode(), or OutputOLENode() void OutputContentNode( const SwCntntNode& ); + /// Find the nearest bookmark from the current position. + /// + /// Returns false when there is no bookmark. + bool NearestBookmark( xub_StrLen& rNearest, const xub_StrLen nAktPos, bool bNextPositionOnly ); + + void GetSortedBookmarks( const SwTxtNode& rNd, xub_StrLen nAktPos, + xub_StrLen nLen ); + + bool GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt, xub_StrLen nEnd, + IMarkVector& rArr ); + public: MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam ); virtual ~MSWordExportBase(); @@ -1350,6 +1376,47 @@ public: virtual const SfxPoolItem& GetItem( USHORT nWhich ) const = 0; }; +class MSWord_SdrAttrIter : public MSWordAttrIter +{ +private: + const EditTextObject* pEditObj; + const SfxItemPool* pEditPool; + EECharAttribArray aTxtAtrArr; + SvPtrarr aChrTxtAtrArr; + SvUShorts aChrSetArr; + USHORT nPara; + xub_StrLen nAktSwPos; + xub_StrLen nTmpSwPos; // for HasItem() + rtl_TextEncoding eNdChrSet; + USHORT nScript; + BYTE mnTyp; + + xub_StrLen SearchNext( xub_StrLen nStartPos ); + void SetCharSet(const EECharAttrib& rTxtAttr, bool bStart); + + //No copying + MSWord_SdrAttrIter(const MSWord_SdrAttrIter&); + MSWord_SdrAttrIter& operator=(const MSWord_SdrAttrIter&); +public: + MSWord_SdrAttrIter( MSWordExportBase& rWr, const EditTextObject& rEditObj, + BYTE nType ); + void NextPara( USHORT nPar ); + void OutParaAttr(bool bCharAttr); + void OutEEField(const SfxPoolItem& rHt); + + bool IsTxtAttr(xub_StrLen nSwPos); + + void NextPos() { nAktSwPos = SearchNext( nAktSwPos + 1 ); } + + void OutAttr( xub_StrLen nSwPos ); + virtual const SfxPoolItem* HasTextItem( USHORT nWhich ) const; + virtual const SfxPoolItem& GetItem( USHORT nWhich ) const; + bool OutAttrWithRange(xub_StrLen nPos); + xub_StrLen WhereNext() const { return nAktSwPos; } + rtl_TextEncoding GetNextCharSet() const; + rtl_TextEncoding GetNodeCharSet() const { return eNdChrSet; } +}; + /// Class to collect and output the styles table. class MSWordStyles { diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 1e5d01101f..67e9dd64b1 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -271,20 +271,21 @@ void MSWordExportBase::ExportPoolItemsToCHP( sw::PoolItems &rItems, USHORT nScri * - gebe die Attribute aus; ohne Parents! */ -void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool bChpFmt, USHORT nScript ) +void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool bChpFmt, USHORT nScript, + bool bExportParentItemSet ) { - if ( rSet.Count() ) + if( bExportParentItemSet || rSet.Count() ) { const SfxPoolItem* pItem; pISet = &rSet; // fuer Doppel-Attribute // If frame dir is set, but not adjust, then force adjust as well - if ( bPapFmt && SFX_ITEM_SET == rSet.GetItemState( RES_FRAMEDIR, false ) ) + if ( bPapFmt && SFX_ITEM_SET == rSet.GetItemState( RES_FRAMEDIR, bExportParentItemSet ) ) { // No explicit adjust set ? - if ( SFX_ITEM_SET != rSet.GetItemState( RES_PARATR_ADJUST, false ) ) + if ( SFX_ITEM_SET != rSet.GetItemState( RES_PARATR_ADJUST, bExportParentItemSet ) ) { - if ( 0 != ( pItem = rSet.GetItem( RES_PARATR_ADJUST ) ) ) + if ( 0 != ( pItem = rSet.GetItem( RES_PARATR_ADJUST, bExportParentItemSet ) ) ) { // then set the adjust used by the parent format AttrOutput().OutputItem( *pItem ); @@ -292,7 +293,7 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool } } - if ( bPapFmt && SFX_ITEM_SET == rSet.GetItemState( RES_PARATR_NUMRULE, false, &pItem ) ) + if ( bPapFmt && SFX_ITEM_SET == rSet.GetItemState( RES_PARATR_NUMRULE, bExportParentItemSet, &pItem ) ) { AttrOutput().OutputItem( *pItem ); @@ -307,7 +308,7 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool } sw::PoolItems aItems; - GetPoolItems( rSet, aItems ); + GetPoolItems( rSet, aItems, bExportParentItemSet ); if ( bChpFmt ) ExportPoolItemsToCHP(aItems, nScript); @@ -783,7 +784,7 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF aSet.Put( aLR ); CorrectTabStopInSet( aSet, rNFmt.GetAbsLSpace() ); OutputItemSet( aSet, bPapFmt, bChpFmt, - i18n::ScriptType::LATIN); + i18n::ScriptType::LATIN, mbExportModeRTF); bCallOutSet = false; } } @@ -801,7 +802,7 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF ItemGet<SvxLRSpaceItem>(aSet, RES_LR_SPACE)); aSet.Put( aLR ); OutputItemSet( aSet, bPapFmt, bChpFmt, - com::sun::star::i18n::ScriptType::LATIN); + com::sun::star::i18n::ScriptType::LATIN, mbExportModeRTF); bCallOutSet = false; } // <-- @@ -841,7 +842,7 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF bOutFlyFrmAttrs = true; //script doesn't matter if not exporting chp OutputItemSet(aSet, true, false, - i18n::ScriptType::LATIN); + i18n::ScriptType::LATIN, mbExportModeRTF); bOutFlyFrmAttrs = false; bCallOutSet = false; @@ -855,7 +856,7 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF if( bCallOutSet ) OutputItemSet( rFmt.GetAttrSet(), bPapFmt, bChpFmt, - i18n::ScriptType::LATIN); + i18n::ScriptType::LATIN, mbExportModeRTF); pOutFmtNode = pOldMod; } @@ -1743,9 +1744,9 @@ static void InsertSpecialChar( WW8Export& rWrt, BYTE c, aItems.GetData()); } -String lcl_GetExpandedField(const SwField &rFld, SwDoc const& rDoc) +String lcl_GetExpandedField(const SwField &rFld) { - String sRet(rFld.ExpandField(rDoc.IsClipBoard())); + String sRet(rFld.ExpandField(true)); //replace LF 0x0A with VT 0x0B sRet.SearchAndReplaceAll(0x0A, 0x0B); @@ -1871,7 +1872,7 @@ void WW8Export::OutputField( const SwField* pFld, ww::eField eFldType, { String sOut; if( pFld ) - sOut = lcl_GetExpandedField(*pFld, *pDoc); + sOut = lcl_GetExpandedField(*pFld); else sOut = rFldCmd; if( sOut.Len() ) @@ -2598,7 +2599,7 @@ void WW8AttributeOutput::RefField( const SwField &rFld, const String &rRef) sStr.APPEND_CONST_ASC( "\" " ); m_rWW8Export.OutputField( &rFld, ww::eREF, sStr, WRITEFIELD_START | WRITEFIELD_CMD_START | WRITEFIELD_CMD_END ); - String sVar = lcl_GetExpandedField( rFld, *GetExport().pDoc ); + String sVar = lcl_GetExpandedField( rFld ); if ( sVar.Len() ) { if ( m_rWW8Export.IsUnicode() ) @@ -2614,7 +2615,7 @@ void WW8AttributeOutput::RefField( const SwField &rFld, const String &rRef) void WW8AttributeOutput::WriteExpand( const SwField* pFld ) { - String sExpand( lcl_GetExpandedField( *pFld, *GetExport().pDoc ) ); + String sExpand( lcl_GetExpandedField( *pFld ) ); if ( m_rWW8Export.IsUnicode() ) SwWW8Writer::WriteString16( m_rWW8Export.Strm(), sExpand, false ); else @@ -2773,12 +2774,12 @@ void AttributeOutputBase::TextField( const SwFmtFld& rField ) static String sQuotes('\"'); const SwDocInfoField * pDocInfoField = dynamic_cast<const SwDocInfoField *> (pFld); - + if (pDocInfoField != NULL) { - String sFieldname = pDocInfoField->GetCntnt(TRUE); + String sFieldname = pDocInfoField->GetFieldName(); xub_StrLen nIndex = sFieldname.Search(':'); - + if (nIndex != sFieldname.Len()) sFieldname = sFieldname.Copy(nIndex + 1); @@ -3340,7 +3341,7 @@ void WW8AttributeOutput::CharTwoLines( const SvxTwoLinesItem& rTwoLines ) m_rWW8Export.pO->Insert( (BYTE)0x02, m_rWW8Export.pO->Count() ); sal_Unicode cStart = rTwoLines.GetStartBracket(); - sal_Unicode cEnd = rTwoLines.GetStartBracket(); + sal_Unicode cEnd = rTwoLines.GetEndBracket(); /* As per usual we have problems. We can have seperate left and right brackets diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 1250b589b0..c4412887f0 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -244,10 +244,10 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) for( sal_uInt16 j=0; j < nWhichIds; j++ ) { sal_uInt16 nWhichId = aWhichIds[j]; - sal_uInt16 i=0, nItems = rPool.GetItemCount( nWhichId ); + sal_uInt32 i=0, nItems = rPool.GetItemCount2( nWhichId ); for( i = 0; i < nItems; ++i ) { - if( 0 != (pItem = rPool.GetItem( nWhichId , i ) ) ) + if( 0 != (pItem = rPool.GetItem2( nWhichId , i ) ) ) { const SvXMLAttrContainerItem *pUnknown = PTR_CAST( SvXMLAttrContainerItem, pItem ); diff --git a/sw/source/filter/xml/xmlfonte.cxx b/sw/source/filter/xml/xmlfonte.cxx index c7bfacf509..308d839b7d 100644 --- a/sw/source/filter/xml/xmlfonte.cxx +++ b/sw/source/filter/xml/xmlfonte.cxx @@ -80,10 +80,10 @@ SwXMLFontAutoStylePool_Impl::SwXMLFontAutoStylePool_Impl( Add( rFont.GetFamilyName(), rFont.GetStyleName(), static_cast< sal_uInt16 >(rFont.GetFamily()), static_cast< sal_uInt16 >(rFont.GetPitch()), rFont.GetCharSet() ); - sal_uInt16 nItems = rPool.GetItemCount( nWhichId ); - for( sal_uInt16 j = 0; j < nItems; ++j ) + sal_uInt32 nItems = rPool.GetItemCount2( nWhichId ); + for( sal_uInt32 j = 0; j < nItems; ++j ) { - if( 0 != (pItem = rPool.GetItem( nWhichId, j ) ) ) + if( 0 != (pItem = rPool.GetItem2( nWhichId, j ) ) ) { const SvxFontItem *pFont = (const SvxFontItem *)pItem; diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index c3beb63cc0..ab5e1acb99 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -1539,14 +1539,14 @@ void SwXMLTableContext::InsertColumn( sal_Int32 nWidth2, sal_Bool bRelWidth2, else if( nWidth2 > USHRT_MAX ) nWidth2 = USHRT_MAX; aColumnWidths.Insert( (sal_uInt16)nWidth2, aColumnWidths.Count() ); - aColumnRelWidths.Insert( bRelWidth2, aColumnRelWidths.Count() ); + aColumnRelWidths.push_back( bRelWidth2 ); if( (pDfltCellStyleName && pDfltCellStyleName->getLength() > 0) || pColumnDefaultCellStyleNames ) { if( !pColumnDefaultCellStyleNames ) { pColumnDefaultCellStyleNames = new SvStringsDtor; - sal_uInt16 nCount = aColumnRelWidths.Count() - 1; + size_t nCount = aColumnRelWidths.size() - 1; while( nCount-- ) pColumnDefaultCellStyleNames->Insert( new String, pColumnDefaultCellStyleNames->Count() ); @@ -1649,7 +1649,7 @@ void SwXMLTableContext::InsertCell( const OUString& rStyleName, for( i=GetColumnCount(); i<nColsReq; i++ ) { aColumnWidths.Insert( MINLAY, aColumnWidths.Count() ); - aColumnRelWidths.Insert( sal_True, aColumnRelWidths.Count() ); + aColumnRelWidths.push_back( sal_True ); } // adjust columns in *all* rows, if columns must be inserted for( i=0; i<pRows->Count(); i++ ) diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx index a248ac8aff..ae6e4720b2 100644 --- a/sw/source/ui/app/appopt.cxx +++ b/sw/source/ui/app/appopt.cxx @@ -27,19 +27,15 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#include <hintids.hxx> -#ifndef _CMDID_H -#include <cmdid.h> // Funktion-Ids -#endif - -#include <com/sun/star/i18n/ScriptType.hpp> #define _SVSTDARR_STRINGSDTOR #include <svl/svstdarr.hxx> -#ifndef _MSGBOX_HXX //autogen +#include <com/sun/star/i18n/ScriptType.hpp> + +#include <hintids.hxx> +#include <cmdid.h> // Funktion-Ids #include <vcl/msgbox.hxx> -#endif #include <svl/eitem.hxx> #include <sfx2/request.hxx> #include <sfx2/app.hxx> @@ -47,9 +43,7 @@ #include <svx/htmlmode.hxx> #include <sfx2/bindings.hxx> #include <editeng/brshitem.hxx> -#ifndef _SVX_TSTPITEM_HXX //autogen #include <editeng/tstpitem.hxx> -#endif #include <svx/optgrid.hxx> #include <svx/svxdlg.hxx> #include <svx/dialogs.hrc> @@ -59,37 +53,25 @@ #include <optcomp.hxx> #include <edtwin.hxx> #include <swmodule.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif +#include <doc.hxx> #include <wrtsh.hxx> -#ifndef IDOCUMENTDEVICEACCESS_HXX_INCLUDED #include <IDocumentDeviceAccess.hxx> -#endif #include <uitool.hxx> #include <initui.hxx> // fuer ::GetGlossaries() #include <fldbas.hxx> //fuer UpdateFields -#ifndef _WVIEW_HXX #include <wview.hxx> -#endif #include <cfgitems.hxx> #include <prtopt.hxx> -#ifndef _PVIEW_HXX #include <pview.hxx> -#endif #include <usrpref.hxx> -#ifndef _MODCFG_HXX #include <modcfg.hxx> -#endif #include <glosdoc.hxx> #include <uiitems.hxx> #include <editeng/langitem.hxx> #include <unotools/lingucfg.hxx> #include <editeng/unolingu.hxx> - -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif #include <globals.h> // globale Konstanten z.B. #include <svl/slstitm.hxx> #include "swabstdlg.hxx" @@ -334,8 +316,7 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) /*--------------------------------------------------------------------- Seite Dokumentansicht auswerten -----------------------------------------------------------------------*/ - if( SFX_ITEM_SET == rSet.GetItemState( - FN_PARAM_DOCDISP, FALSE, &pItem )) + if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_DOCDISP, FALSE, &pItem )) { const SwDocDisplayItem* pDocDispItem = (const SwDocDisplayItem*)pItem; @@ -364,23 +345,20 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) Elemente - Item auswerten -----------------------------------------------------------------------*/ - if( SFX_ITEM_SET == rSet.GetItemState( - FN_PARAM_ELEM, FALSE, &pItem ) ) + if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_ELEM, FALSE, &pItem ) ) { const SwElemItem* pElemItem = (const SwElemItem*)pItem; pElemItem->FillViewOptions( aViewOpt ); } - if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_METRIC, - FALSE, &pItem ) ) + if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_METRIC, FALSE, &pItem ) ) { SFX_APP()->SetOptions(rSet); const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem; ::SetDfltMetric((FieldUnit)pMetricItem->GetValue(), !bTextDialog); } - if( SFX_ITEM_SET == rSet.GetItemState(FN_HSCROLL_METRIC, - FALSE, &pItem ) ) + if( SFX_ITEM_SET == rSet.GetItemState(FN_HSCROLL_METRIC, FALSE, &pItem ) ) { const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem; FieldUnit eUnit = (FieldUnit)pMetricItem->GetValue(); @@ -389,8 +367,7 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) pAppView->ChangeTabMetric(eUnit); } - if( SFX_ITEM_SET == rSet.GetItemState(FN_VSCROLL_METRIC, - FALSE, &pItem ) ) + if( SFX_ITEM_SET == rSet.GetItemState(FN_VSCROLL_METRIC, FALSE, &pItem ) ) { const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem; FieldUnit eUnit = (FieldUnit)pMetricItem->GetValue(); @@ -399,8 +376,7 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) pAppView->ChangeVLinealMetric(eUnit); } - if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_DEFTABSTOP, - FALSE, &pItem ) ) + if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_DEFTABSTOP, FALSE, &pItem ) ) { USHORT nTabDist = ((const SfxUInt16Item*)pItem)->GetValue(); pPref->SetDefTab(nTabDist); @@ -427,8 +403,7 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) Seite Rastereinstellungen auswerten ----------------------------------------------------------------------*/ - if( SFX_ITEM_SET == rSet.GetItemState( - SID_ATTR_GRID_OPTIONS, FALSE, &pItem )) + if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS, FALSE, &pItem )) { const SvxGridItem* pGridItem = (const SvxGridItem*)pItem; @@ -458,8 +433,7 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) // Writer Drucker Zusatzeinstellungen auswerten //---------------------------------------------------------------------------- - if( SFX_ITEM_SET == rSet.GetItemState( - FN_PARAM_ADDPRINTER, FALSE, &pItem )) + if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_ADDPRINTER, FALSE, &pItem )) { SwPrintOptions* pOpt = GetPrtOptions(!bTextDialog); if (pOpt) @@ -473,16 +447,25 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) } - if( SFX_ITEM_SET == rSet.GetItemState( - FN_PARAM_SHADOWCURSOR, FALSE, &pItem )) + if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, FALSE, &pItem )) { ((SwShadowCursorItem*)pItem)->FillViewOptions( aViewOpt ); if(pBindings) pBindings->Invalidate(FN_SHADOWCURSOR); } - if( SFX_ITEM_SET == rSet.GetItemState( - FN_PARAM_CRSR_IN_PROTECTED, FALSE, &pItem )) + if( pAppView ) + { + SwWrtShell &rWrtSh = pAppView->GetWrtShell(); + const bool bAlignFormulas = rWrtSh.GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ); + pPref->SetAlignMathObjectsToBaseline( bAlignFormulas ); + + // don't align formulas in documents that are currently loading + if (bAlignFormulas && !rWrtSh.GetDoc()->IsInReading()) + rWrtSh.AlignAllFormulasToBaseline(); + } + + if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_CRSR_IN_PROTECTED, FALSE, &pItem )) { aViewOpt.SetCursorInProtectedArea(((const SfxBoolItem*)pItem)->GetValue()); } @@ -510,8 +493,7 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) } #endif // dann an der akt. View und Shell die entsp. Elemente setzen - ApplyUsrPref( aViewOpt, pAppView, - bTextDialog? VIEWOPT_DEST_TEXT : VIEWOPT_DEST_WEB); + ApplyUsrPref( aViewOpt, pAppView, bTextDialog? VIEWOPT_DEST_TEXT : VIEWOPT_DEST_WEB); } /* -----------------12.02.99 12:28------------------- * @@ -609,6 +591,15 @@ SfxTabPage* SwModule::CreateTabPage( USHORT nId, Window* pParent, const SfxItemS if ( fnCreatePage ) pRet = (*fnCreatePage)( pParent, rSet ); } + if (pRet && (nId == RID_SW_TP_OPTSHDWCRSR || nId == RID_SW_TP_HTML_OPTSHDWCRSR)) + { + SwView* pCurrView = GetView(); + if(pCurrView) + { + aSet.Put( SwWrtShellItem( SID_WRT_SHELL, pCurrView->GetWrtShellPtr() ) ); + pRet->PageCreated(aSet); + } + } } break; #ifdef DBG_UTIL @@ -653,5 +644,3 @@ SfxTabPage* SwModule::CreateTabPage( USHORT nId, Window* pParent, const SfxItemS return pRet; } - - diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index a5a8bad22c..a397788b23 100755..100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -65,7 +65,7 @@ #include <fmtfld.hxx> #include <node.hxx> #include <swwait.hxx> -#include <swprtopt.hxx> +#include <printdata.hxx> #include <frmatr.hxx> #include <view.hxx> // fuer die aktuelle Sicht #include <edtwin.hxx> @@ -895,7 +895,7 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup, pDev->SetLineColor(); pDev->SetBackground(); BOOL bWeb = 0 != PTR_CAST(SwWebDocShell, this); - SwPrtOptions aOpts( aEmptyStr ); + SwPrintData aOpts; ViewShell::PrtOle2( pDoc, SW_MOD()->GetUsrPref(bWeb), aOpts, pDev, aRect ); pDev->Pop(); @@ -1147,6 +1147,23 @@ void SwDocShell::GetState(SfxItemSet& rSet) rSet.Put( SvxFontListItem( pFontList, SID_ATTR_CHAR_FONTLIST ) ); } break; + case SID_MAIL_PREPAREEXPORT: + { + //check if linked content or possibly hidden content is available + //pDoc->UpdateFlds( NULL, false ); + sfx2::LinkManager& rLnkMgr = pDoc->GetLinkManager(); + const ::sfx2::SvBaseLinks& rLnks = rLnkMgr.GetLinks(); + sal_Bool bRet = sal_False; + if( rLnks.Count() ) + bRet = sal_True; + else + { + //sections with hidden flag, hidden character attribute, hidden paragraph/text or conditional text fields + bRet = pDoc->HasInvisibleContent(); + } + rSet.Put( SfxBoolItem( nWhich, bRet ) ); + } + break; default: DBG_ASSERT(!this,"Hier darfst Du nicht hinein!"); diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index b0ae69370f..3f1884987f 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -324,7 +324,7 @@ USHORT SwDocShell::PrepareClose( BOOL bUI, BOOL bForBrowsing ) } #endif return nRet; -} +} /*-------------------------------------------------------------------- Beschreibung: Organizer @@ -1209,7 +1209,19 @@ void SwDocShell::Execute(SfxRequest& rReq) } break; - case SID_MAIL_EXPORT_FINISHED: + case SID_MAIL_PREPAREEXPORT: + { + //pWrtShell is not set in page preview + if(pWrtShell) + pWrtShell->StartAllAction(); + pDoc->UpdateFlds( NULL, false ); + pDoc->EmbedAllLinks(); + pDoc->RemoveInvisibleContent(); + if(pWrtShell) + pWrtShell->EndAllAction(); + } + break; + case SID_MAIL_EXPORT_FINISHED: { if(pWrtShell) pWrtShell->StartAllAction(); @@ -1240,7 +1252,7 @@ void SwDocShell::Execute(SfxRequest& rReq) if ( !aFileName.Len() ) { FileDialogHelper aDlgHelper( TemplateDescription::FILESAVE_AUTOEXTENSION_TEMPLATE, 0 ); - //set HelpIds + const sal_Int16 nControlIds[] = { CommonFilePickerElementIds::PUSHBUTTON_OK, CommonFilePickerElementIds::PUSHBUTTON_CANCEL, @@ -1251,17 +1263,33 @@ void SwDocShell::Execute(SfxRequest& rReq) ExtendedFilePickerElementIds::LISTBOX_TEMPLATE, 0 }; - sal_Int32 nHelpIds[8]; - sal_Int32 nStartHelpId = - bCreateHtml ? - HID_SEND_HTML_CTRL_PUSHBUTTON_OK : HID_SEND_MASTER_CTRL_PUSHBUTTON_OK ; - for(int nHelp = 0; nHelp < 7; nHelp++) - nHelpIds[nHelp] = nStartHelpId++; - nHelpIds[7] = 0; - aDlgHelper.SetControlHelpIds( nControlIds, nHelpIds ); -// aDlgHelper.SetDialogHelpId( bCreateHtml ? HID_SEND_HTML_DIALOG : HID_SEND_MASTER_DIALOG ); + const char* aHTMLHelpIds[] = + { + HID_SEND_HTML_CTRL_PUSHBUTTON_OK, + HID_SEND_HTML_CTRL_PUSHBUTTON_CANCEL, + HID_SEND_HTML_CTRL_LISTBOX_FILTER, + HID_SEND_HTML_CTRL_CONTROL_FILEVIEW, + HID_SEND_HTML_CTRL_EDIT_FILEURL, + HID_SEND_HTML_CTRL_CHECKBOX_AUTOEXTENSION, + HID_SEND_HTML_CTRL_LISTBOX_TEMPLATE, + "" + }; + + const char* aMasterHelpIds[] = + { + HID_SEND_MASTER_CTRL_PUSHBUTTON_OK, + HID_SEND_MASTER_CTRL_PUSHBUTTON_CANCEL, + HID_SEND_MASTER_CTRL_LISTBOX_FILTER, + HID_SEND_MASTER_CTRL_CONTROL_FILEVIEW, + HID_SEND_MASTER_CTRL_EDIT_FILEURL, + HID_SEND_MASTER_CTRL_CHECKBOX_AUTOEXTENSION, + HID_SEND_MASTER_CTRL_LISTBOX_TEMPLATE, + "" + }; + const char** pHelpIds = bCreateHtml ? aHTMLHelpIds : aMasterHelpIds; + aDlgHelper.SetControlHelpIds( nControlIds, pHelpIds ); uno::Reference < XFilePicker > xFP = aDlgHelper.GetFilePicker(); const SfxFilter* pFlt; diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx index 4b0e3575a6..f9ee757b23 100644 --- a/sw/source/ui/app/docshini.cxx +++ b/sw/source/ui/app/docshini.cxx @@ -336,6 +336,12 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) pColl->SetFmtAttr( aFontHeight ); } } + + // the default for documents created via 'File/New' should be 'on' + // (old documents, where this property was not yet implemented, will get the + // value 'false' in the SwDoc c-tor) + pDoc->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT, + SW_MOD()->GetUsrPref( bWeb )->IsAlignMathObjectsToBaseline() ); } /* #106748# If the default frame direction of a document is RTL @@ -823,4 +829,3 @@ void SwDocShell::SubInitNew() IDocumentDeviceAccess* SwDocShell::getIDocumentDeviceAccess() { return pDoc; } const IDocumentSettingAccess* SwDocShell::getIDocumentSettingAccess() const { return pDoc; } IDocumentChartDataProviderAccess* SwDocShell::getIDocumentChartDataProviderAccess() { return pDoc; } - diff --git a/sw/source/ui/app/mn.src b/sw/source/ui/app/mn.src index aeb8fca52d..423ec4777c 100644 --- a/sw/source/ui/app/mn.src +++ b/sw/source/ui/app/mn.src @@ -28,6 +28,7 @@ #include "swmn.hrc" +#include "helpid.h" /*------------------------------------------------------------------------ Beschreibung: Menu Window @@ -37,7 +38,7 @@ MenuItem\ {\ Identifier = FN_INSERT_CAPTION ;\ - HelpID = FN_INSERT_CAPTION ;\ + HelpId = CMD_FN_INSERT_CAPTION ;\ Text [ en-US ] = "~Caption..." ;\ }; @@ -45,31 +46,30 @@ MenuItem\ {\ Identifier = FN_FORMAT_TABLE_DLG ; \ - HelpID = FN_FORMAT_TABLE_DLG ; \ + HelpId = CMD_FN_FORMAT_TABLE_DLG ; \ Text [ en-US ] = "~Table..." ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_MERGE_TABLE ; \ - HelpID = FN_TABLE_MERGE_TABLE ; \ + HelpId = CMD_FN_TABLE_MERGE_TABLE ; \ Text [ en-US ] = "Merge Tables";\ };\ MenuItem\ {\ Identifier = FN_TABLE_SPLIT_TABLE ; \ - HelpID = FN_TABLE_SPLIT_TABLE ; \ + HelpId = CMD_FN_TABLE_SPLIT_TABLE ; \ Text [ en-US ] = "~Split Table" ; \ };\ MenuItem\ {\ Identifier = FN_NUM_FORMAT_TABLE_DLG ; \ - HelpID = FN_NUM_FORMAT_TABLE_DLG ; \ + HelpId = CMD_FN_NUM_FORMAT_TABLE_DLG ; \ Text [ en-US ] = "N~umber Format..." ; \ };\ MenuItem\ {\ Identifier = MN_CELL ; \ - HelpID = MN_CELL ; \ Command = ".uno:CellMenu" ; \ /* ### ACHTUNG: Neuer Text in Resource? Ze~lle : Zelle */\ Text [ en-US ] = "~Cell" ; \ @@ -81,46 +81,46 @@ MenuItem\ {\ Identifier = FN_TABLE_MERGE_CELLS ; \ - HelpID = FN_TABLE_MERGE_CELLS ; \ + HelpId = CMD_FN_TABLE_MERGE_CELLS ; \ Text [ en-US ] = "~Merge" ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_SPLIT_CELLS ; \ - HelpID = FN_TABLE_SPLIT_CELLS ; \ + HelpId = CMD_FN_TABLE_SPLIT_CELLS ; \ Text [ en-US ] = "~Split..." ; \ };\ SEPARATOR ; \ MenuItem\ {\ Identifier = FN_TABLE_VERT_NONE ; \ - HelpID = FN_TABLE_VERT_NONE ; \ + HelpId = CMD_FN_TABLE_VERT_NONE ; \ Text [ en-US ] = "~Top" ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_VERT_CENTER ; \ - HelpID = FN_TABLE_VERT_CENTER ; \ + HelpId = CMD_FN_TABLE_VERT_CENTER ; \ Text [ en-US ] = "C~enter" ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_VERT_BOTTOM ; \ - HelpID = FN_TABLE_VERT_BOTTOM ; \ + HelpId = CMD_FN_TABLE_VERT_BOTTOM ; \ Text [ en-US ] = "~Bottom" ; \ };\ SEPARATOR ; \ MenuItem\ {\ Identifier = FN_TABLE_SET_READ_ONLY_CELLS ; \ - HelpID = FN_TABLE_SET_READ_ONLY_CELLS ; \ + HelpId = CMD_FN_TABLE_SET_READ_ONLY_CELLS ; \ /* ### ACHTUNG: Neuer Text in Resource? ~Schützen : ~Sch³tzen */\ Text [ en-US ] = "~Protect" ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_UNSET_READ_ONLY_CELLS ; \ - HelpID = FN_TABLE_UNSET_READ_ONLY_CELLS ; \ + HelpId = CMD_FN_TABLE_UNSET_READ_ONLY_CELLS ; \ Text [ en-US ] = "~Unprotect" ; \ };\ };\ @@ -143,27 +143,27 @@ MenuItem\ {\ Identifier = FN_TABLE_SET_ROW_HEIGHT ; \ - HelpID = FN_TABLE_SET_ROW_HEIGHT ; \ + HelpId = CMD_FN_TABLE_SET_ROW_HEIGHT ; \ /* ### ACHTUNG: Neuer Text in Resource? ~Höhe... : ~H÷he... */\ Text [ en-US ] = "~Height..." ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_ROW_SPLIT;\ - HelpID = FN_TABLE_ROW_SPLIT ; \ + HelpId = CMD_FN_TABLE_ROW_SPLIT ; \ Text [ en-US ] = "Allow Row to Break A~cross Pages and Columns" ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_OPTIMAL_HEIGHT ; \ - HelpID = FN_TABLE_OPTIMAL_HEIGHT ; \ + HelpId = CMD_FN_TABLE_OPTIMAL_HEIGHT ; \ /* ### ACHTUNG: Neuer Text in Resource? ~Optimale Höhe : ~Optimale H÷he */\ Text [ en-US ] = "~Optimal Height" ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_BALANCE_ROWS ; \ - HelpID = FN_TABLE_BALANCE_ROWS ; \ + HelpId = CMD_FN_TABLE_BALANCE_ROWS ; \ /* ### ACHTUNG: Neuer Text in Resource? Gleichmäßig ~verteilen : Gleichmõ˜ig ~verteilen */\ Text [ en-US ] = "Space ~Equally" ; \ };\ @@ -171,7 +171,7 @@ MenuItem\ {\ Identifier = FN_TABLE_SELECT_ROW ; \ - HelpID = FN_TABLE_SELECT_ROW ; \ + HelpId = CMD_FN_TABLE_SELECT_ROW ; \ /* ### ACHTUNG: Neuer Text in Resource? Ausw~ählen : Auswählen */\ /* ### ACHTUNG: Neuer Text in Resource? Ausw~ählen : Ausw~õhlen */\ Text [ en-US ] = "~Select" ; \ @@ -179,14 +179,14 @@ MenuItem\ {\ Identifier = FN_TABLE_INSERT_ROW_DLG ; \ - HelpID = FN_TABLE_INSERT_ROW_DLG ; \ + HelpId = CMD_FN_TABLE_INSERT_ROW_DLG ; \ /* ### ACHTUNG: Neuer Text in Resource? ~Einfügen... : ~Einf³gen... */\ Text [ en-US ] = "~Insert..." ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_DELETE_ROW ; \ - HelpID = FN_TABLE_DELETE_ROW ; \ + HelpId = CMD_FN_TABLE_DELETE_ROW ; \ /* ### ACHTUNG: Neuer Text in Resource? ~Löschen : ~L÷schen */\ Text [ en-US ] = "~Delete" ; \ };\ @@ -207,19 +207,19 @@ MenuItem\ {\ Identifier = FN_TABLE_SET_COL_WIDTH ; \ - HelpID = FN_TABLE_SET_COL_WIDTH ; \ + HelpId = CMD_FN_TABLE_SET_COL_WIDTH ; \ Text [ en-US ] = "~Width..." ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_ADJUST_CELLS ; \ - HelpID = FN_TABLE_ADJUST_CELLS ; \ + HelpId = CMD_FN_TABLE_ADJUST_CELLS ; \ Text [ en-US ] = "~Optimal Width " ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_BALANCE_CELLS ; \ - HelpID = FN_TABLE_BALANCE_CELLS ; \ + HelpId = CMD_FN_TABLE_BALANCE_CELLS ; \ /* ### ACHTUNG: Neuer Text in Resource? Gleichmäßig ~verteilen : Gleichmõ˜ig ~verteilen */\ Text [ en-US ] = "Space ~Equally" ; \ };\ @@ -227,7 +227,7 @@ MenuItem\ {\ Identifier = FN_TABLE_SELECT_COL ; \ - HelpID = FN_TABLE_SELECT_COL ; \ + HelpId = CMD_FN_TABLE_SELECT_COL ; \ /* ### ACHTUNG: Neuer Text in Resource? Ausw~ählen : Auswählen */\ /* ### ACHTUNG: Neuer Text in Resource? Ausw~ählen : Ausw~õhlen */\ Text [ en-US ] = "~Select" ; \ @@ -235,14 +235,14 @@ MenuItem\ {\ Identifier = FN_TABLE_INSERT_COL_DLG ; \ - HelpID = FN_TABLE_INSERT_COL_DLG ; \ + HelpId = CMD_FN_TABLE_INSERT_COL_DLG ; \ /* ### ACHTUNG: Neuer Text in Resource? ~Einfügen... : ~Einf³gen... */\ Text [ en-US ] = "~Insert..." ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_DELETE_COL ; \ - HelpID = FN_TABLE_DELETE_COL ; \ + HelpId = CMD_FN_TABLE_DELETE_COL ; \ /* ### ACHTUNG: Neuer Text in Resource? ~Löschen : ~L÷schen */\ Text [ en-US ] = "~Delete" ; \ };\ @@ -264,7 +264,7 @@ MenuItem\ {\ Identifier = FN_DRAWTEXT_ATTR_DLG ; \ - HelpID = FN_DRAWTEXT_ATTR_DLG ; \ + HelpId = CMD_FN_DRAWTEXT_ATTR_DLG ; \ Text [ en-US ] = "Te~xt..." ; \ }; @@ -272,7 +272,7 @@ MenuItem\ {\ Identifier = FN_NAME_SHAPE ; \ - HelpID = FN_NAME_SHAPE ; \ + HelpId = CMD_FN_NAME_SHAPE ; \ Text [ en-US ] = "Name..." ; \ }; @@ -281,7 +281,7 @@ MenuItem\ {\ Identifier = FN_TITLE_DESCRIPTION_SHAPE; \ - HelpID = FN_TITLE_DESCRIPTION_SHAPE; \ + HelpId = CMD_FN_TITLE_DESCRIPTION_SHAPE; \ Text [ en-US ] = "Description..." ; \ }; @@ -289,7 +289,7 @@ MenuItem\ {\ Identifier = FN_FORMAT_FRAME_DLG ; \ - HelpID = FN_FORMAT_FRAME_DLG ; \ + HelpId = CMD_FN_FORMAT_FRAME_DLG ; \ Text [ en-US ] = "~Frame..." ; \ }; @@ -344,13 +344,13 @@ MenuItem\ {\ Identifier = FN_FRAME_UP ; \ - HelpID = FN_FRAME_UP ; \ + HelpId = CMD_FN_FRAME_UP ; \ Text [ en-US ] = "Bring ~Forward" ; \ };\ MenuItem\ {\ Identifier = FN_FRAME_DOWN ; \ - HelpID = FN_FRAME_DOWN ; \ + HelpId = CMD_FN_FRAME_DOWN ; \ Text [ en-US ] = "Send Back~ward" ; \ }; @@ -430,45 +430,45 @@ MenuItem\ {\ Identifier = FN_REPLY ;\ - HelpID = FN_DELETE_NOTE ;\ + HelpID = CMD_FN_REPLY ;\ Text [ en-US ] = "Reply" ;\ };\ SEPARATOR ; \ MenuItem\ {\ - Identifier = FN_DELETE_NOTE ;\ - HelpID = FN_DELETE_NOTE ;\ + Identifier = FN_DELETE_COMMENT ;\ + HelpID = CMD_FN_DELETE_COMMENT ;\ Text [ en-US ] = "Delete ~Comment" ;\ };\ MenuItem\ {\ Identifier = FN_DELETE_NOTE_AUTHOR ;\ - HelpID = FN_DELETE_NOTE_AUTHOR ;\ + HelpId = CMD_FN_DELETE_NOTE_AUTHOR ;\ Text [ en-US ] = "Delete ~All Comments by $1" ;\ };\ MenuItem\ {\ Identifier = FN_DELETE_ALL_NOTES ;\ - HelpID = FN_DELETE_ALL_NOTES ;\ + HelpId = CMD_FN_DELETE_ALL_NOTES ;\ Text [ en-US ] = "~Delete All Comments" ;\ };\ /* MenuItem\ {\ Identifier = FN_HIDE_NOTE ;\ - HelpID = FN_HIDE_NOTE ;\ + HelpId = CMD_FN_HIDE_NOTE ;\ Text [ en-US ] = "~Hide comment" ;\ };\ MenuItem\ {\ Identifier = FN_HIDE_NOTE_AUTHOR ;\ - HelpID = FN_HIDE_NOTE_AUTHOR ;\ + HelpId = CMD_FN_HIDE_NOTE_AUTHOR ;\ Text [ en-US ] = "Hide ~author" ;\ };\ MenuItem\ {\ Identifier = FN_HIDE_ALL_NOTES ;\ - HelpID = FN_HIDE_ALL_NOTES ;\ + HelpId = CMD_FN_HIDE_ALL_NOTES ;\ Text [ en-US ] = "Hide all ~comments" ;\ }; */ @@ -513,13 +513,13 @@ Menu MN_TAB_POPUPMENU MenuItem { Identifier = FN_VIEW_TABLEGRID ; - HelpID = FN_VIEW_TABLEGRID ; + HelpId = CMD_FN_VIEW_TABLEGRID ; Text [ en-US ] = "Table Boundaries" ; }; MenuItem { Identifier = FN_SET_MODOPT_TBLNUMFMT ; - HelpID = FN_SET_MODOPT_TBLNUMFMT ; + HelpId = CMD_FN_SET_MODOPT_TBLNUMFMT ; Text [ en-US ] = "~Number Recognition"; }; SEPARATOR ; @@ -531,7 +531,7 @@ Menu MN_TAB_POPUPMENU MenuItem\ {\ Identifier = FN_FRAME_WRAP_CONTOUR ; \ - HelpID = FN_FRAME_WRAP_CONTOUR ; \ + HelpId = CMD_FN_FRAME_WRAP_CONTOUR ; \ Text [ en-US ] = "~Contour" ; \ }; @@ -539,7 +539,7 @@ Menu MN_TAB_POPUPMENU MenuItem\ {\ Identifier = SID_CONTOUR_DLG ; \ - HelpID = SID_CONTOUR_DLG ; \ + HelpId = CMD_SID_CONTOUR_DLG ; \ Text [ en-US ] = "~Edit Contour..." ; \ }; @@ -550,7 +550,6 @@ Menu MN_TAB_POPUPMENU MenuItem\ {\ Identifier = MN_WRAP ; \ - HelpID = MN_WRAP ; \ Command = ".uno:WrapMenu" ; \ Text [ en-US ] = "~Wrap" ; \ SubMenu = Menu\ @@ -561,35 +560,35 @@ Menu MN_TAB_POPUPMENU {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_NOWRAP ; \ - HelpID = FN_FRAME_NOWRAP ; \ + HelpId = CMD_FN_FRAME_NOWRAP ; \ Text [ en-US ] = "~No Wrap" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_WRAP ; \ - HelpID = FN_FRAME_WRAP ; \ + HelpId = CMD_FN_FRAME_WRAP ; \ Text [ en-US ] = "~Page Wrap" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_WRAP_IDEAL ; \ - HelpID = FN_FRAME_WRAP_IDEAL ; \ + HelpId = CMD_FN_FRAME_WRAP_IDEAL ; \ Text [ en-US ] = "~Optimal Page Wrap" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_WRAPTHRU ; \ - HelpID = FN_FRAME_WRAPTHRU ; \ + HelpId = CMD_FN_FRAME_WRAPTHRU ; \ Text [ en-US ] = "~Wrap Through" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_WRAPTHRU_TRANSP ; \ - HelpID = FN_FRAME_WRAPTHRU_TRANSP ; \ + HelpId = CMD_FN_FRAME_WRAPTHRU_TRANSP ; \ Text [ en-US ] = "In ~Background" ; \ };\ SEPARATOR ; \ @@ -599,7 +598,7 @@ Menu MN_TAB_POPUPMENU {\ Checkable = TRUE ; \ Identifier = FN_WRAP_ANCHOR_ONLY ; \ - HelpID = FN_WRAP_ANCHOR_ONLY ; \ + HelpId = CMD_FN_WRAP_ANCHOR_ONLY ; \ Text [ en-US ] = "~First Paragraph" ; \ };\ };\ @@ -617,7 +616,6 @@ String MN_DRAW_POPUPMENU MenuItem\ {\ Identifier = MN_WRAP ; \ - HelpID = MN_WRAP ; \ Command = ".uno:WrapMenu" ; \ SubMenu = Menu\ {\ @@ -627,35 +625,35 @@ String MN_DRAW_POPUPMENU {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_NOWRAP ; \ - HelpID = FN_FRAME_NOWRAP ; \ + HelpId = CMD_FN_FRAME_NOWRAP ; \ Text [ en-US ] = "~No Wrap" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_WRAP ; \ - HelpID = FN_FRAME_WRAP ; \ + HelpId = CMD_FN_FRAME_WRAP ; \ Text [ en-US ] = "~Page Wrap" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_WRAP_IDEAL ; \ - HelpID = FN_FRAME_WRAP_IDEAL ; \ + HelpId = CMD_FN_FRAME_WRAP_IDEAL ; \ Text [ en-US ] = "~Optimal Page Wrap" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_WRAPTHRU ; \ - HelpID = FN_FRAME_WRAPTHRU ; \ + HelpId = CMD_FN_FRAME_WRAPTHRU ; \ Text [ en-US ] = "~Wrap Through" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_WRAPTHRU_TRANSP ; \ - HelpID = FN_FRAME_WRAPTHRU_TRANSP ; \ + HelpId = CMD_FN_FRAME_WRAPTHRU_TRANSP ; \ Text [ en-US ] = "In ~Background" ; \ };\ SEPARATOR ; \ @@ -664,14 +662,14 @@ String MN_DRAW_POPUPMENU {\ Checkable = TRUE ; \ Identifier = FN_WRAP_ANCHOR_ONLY ; \ - HelpID = FN_WRAP_ANCHOR_ONLY ; \ + HelpId = CMD_FN_WRAP_ANCHOR_ONLY ; \ Text [ en-US ] = "~First Paragraph" ; \ };\ SEPARATOR ; \ MenuItem\ {\ Identifier = FN_DRAW_WRAP_DLG ; \ - HelpID = FN_DRAW_WRAP_DLG ; \ + HelpId = CMD_FN_DRAW_WRAP_DLG ; \ Text [ en-US ] = "~Edit..." ; \ };\ };\ @@ -690,7 +688,7 @@ String MN_DRAW_POPUPMENU {\ RadioCheck = TRUE ; \ Identifier = FN_TOOL_ANKER_FRAME ; \ - HelpID = FN_TOOL_ANKER_FRAME ; \ + HelpId = CMD_FN_TOOL_ANKER_FRAME ; \ Text [ en-US ] = "To ~Frame" ; \ }; @@ -698,7 +696,7 @@ String MN_DRAW_POPUPMENU MenuItem\ {\ Identifier = FN_TOOL_ANKER ; \ - HelpID = FN_TOOL_ANKER ; \ + HelpId = CMD_FN_TOOL_ANKER ; \ Command = ".uno:AnchorMenu" ; \ Text [ en-US ] = "An~chor" ; \ SubMenu = Menu\ @@ -709,28 +707,28 @@ String MN_DRAW_POPUPMENU {\ RadioCheck = TRUE ; \ Identifier = FN_TOOL_ANKER_PAGE ; \ - HelpID = FN_TOOL_ANKER_PAGE ; \ + HelpId = CMD_FN_TOOL_ANKER_PAGE ; \ Text [ en-US ] = "To P~age" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_TOOL_ANKER_PARAGRAPH ; \ - HelpID = FN_TOOL_ANKER_PARAGRAPH ; \ + HelpId = CMD_FN_TOOL_ANKER_PARAGRAPH ; \ Text [ en-US ] = "To ~Paragraph" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_TOOL_ANKER_AT_CHAR ; \ - HelpID = FN_TOOL_ANKER_AT_CHAR ; \ + HelpId = CMD_FN_TOOL_ANKER_AT_CHAR ; \ Text [ en-US ] = "To ~Character" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_TOOL_ANKER_CHAR ; \ - HelpID = FN_TOOL_ANKER_CHAR ; \ + HelpId = CMD_FN_TOOL_ANKER_CHAR ; \ Text [ en-US ] = "As C~haracter" ; \ };\ MN_AT_FRAME\ @@ -820,7 +818,7 @@ Menu MN_DRWTXT_POPUPMENU MenuItem\ {\ Identifier = FN_DELETE_COMMENT ;\ - HelpID = FN_DELETE_COMMENT ;\ + HelpId = CMD_FN_DELETE_COMMENT ;\ Text [ en-US ] = "Delete ~Changes Note" ;\ };\ @@ -905,7 +903,6 @@ String MN_GRF_POPUPMENU MenuItem\ {\ Identifier = MN_FORMAT_FRM_HORZ ; \ - HelpID = MN_FORMAT_FRM_HORZ ; \ Command = ".uno:AlignFrameMenu" ; \ SubMenu = Menu\ {\ @@ -914,38 +911,38 @@ String MN_GRF_POPUPMENU MenuItem\ {\ Identifier = FN_FRAME_ALIGN_HORZ_LEFT ; \ - HelpID = FN_FRAME_ALIGN_HORZ_LEFT ; \ + HelpId = CMD_FN_FRAME_ALIGN_HORZ_LEFT ; \ Text [ en-US ] = "~Left" ; \ };\ MenuItem\ {\ Identifier = FN_FRAME_ALIGN_HORZ_CENTER ; \ - HelpID = FN_FRAME_ALIGN_HORZ_CENTER ; \ + HelpId = CMD_FN_FRAME_ALIGN_HORZ_CENTER ; \ Text [ en-US ] = "~Centered" ; \ };\ MenuItem\ {\ Identifier = FN_FRAME_ALIGN_HORZ_RIGHT ; \ - HelpID = FN_FRAME_ALIGN_HORZ_RIGHT ; \ + HelpId = CMD_FN_FRAME_ALIGN_HORZ_RIGHT ; \ Text [ en-US ] = "~Right" ; \ };\ SEPARATOR ; \ MenuItem\ {\ Identifier = FN_FRAME_ALIGN_VERT_TOP ; \ - HelpID = FN_FRAME_ALIGN_VERT_TOP ; \ + HelpId = CMD_FN_FRAME_ALIGN_VERT_TOP ; \ Text [ en-US ] = "Base at ~Top" ; \ };\ MenuItem\ {\ Identifier = FN_FRAME_ALIGN_VERT_CENTER ; \ - HelpID = FN_FRAME_ALIGN_VERT_CENTER ; \ + HelpId = CMD_FN_FRAME_ALIGN_VERT_CENTER ; \ Text [ en-US ] = "Base in ~Middle" ; \ };\ MenuItem\ {\ Identifier = FN_FRAME_ALIGN_VERT_BOTTOM ; \ - HelpID = FN_FRAME_ALIGN_VERT_BOTTOM ; \ + HelpId = CMD_FN_FRAME_ALIGN_VERT_BOTTOM ; \ Text [ en-US ] = "Base at ~Bottom" ; \ };\ };\ @@ -968,13 +965,13 @@ Menu MN_GRF_POPUPMENU MenuItem { Identifier = FN_FORMAT_GRAFIC_DLG ; - HelpID = FN_FORMAT_GRAFIC_DLG ; + HelpId = CMD_FN_FORMAT_GRAFIC_DLG ; Text [ en-US ] = "~Picture..." ; }; MenuItem { Identifier = FN_SAVE_GRAPHIC; - HelpID = FN_SAVE_GRAPHIC; + HelpId = CMD_FN_SAVE_GRAPHIC; Text [ en-US ] = "Save Graphics..." ; }; MN_FRM_CAPTION_ITEM @@ -1005,7 +1002,7 @@ Menu MN_OLE_POPUPMENU MenuItem { Identifier = FN_FORMAT_FRAME_DLG ; - HelpID = FN_FORMAT_FRAME_DLG ; + HelpId = CMD_FN_FORMAT_FRAME_DLG ; Text [ en-US ] = "Object..." ; }; MN_FRM_CAPTION_ITEM @@ -1047,13 +1044,13 @@ Menu MN_PPREVIEW_POPUPMENU MenuItem { Identifier = FN_PAGEUP ; - HelpID = FN_PAGEUP ; + HelpId = CMD_FN_PAGEUP ; Text [ en-US ] = "Previous Page" ; }; MenuItem { Identifier = FN_PAGEDOWN ; - HelpID = FN_PAGEDOWN ; + HelpId = CMD_FN_PAGEDOWN ; /* ### ACHTUNG: Neuer Text in Resource? Nächste Seite : Nõchste Seite */ Text [ en-US ] = "Next Page" ; }; @@ -1066,14 +1063,14 @@ Menu MN_PPREVIEW_POPUPMENU MenuItem { Identifier = FN_PRINT_PAGEPREVIEW ; - HelpID = FN_PRINT_PAGEPREVIEW ; + HelpId = CMD_FN_PRINT_PAGEPREVIEW ; Text [ en-US ] = "Print" ; }; SEPARATOR ; MenuItem { Identifier = SID_PRINTPREVIEW; - HelpID = SID_PRINTPREVIEW; + HelpId = CMD_SID_PRINTPREVIEW; Text [ en-US ] = "Close Preview" ; }; }; diff --git a/sw/source/ui/chrdlg/ccoll.src b/sw/source/ui/chrdlg/ccoll.src index 0d8baf2b2b..41dcaa9852 100644 --- a/sw/source/ui/chrdlg/ccoll.src +++ b/sw/source/ui/chrdlg/ccoll.src @@ -45,6 +45,7 @@ TabPage TP_CONDCOLL }; CheckBox CB_CONDITION { + HelpID = "sw:CheckBox:TP_CONDCOLL:CB_CONDITION"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; TabStop = TRUE ; @@ -84,6 +85,7 @@ TabPage TP_CONDCOLL }; ListBox LB_STYLE { + HelpID = "sw:ListBox:TP_CONDCOLL:LB_STYLE"; Pos = MAP_APPFONT ( 188 , 39 ) ; Size = MAP_APPFONT ( 60 , 108 ) ; TabStop = TRUE ; @@ -94,6 +96,7 @@ TabPage TP_CONDCOLL }; ListBox LB_FILTER { + HelpID = "sw:ListBox:TP_CONDCOLL:LB_FILTER"; Pos = MAP_APPFONT ( 188 , 150 ) ; Size = MAP_APPFONT ( 60 , 50 ) ; DropDown = TRUE ; @@ -104,6 +107,7 @@ TabPage TP_CONDCOLL }; PushButton PB_REMOVE { + HelpID = "sw:PushButton:TP_CONDCOLL:PB_REMOVE"; Pos = MAP_APPFONT ( 129 , 165 ) ; Size = MAP_APPFONT ( 50 , 12 ) ; TabStop = TRUE ; @@ -112,6 +116,7 @@ TabPage TP_CONDCOLL }; PushButton PB_ASSIGN { + HelpID = "sw:PushButton:TP_CONDCOLL:PB_ASSIGN"; Pos = MAP_APPFONT ( 185 , 165 ) ; Size = MAP_APPFONT ( 50 , 12 ) ; TabStop = TRUE ; diff --git a/sw/source/ui/chrdlg/chardlg.src b/sw/source/ui/chrdlg/chardlg.src index e6a6a82729..ba39ec72a8 100644 --- a/sw/source/ui/chrdlg/chardlg.src +++ b/sw/source/ui/chrdlg/chardlg.src @@ -120,6 +120,7 @@ TabPage TP_CHAR_URL }; Edit ED_URL { + HelpID = "sw:Edit:TP_CHAR_URL:ED_URL"; Pos = MAP_APPFONT ( 88 , 15 ) ; Size = MAP_APPFONT ( 104 , 12 ) ; Border = TRUE ; @@ -127,6 +128,7 @@ TabPage TP_CHAR_URL }; PushButton PB_URL { + HelpID = "sw:PushButton:TP_CHAR_URL:PB_URL"; Pos = MAP_APPFONT ( 198 , 14 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -140,6 +142,7 @@ TabPage TP_CHAR_URL }; Edit ED_TEXT { + HelpID = "sw:Edit:TP_CHAR_URL:ED_TEXT"; Pos = MAP_APPFONT ( 88 , 31 ) ; Size = MAP_APPFONT ( 104 , 12 ) ; Border = TRUE ; @@ -154,6 +157,7 @@ TabPage TP_CHAR_URL }; Edit ED_NAME { + HelpID = "sw:Edit:TP_CHAR_URL:ED_NAME"; Pos = MAP_APPFONT ( 88 , 47 ) ; Size = MAP_APPFONT ( 104 , 12 ) ; Border = TRUE ; @@ -168,6 +172,7 @@ TabPage TP_CHAR_URL }; ComboBox LB_TARGET { + HelpID = "sw:ComboBox:TP_CHAR_URL:LB_TARGET"; Pos = MAP_APPFONT ( 88 , 63 ) ; Size = MAP_APPFONT ( 104 , 60 ) ; TabStop = TRUE ; @@ -177,6 +182,7 @@ TabPage TP_CHAR_URL }; PushButton PB_EVENT { + HelpID = "sw:PushButton:TP_CHAR_URL:PB_EVENT"; Pos = MAP_APPFONT ( 12 , 79 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -196,6 +202,7 @@ TabPage TP_CHAR_URL }; ListBox LB_VISITED { + HelpID = "sw:ListBox:TP_CHAR_URL:LB_VISITED"; Pos = MAP_APPFONT ( 88 , 113 ) ; Size = MAP_APPFONT ( 104 , 60 ) ; Border = TRUE ; @@ -212,6 +219,7 @@ TabPage TP_CHAR_URL }; ListBox LB_NOT_VISITED { + HelpID = "sw:ListBox:TP_CHAR_URL:LB_NOT_VISITED"; Pos = MAP_APPFONT ( 88 , 129 ) ; Size = MAP_APPFONT ( 104 , 60 ) ; Border = TRUE ; diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index d05fe5976e..f69fcc577f 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -364,10 +364,10 @@ void SwDropCapsPict::DrawPrev( const Point& rPt ) Font aOldFont = mpPrinter->GetFont(); USHORT nScript; - USHORT nIdx = 0; + size_t nIdx = 0; xub_StrLen nStart = 0; xub_StrLen nEnd; - USHORT nCnt = maScriptChg.Count(); + size_t nCnt = maScriptChg.size(); if( nCnt ) { @@ -406,10 +406,10 @@ void SwDropCapsPict::CheckScript( void ) return; maScriptText = maText; - USHORT nCnt = maScriptChg.Count(); + size_t nCnt = maScriptChg.size(); if( nCnt ) { - maScriptChg.Remove( 0, nCnt ); + maScriptChg.clear(); maScriptType.Remove( 0, nCnt ); maTextWidth.Remove( 0, nCnt ); nCnt = 0; @@ -436,7 +436,7 @@ void SwDropCapsPict::CheckScript( void ) do { nChg = (xub_StrLen)xBreak->endOfScript( maText, nChg, nScript ); - maScriptChg.Insert( nChg, nCnt ); + maScriptChg.push_back( nChg ); maScriptType.Insert( nScript, nCnt ); maTextWidth.Insert( ULONG(0), nCnt++ ); @@ -453,10 +453,10 @@ Size SwDropCapsPict::CalcTextSize( void ) InitPrinter(); USHORT nScript; - USHORT nIdx = 0; + size_t nIdx = 0; xub_StrLen nStart = 0; xub_StrLen nEnd; - USHORT nCnt = maScriptChg.Count(); + size_t nCnt = maScriptChg.size(); if( nCnt ) { nEnd = maScriptChg[ nIdx ]; diff --git a/sw/source/ui/chrdlg/drpcps.src b/sw/source/ui/chrdlg/drpcps.src index ae3da330c4..edf373fcd3 100644 --- a/sw/source/ui/chrdlg/drpcps.src +++ b/sw/source/ui/chrdlg/drpcps.src @@ -59,12 +59,14 @@ TabPage TP_DROPCAPS Hide = TRUE ; CheckBox CB_SWITCH { + HelpID = "sw:CheckBox:TP_DROPCAPS:CB_SWITCH"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; Text [ en-US ] = "Display drop caps" ; }; CheckBox CB_WORD { + HelpID = "sw:CheckBox:TP_DROPCAPS:CB_WORD"; Pos = MAP_APPFONT ( 12 , 28 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; Text [ en-US ] = "~Whole word" ; @@ -77,6 +79,7 @@ TabPage TP_DROPCAPS }; NumericField FLD_DROPCAPS { + HelpID = "sw:NumericField:TP_DROPCAPS:FLD_DROPCAPS"; Border = TRUE ; First = 1 ; Last = 9 ; @@ -98,6 +101,7 @@ TabPage TP_DROPCAPS }; NumericField FLD_LINES { + HelpID = "sw:NumericField:TP_DROPCAPS:FLD_LINES"; Border = TRUE ; First = 2 ; Last = 9 ; @@ -119,6 +123,7 @@ TabPage TP_DROPCAPS }; MetricField FLD_DISTANCE { + HelpID = "sw:MetricField:TP_DROPCAPS:FLD_DISTANCE"; Border = TRUE ; DecimalDigits = 2 ; First = 0 ; @@ -155,6 +160,7 @@ TabPage TP_DROPCAPS }; Edit EDT_TEXT { + HelpID = "sw:Edit:TP_DROPCAPS:EDT_TEXT"; Border = TRUE ; Left = TRUE ; Pos = MAP_APPFONT ( 143 , 100 ) ; @@ -171,6 +177,7 @@ TabPage TP_DROPCAPS }; ListBox BOX_TEMPLATE { + HelpID = "sw:ListBox:TP_DROPCAPS:BOX_TEMPLATE"; Border = TRUE ; DropDown = TRUE ; Pos = MAP_APPFONT ( 143 , 116 ) ; diff --git a/sw/source/ui/chrdlg/makefile.mk b/sw/source/ui/chrdlg/makefile.mk index 42aad1aedd..6b05d0fbfb 100644 --- a/sw/source/ui/chrdlg/makefile.mk +++ b/sw/source/ui/chrdlg/makefile.mk @@ -30,6 +30,9 @@ PRJ=..$/..$/.. PRJNAME=sw TARGET=chrdlg LIBTARGET=NO + +ENABLE_EXCEPTIONS=TRUE + # --- Settings ----------------------------------------------------- .INCLUDE : $(PRJ)$/inc$/swpre.mk diff --git a/sw/source/ui/chrdlg/numpara.src b/sw/source/ui/chrdlg/numpara.src index 14ed11fa0a..591333766b 100644 --- a/sw/source/ui/chrdlg/numpara.src +++ b/sw/source/ui/chrdlg/numpara.src @@ -51,6 +51,7 @@ TabPage TP_NUMPARA }; ListBox LB_OUTLINE_LEVEL { + HelpID = "sw:ListBox:TP_NUMPARA:LB_OUTLINE_LEVEL"; Pos = MAP_APPFONT ( 130 , 14 ) ; Size = MAP_APPFONT ( 118 , 65 ) ; DropDown = TRUE ; @@ -98,6 +99,7 @@ TabPage TP_NUMPARA }; ListBox LB_NUMBER_STYLE { + HelpID = "sw:ListBox:TP_NUMPARA:LB_NUMBER_STYLE"; Pos = MAP_APPFONT ( 130 , 41 ) ; Size = MAP_APPFONT ( 118 , 65 ) ; DropDown = TRUE ; @@ -109,6 +111,7 @@ TabPage TP_NUMPARA }; TriStateBox CB_NEW_START { + HelpID = "sw:TriStateBox:TP_NUMPARA:CB_NEW_START"; Pos = MAP_APPFONT ( 12 , 58 ) ; Size = MAP_APPFONT ( 160 , 10 ) ; Hide = TRUE ; @@ -117,6 +120,7 @@ TabPage TP_NUMPARA }; TriStateBox CB_NUMBER_NEW_START { + HelpID = "sw:TriStateBox:TP_NUMPARA:CB_NUMBER_NEW_START"; Pos = MAP_APPFONT ( 21 , 73 ) ; Size = MAP_APPFONT ( 103 , 10 ) ; Hide = TRUE ; @@ -125,6 +129,7 @@ TabPage TP_NUMPARA }; NumericField NF_NEW_START { + HelpID = "sw:NumericField:TP_NUMPARA:NF_NEW_START"; Border = TRUE ; Pos = MAP_APPFONT ( 130 , 72 ) ; Size = MAP_APPFONT ( 26 , 12 ) ; @@ -148,6 +153,7 @@ TabPage TP_NUMPARA }; TriStateBox CB_COUNT_PARA { + HelpID = "sw:TriStateBox:TP_NUMPARA:CB_COUNT_PARA"; Pos = MAP_APPFONT ( 12 , 100 ) ; Size = MAP_APPFONT ( 160 , 10 ) ; TabStop = TRUE ; @@ -155,6 +161,7 @@ TabPage TP_NUMPARA }; TriStateBox CB_RESTART_PARACOUNT { + HelpID = "sw:TriStateBox:TP_NUMPARA:CB_RESTART_PARACOUNT"; Pos = MAP_APPFONT ( 12 , 116 ) ; Size = MAP_APPFONT ( 160 , 10 ) ; TabStop = TRUE ; @@ -169,6 +176,7 @@ TabPage TP_NUMPARA }; NumericField NF_RESTART_PARA { + HelpID = "sw:NumericField:TP_NUMPARA:NF_RESTART_PARA"; Border = TRUE ; Pos = MAP_APPFONT ( 130 , 130 ) ; Size = MAP_APPFONT ( 26 , 12 ) ; diff --git a/sw/source/ui/chrdlg/swbreak.src b/sw/source/ui/chrdlg/swbreak.src index c626278748..1ed8491a31 100644 --- a/sw/source/ui/chrdlg/swbreak.src +++ b/sw/source/ui/chrdlg/swbreak.src @@ -32,7 +32,7 @@ // #define DLG_BREAK 256 ModalDialog DLG_BREAK { - HelpID = FN_INSERT_BREAK_DLG ; + HelpID = CMD_FN_INSERT_BREAK_DLG ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 161 , 114 ) ; @@ -63,6 +63,7 @@ ModalDialog DLG_BREAK }; RadioButton RB_LINE { + HelpID = "sw:RadioButton:DLG_BREAK:RB_LINE"; Pos = MAP_APPFONT ( 12 , 15 ) ; Size = MAP_APPFONT ( 63 , 10 ) ; Text [ en-US ] = "~Line break" ; @@ -71,6 +72,7 @@ ModalDialog DLG_BREAK }; RadioButton RB_PAGE { + HelpID = "sw:RadioButton:DLG_BREAK:RB_PAGE"; Pos = MAP_APPFONT ( 12 , 39 ) ; Size = MAP_APPFONT ( 63 , 10 ) ; Text [ en-US ] = "~Page break" ; @@ -79,6 +81,7 @@ ModalDialog DLG_BREAK }; RadioButton RB_COL { + HelpID = "sw:RadioButton:DLG_BREAK:RB_COL"; Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 69 , 10 ) ; Text [ en-US ] = "~Column break" ; @@ -100,6 +103,7 @@ ModalDialog DLG_BREAK }; ListBox LB_COLL { + HelpID = "sw:ListBox:DLG_BREAK:LB_COLL"; Pos = MAP_APPFONT ( 12 , 62 ) ; Size = MAP_APPFONT ( 75 , 50 ) ; TabStop = TRUE ; @@ -112,6 +116,7 @@ ModalDialog DLG_BREAK }; CheckBox CB_PAGENUM { + HelpID = "sw:CheckBox:DLG_BREAK:CB_PAGENUM"; Pos = MAP_APPFONT ( 12 , 79 ) ; Size = MAP_APPFONT ( 84 , 10 ) ; /* ### ACHTUNG: Neuer Text in Resource? Seitennummer ~ändern : Seitennummer ~õndern */ @@ -120,6 +125,7 @@ ModalDialog DLG_BREAK }; NumericField ED_PAGENUM { + HelpID = "sw:NumericField:DLG_BREAK:ED_PAGENUM"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 94 ) ; Size = MAP_APPFONT ( 31 , 12 ) ; diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx index 7fb20bf3f8..f5e8c1e4ef 100644 --- a/sw/source/ui/chrdlg/swuiccoll.cxx +++ b/sw/source/ui/chrdlg/swuiccoll.cxx @@ -109,7 +109,7 @@ SwCondCollPage::SwCondCollPage(Window *pParent, const SfxItemSet &rSet) aStyleLB.SetSelectHdl( LINK(this, SwCondCollPage, SelectHdl)); aFilterLB.SetSelectHdl( LINK(this, SwCondCollPage, SelectHdl)); - aTbLinks.SetWindowBits(WB_HSCROLL|WB_CLIPCHILDREN); + aTbLinks.SetStyle(aTbLinks.GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN); aTbLinks.SetSelectionMode( SINGLE_SELECTION ); aTbLinks.SetTabs( &nTabs[0], MAP_APPFONT ); aTbLinks.Resize(); // OS: Hack fuer richtige Selektion diff --git a/sw/source/ui/config/cfgitems.cxx b/sw/source/ui/config/cfgitems.cxx index 352819a184..6fa2666579 100644 --- a/sw/source/ui/config/cfgitems.cxx +++ b/sw/source/ui/config/cfgitems.cxx @@ -458,4 +458,3 @@ int SwTestItem::operator==( const SfxPoolItem& rAttr ) const #endif - diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx index e8752bd08f..c48a8b64fe 100644 --- a/sw/source/ui/config/mailconfigpage.cxx +++ b/sw/source/ui/config/mailconfigpage.cxx @@ -330,7 +330,7 @@ SwTestAccountSettingsDialog::SwTestAccountSettingsDialog(SwMailConfigPage* pPare m_aStatusLB.SetHelpId(HID_MM_TESTACCOUNTSETTINGS_TLB); static long nTabs[] = {2, 0, aSz.Width()/2 }; - m_aStatusLB.SetWindowBits( WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP ); + m_aStatusLB.SetStyle( m_aStatusLB.GetStyle() | WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP ); m_aStatusLB.SetSelectionMode( SINGLE_SELECTION ); m_aStatusLB.SetTabs(&nTabs[0], MAP_PIXEL); short nEntryHeight = m_aStatusLB.GetEntryHeight(); diff --git a/sw/source/ui/config/mailconfigpage.src b/sw/source/ui/config/mailconfigpage.src index f76f01ccab..1673f1952e 100644 --- a/sw/source/ui/config/mailconfigpage.src +++ b/sw/source/ui/config/mailconfigpage.src @@ -53,6 +53,7 @@ TabPage TP_MAILCONFIG }; Edit ED_DISPLAYNAME { + HelpID = "sw:Edit:TP_MAILCONFIG:ED_DISPLAYNAME"; Pos = MAP_APPFONT ( 88 , 14 ) ; Size = MAP_APPFONT ( 160 , 12 ) ; Border = TRUE; @@ -65,12 +66,14 @@ TabPage TP_MAILCONFIG }; Edit ED_ADDRESS { + HelpID = "sw:Edit:TP_MAILCONFIG:ED_ADDRESS"; Pos = MAP_APPFONT ( 88 , 29 ) ; Size = MAP_APPFONT ( 160 , 12 ) ; Border = TRUE; }; CheckBox CB_REPLYTO { + HelpID = "sw:CheckBox:TP_MAILCONFIG:CB_REPLYTO"; Pos = MAP_APPFONT ( 12 , 45 ) ; Size = MAP_APPFONT ( 242 , 10 ) ; Text[ en-US ] = "Send replies to ~different e-mail address"; @@ -83,6 +86,7 @@ TabPage TP_MAILCONFIG }; Edit ED_REPLYTO { + HelpID = "sw:Edit:TP_MAILCONFIG:ED_REPLYTO"; Pos = MAP_APPFONT ( 88 , 58 ) ; Size = MAP_APPFONT ( 160 , 12 ) ; Border = TRUE; @@ -101,6 +105,7 @@ TabPage TP_MAILCONFIG }; Edit ED_SERVER { + HelpID = "sw:Edit:TP_MAILCONFIG:ED_SERVER"; Pos = MAP_APPFONT ( 88 , 87 ) ; Size = MAP_APPFONT ( 105 , 12 ) ; Border = TRUE; @@ -114,6 +119,7 @@ TabPage TP_MAILCONFIG }; NumericField NF_PORT { + HelpID = "sw:NumericField:TP_MAILCONFIG:NF_PORT"; Pos = MAP_APPFONT ( 223 , 87 ) ; Size = MAP_APPFONT ( 25 , 12 ) ; Border = TRUE; @@ -127,12 +133,14 @@ TabPage TP_MAILCONFIG }; CheckBox CB_SECURE { + HelpID = "sw:CheckBox:TP_MAILCONFIG:CB_SECURE"; Pos = MAP_APPFONT ( 12 , 104 ) ; Size = MAP_APPFONT ( 242 , 10 ) ; Text[ en-US ] = "~Use secure connection (SSL)"; }; PushButton PB_AUTHENTICATION { + HelpID = "sw:PushButton:TP_MAILCONFIG:PB_AUTHENTICATION"; Pos = MAP_APPFONT ( 88 , 118 ) ; Size = MAP_APPFONT ( 105 , 14 ) ; Text[ en-US ] = "Server Au~thentication"; @@ -144,6 +152,7 @@ TabPage TP_MAILCONFIG }; PushButton PB_TEST { + HelpID = "sw:PushButton:TP_MAILCONFIG:PB_TEST"; Pos = MAP_APPFONT ( 88 , 164 ) ; Size = MAP_APPFONT ( 105 , 14 ) ; Text[ en-US ] = "Test S~ettings..."; @@ -179,6 +188,7 @@ ModalDialog DLG_MM_TESTACCOUNTSETTINGS }; MultiLineEdit ED_ERROR { + HelpID = "sw:MultiLineEdit:DLG_MM_TESTACCOUNTSETTINGS:ED_ERROR"; Pos = MAP_APPFONT ( 6 , 79 ) ; Size = MAP_APPFONT ( 238 , 60 ) ; Border = TRUE; @@ -191,6 +201,7 @@ ModalDialog DLG_MM_TESTACCOUNTSETTINGS }; PushButton PB_STOP { + HelpID = "sw:PushButton:DLG_MM_TESTACCOUNTSETTINGS:PB_STOP"; Pos = MAP_APPFONT ( 85 , 156 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text[ en-US ] = "~Stop"; @@ -268,12 +279,14 @@ ModalDialog DLG_MM_SERVERAUTHENTICATION CheckBox CB_AUTHENTICATION { + HelpID = "sw:CheckBox:DLG_MM_SERVERAUTHENTICATION:CB_AUTHENTICATION"; Pos = MAP_APPFONT ( 6 , 3 ) ; Size = MAP_APPFONT ( 238 , 10 ) ; Text[ en-US ] = "The outgoing mail server (SMTP) requires au~thentication"; }; RadioButton RB_SEP_AUTHENTICATION { + HelpID = "sw:RadioButton:DLG_MM_SERVERAUTHENTICATION:RB_SEP_AUTHENTICATION"; Pos = MAP_APPFONT ( 12 , 17 ) ; Size = MAP_APPFONT ( 232 , 10 ) ; Text[ en-US ] = "The outgoing mail server (SMTP) requires ~separate authentication"; @@ -292,6 +305,7 @@ ModalDialog DLG_MM_SERVERAUTHENTICATION }; Edit ED_USERNAME { + HelpID = "sw:Edit:DLG_MM_SERVERAUTHENTICATION:ED_USERNAME"; Pos = MAP_APPFONT ( 78 , 42 ) ; Size = MAP_APPFONT ( 115 , 12 ) ; Border = TRUE; @@ -304,6 +318,7 @@ ModalDialog DLG_MM_SERVERAUTHENTICATION }; Edit ED_OUTPASSWORD { + HelpID = "sw:Edit:DLG_MM_SERVERAUTHENTICATION:ED_OUTPASSWORD"; Pos = MAP_APPFONT ( 78 , 57 ) ; Size = MAP_APPFONT ( 115 , 12 ) ; Border = TRUE; @@ -311,6 +326,7 @@ ModalDialog DLG_MM_SERVERAUTHENTICATION }; RadioButton RB_SMPTAFTERPOP { + HelpID = "sw:RadioButton:DLG_MM_SERVERAUTHENTICATION:RB_SMPTAFTERPOP"; Pos = MAP_APPFONT ( 12 , 73 ) ; Size = MAP_APPFONT ( 232 , 20 ) ; WordBreak = TRUE; @@ -330,6 +346,7 @@ ModalDialog DLG_MM_SERVERAUTHENTICATION }; Edit ED_SERVER { + HelpID = "sw:Edit:DLG_MM_SERVERAUTHENTICATION:ED_SERVER"; Pos = MAP_APPFONT ( 78 , 108 ) ; Size = MAP_APPFONT ( 115 , 12 ) ; Border = TRUE; @@ -343,6 +360,7 @@ ModalDialog DLG_MM_SERVERAUTHENTICATION }; NumericField NF_PORT { + HelpID = "sw:NumericField:DLG_MM_SERVERAUTHENTICATION:NF_PORT"; Pos = MAP_APPFONT ( 219 , 108 ) ; Size = MAP_APPFONT ( 25 , 12 ) ; Border = TRUE; @@ -362,12 +380,14 @@ ModalDialog DLG_MM_SERVERAUTHENTICATION }; RadioButton RB_POP3 { + HelpID = "sw:RadioButton:DLG_MM_SERVERAUTHENTICATION:RB_POP3"; Pos = MAP_APPFONT ( 78 , 125 ) ; Size = MAP_APPFONT ( 115 , 10 ) ; Text[ en-US ] = "~POP 3"; }; RadioButton RB_IMAP { + HelpID = "sw:RadioButton:DLG_MM_SERVERAUTHENTICATION:RB_IMAP"; Pos = MAP_APPFONT ( 78 , 138 ) ; Size = MAP_APPFONT ( 115 , 10 ) ; Text[ en-US ] = "~IMAP"; @@ -380,6 +400,7 @@ ModalDialog DLG_MM_SERVERAUTHENTICATION }; Edit ED_INUSERNAME { + HelpID = "sw:Edit:DLG_MM_SERVERAUTHENTICATION:ED_INUSERNAME"; Pos = MAP_APPFONT ( 78 , 150 ) ; Size = MAP_APPFONT ( 115 , 12 ) ; Border = TRUE; @@ -392,6 +413,7 @@ ModalDialog DLG_MM_SERVERAUTHENTICATION }; Edit ED_INPASSWORD { + HelpID = "sw:Edit:DLG_MM_SERVERAUTHENTICATION:ED_INPASSWORD"; Pos = MAP_APPFONT ( 78 , 165 ) ; Size = MAP_APPFONT ( 115 , 12 ) ; Border = TRUE; diff --git a/sw/source/ui/config/makefile.mk b/sw/source/ui/config/makefile.mk index 4b8ed01ca9..c093b18ce0 100644 --- a/sw/source/ui/config/makefile.mk +++ b/sw/source/ui/config/makefile.mk @@ -83,5 +83,4 @@ LIB1OBJFILES = \ # --- Targets ------------------------------------------------------- -.INCLUDE : target.mk - +.INCLUDE : target.mk
\ No newline at end of file diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx index 53603031e1..0dbd938359 100644 --- a/sw/source/ui/config/optcomp.cxx +++ b/sw/source/ui/config/optcomp.cxx @@ -152,7 +152,7 @@ SwCompatibilityOptPage::SwCompatibilityOptPage( Window* pParent, const SfxItemSe pEntry->SetUserData( (void*)(ULONG)nResId ); } } - m_aOptionsLB.SetWindowBits( m_aOptionsLB.GetStyle() | WB_HSCROLL | WB_HIDESELECTION ); + m_aOptionsLB.SetStyle( m_aOptionsLB.GetStyle() | WB_HSCROLL | WB_HIDESELECTION ); m_aOptionsLB.SetHighlightRange(); FreeResource(); diff --git a/sw/source/ui/config/optcomp.src b/sw/source/ui/config/optcomp.src index 3682b49477..fee89d732d 100644 --- a/sw/source/ui/config/optcomp.src +++ b/sw/source/ui/config/optcomp.src @@ -50,6 +50,7 @@ TabPage TP_OPTCOMPATIBILITY_PAGE }; ListBox LB_FORMATTING { + HelpID = "sw:ListBox:TP_OPTCOMPATIBILITY_PAGE:LB_FORMATTING"; Pos = MAP_APPFONT ( 12 , 25 ) ; Size = MAP_APPFONT ( 118 , 24 ) ; DropDown = TRUE; @@ -70,12 +71,14 @@ TabPage TP_OPTCOMPATIBILITY_PAGE }; PushButton PB_RESET { + HelpID = "sw:PushButton:TP_OPTCOMPATIBILITY_PAGE:PB_RESET"; Pos = MAP_APPFONT ( 125 , 165 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "~Reset"; }; PushButton PB_DEFAULT { + HelpID = "sw:PushButton:TP_OPTCOMPATIBILITY_PAGE:PB_DEFAULT"; Pos = MAP_APPFONT ( 188 , 165 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "Use as ~Default"; diff --git a/sw/source/ui/config/optdlg.hrc b/sw/source/ui/config/optdlg.hrc index 31f2e7041f..d58d1b6ac4 100644 --- a/sw/source/ui/config/optdlg.hrc +++ b/sw/source/ui/config/optdlg.hrc @@ -30,7 +30,7 @@ #define FL_NOPRINT 2 #define FL_WINDOW 3 -#define CB_GRF 1 +#define CB_GRF 1 #define CB_TBL 2 #define CB_DRWFAST 3 #define CB_FIELD 4 @@ -39,10 +39,10 @@ #define CB_SPACE 7 #define CB_HSPACE 8 #define CB_SHYPH 9 -#define CB_FLD_HIDDEN 10 +#define CB_FLD_HIDDEN 10 #define CB_BREAK 11 #define CB_ANY_RULER 12 -#define CB_CROSS 14 +#define CB_CROSS 14 #define CB_HSCROLL 15 #define CB_VSCROLL 16 #define CB_HRULER 17 @@ -50,7 +50,7 @@ #define FL_LINE 22 #define CB_POSTIT 23 #define CB_VRULER_RIGHT 24 -#define CB_BIGHANDLE 25 +#define CB_BIGHANDLE 25 #define FL_SETTINGS 26 #define LB_METRIC 27 @@ -191,7 +191,7 @@ #define FL_TABLE_SEPARATOR 139 #define CB_PROSPECT_RTL 140 -#define FL_SHDWCRSFLAG 1 +#define FL_SHDWCRSFLAG 1 #define CB_SHDWCRSONOFF 2 #define FL_SHDWCRSMODE 3 #define FT_SHDWCRSFILLMODE 4 @@ -201,5 +201,8 @@ #define RB_SHDWCRSFILLSPACE 8 #define CB_ALLOW_IN_PROT 12 #define FL_CRSR_OPT 13 -#define FL_SEPARATOR_SHDW 14 +#define FL_SEPARATOR_SHDW 14 +#define FL_LAYOUT_OPTIONS 15 +#define CB_MATH_BASELINE_ALIGNMENT 16 + diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src index a2573ed3c1..bd7133612a 100755..100644 --- a/sw/source/ui/config/optdlg.src +++ b/sw/source/ui/config/optdlg.src @@ -56,18 +56,21 @@ TabPage TP_CONTENT_OPT }; CheckBox CB_CROSS { + HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_CROSS"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 118 , 10 ) ; Text [ en-US ] = "Guides ~while moving"; }; CheckBox CB_HANDLE { + HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_HANDLE"; Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 118 , 10 ) ; Text [ en-US ] = "Sim~ple handles"; }; CheckBox CB_BIGHANDLE { + HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_BIGHANDLE"; Pos = MAP_APPFONT ( 12 , 40 ) ; Size = MAP_APPFONT ( 118 , 10 ) ; Text [ en-US ] = "Large handles"; @@ -81,54 +84,63 @@ TabPage TP_CONTENT_OPT }; CheckBox CB_HSCROLL { + HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_HSCROLL"; Pos = MAP_APPFONT ( 136 , 14 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; Text [ en-US ] = "H~orizontal scrollbar" ; }; CheckBox CB_VSCROLL { + HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_VSCROLL"; Pos = MAP_APPFONT ( 136 , 27 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; Text [ en-US ] = "~Vertical scrollbar" ; }; CheckBox CB_ANY_RULER { + HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_ANY_RULER"; Pos = MAP_APPFONT ( 136 , 40 ) ; Size = MAP_APPFONT ( 65 , 10 ) ; Text [ en-US ] = "R~uler" ; }; CheckBox CB_HRULER { + HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_HRULER"; Pos = MAP_APPFONT ( 142 , 53 ) ; Size = MAP_APPFONT ( 62 , 10 ) ; Text [ en-US ] = "Hori~zontal ruler" ; }; ListBox LB_HMETRIC { + HelpID = "sw:ListBox:TP_CONTENT_OPT:LB_HMETRIC"; Pos = MAP_APPFONT ( 206 , 51 ) ; Size = MAP_APPFONT ( 45 , 60 ) ; DropDown = TRUE; }; CheckBox CB_VRULER { + HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_VRULER"; Pos = MAP_APPFONT ( 142 , 66 ) ; Size = MAP_APPFONT ( 62 , 10 ) ; Text [ en-US ] = "Verti~cal ruler" ; }; CheckBox CB_VRULER_RIGHT { + HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_VRULER_RIGHT"; Pos = MAP_APPFONT ( 148 , 79 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; Text [ en-US ] = "Right-aligned"; }; ListBox LB_VMETRIC { + HelpID = "sw:ListBox:TP_CONTENT_OPT:LB_VMETRIC"; Pos = MAP_APPFONT ( 206 , 64 ) ; Size = MAP_APPFONT ( 45 , 60 ) ; DropDown = TRUE; }; CheckBox CB_SMOOTH_SCROLL { + HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_SMOOTH_SCROLL"; Pos = MAP_APPFONT ( 136 , 79 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; Text [ en-US ] = "S~mooth scroll" ; @@ -142,6 +154,7 @@ TabPage TP_CONTENT_OPT }; CheckBox CB_GRF { + HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_GRF"; Pos = MAP_APPFONT ( 12 , 67 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; Text [ en-US ] = "~Graphics and objects" ; @@ -150,24 +163,28 @@ TabPage TP_CONTENT_OPT }; CheckBox CB_TBL { + HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_TBL"; Pos = MAP_APPFONT ( 12 , 80 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; Text [ en-US ] = "~Tables " ; }; CheckBox CB_DRWFAST { + HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_DRWFAST"; Pos = MAP_APPFONT ( 12 , 93 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; Text [ en-US ] = "Dra~wings and controls" ; }; CheckBox CB_FIELD { + HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_FIELD"; Pos = MAP_APPFONT ( 12 , 106 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; Text [ en-US ] = "~Field codes" ; }; CheckBox CB_POSTIT { + HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_POSTIT"; Pos = MAP_APPFONT ( 12 , 119 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; Text [ en-US ] = "~Comments" ; @@ -188,6 +205,7 @@ TabPage TP_CONTENT_OPT }; ListBox LB_METRIC { + HelpID = "sw:ListBox:TP_CONTENT_OPT:LB_METRIC"; Pos = MAP_APPFONT ( 199, 133 ) ; Size = MAP_APPFONT ( 50 , 50 ) ; Border = TRUE ; @@ -214,6 +232,7 @@ TabPage TP_OPTPRINT_PAGE }; CheckBox CB_PGRF /*functionally merged with CB_PDRAW*/ { + HelpID = "sw:CheckBox:TP_OPTPRINT_PAGE:CB_PGRF"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "~Pictures and objects" ; @@ -224,6 +243,7 @@ TabPage TP_OPTPRINT_PAGE removed, tables now always get printed CheckBox CB_PTAB { + HelpID = "sw:CheckBox:TP_OPTPRINT_PAGE:CB_PTAB"; Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "~Tables" ; @@ -233,6 +253,7 @@ TabPage TP_OPTPRINT_PAGE functionally merged with CB_PGRF (pictures and graphics) CheckBox CB_PDRAW { + HelpID = "sw:CheckBox:TP_OPTPRINT_PAGE:CB_PDRAW"; Pos = MAP_APPFONT ( 12 , 40 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "Dra~wings" ; @@ -240,30 +261,35 @@ TabPage TP_OPTPRINT_PAGE */ CheckBox CB_CTRLFLD { + HelpID = "sw:CheckBox:TP_OPTPRINT_PAGE:CB_CTRLFLD"; Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "Form control~s" ; }; CheckBox CB_BACKGROUND { + HelpID = "sw:CheckBox:TP_OPTPRINT_PAGE:CB_BACKGROUND"; Pos = MAP_APPFONT ( 12 , 40 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "Page ba~ckground" ; }; CheckBox CB_BLACK_FONT { + HelpID = "sw:CheckBox:TP_OPTPRINT_PAGE:CB_BLACK_FONT"; Pos = MAP_APPFONT ( 12 , 53 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "Print text in blac~k" ; }; CheckBox CB_HIDDEN_TEXT { + HelpID = "sw:CheckBox:TP_OPTPRINT_PAGE:CB_HIDDEN_TEXT"; Pos = MAP_APPFONT ( 12 , 66 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "Hidden te~xt" ; }; CheckBox CB_TEXT_PLACEHOLDER { + HelpID = "sw:CheckBox:TP_OPTPRINT_PAGE:CB_TEXT_PLACEHOLDER"; Pos = MAP_APPFONT ( 12 , 79 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "Text ~placeholder" ; @@ -283,6 +309,7 @@ TabPage TP_OPTPRINT_PAGE }; CheckBox CB_LEFTP { + HelpID = "sw:CheckBox:TP_OPTPRINT_PAGE:CB_LEFTP"; Pos = MAP_APPFONT ( 96 , 14 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "~Left pages" ; @@ -291,6 +318,7 @@ TabPage TP_OPTPRINT_PAGE }; CheckBox CB_RIGHTP { + HelpID = "sw:CheckBox:TP_OPTPRINT_PAGE:CB_RIGHTP"; Pos = MAP_APPFONT ( 96 , 27 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "~Right pages" ; @@ -299,6 +327,7 @@ TabPage TP_OPTPRINT_PAGE removed, noe handled by the new print dialog (i.e. vcl) itself CheckBox CB_REVERSE { + HelpID = "sw:CheckBox:TP_OPTPRINT_PAGE:CB_REVERSE"; Pos = MAP_APPFONT ( 96 , 40 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "Re~versed" ; @@ -306,12 +335,14 @@ TabPage TP_OPTPRINT_PAGE */ CheckBox CB_PROSPECT { + HelpID = "sw:CheckBox:TP_OPTPRINT_PAGE:CB_PROSPECT"; Pos = MAP_APPFONT ( 96 , 40 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "Broch~ure" ; }; CheckBox CB_PROSPECT_RTL { + HelpID = "sw:CheckBox:TP_OPTPRINT_PAGE:CB_PROSPECT_RTL"; Pos = MAP_APPFONT ( 103 , 53 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "Right to Left" ; @@ -319,6 +350,7 @@ TabPage TP_OPTPRINT_PAGE }; RadioButton RB_NO { + HelpID = "sw:RadioButton:TP_OPTPRINT_PAGE:RB_NO"; Pos = MAP_APPFONT ( 180 , 14 ) ; Size = MAP_APPFONT ( 74 , 10 ) ; Text [ en-US ] = "~None" ; @@ -327,18 +359,21 @@ TabPage TP_OPTPRINT_PAGE }; RadioButton RB_ONLY { + HelpID = "sw:RadioButton:TP_OPTPRINT_PAGE:RB_ONLY"; Pos = MAP_APPFONT ( 180 , 27 ) ; Size = MAP_APPFONT ( 74 , 10 ) ; Text [ en-US ] = "Comments ~only" ; }; RadioButton RB_END { + HelpID = "sw:RadioButton:TP_OPTPRINT_PAGE:RB_END"; Pos = MAP_APPFONT ( 180 , 40 ) ; Size = MAP_APPFONT ( 74 , 10 ) ; Text [ en-US ] = "End of docu~ment" ; }; RadioButton RB_PAGEEND { + HelpID = "sw:RadioButton:TP_OPTPRINT_PAGE:RB_PAGEEND"; Pos = MAP_APPFONT ( 180 , 53 ) ; Size = MAP_APPFONT ( 74 , 10 ) ; Text [ en-US ] = "~End of page" ; @@ -365,6 +400,7 @@ TabPage TP_OPTPRINT_PAGE }; CheckBox CB_PRINTEMPTYPAGES { + HelpID = "sw:CheckBox:TP_OPTPRINT_PAGE:CB_PRINTEMPTYPAGES"; Pos = MAP_APPFONT ( 12 , 106 ) ; Size = MAP_APPFONT ( 200 , 10 ) ; TabStop = TRUE ; @@ -373,6 +409,7 @@ TabPage TP_OPTPRINT_PAGE /* CheckBox CB_SINGLEJOBS { + HelpID = "sw:CheckBox:TP_OPTPRINT_PAGE:CB_SINGLEJOBS"; Pos = MAP_APPFONT ( 12 , 119 ) ; Size = MAP_APPFONT ( 200 , 10 ) ; TabStop = TRUE ; @@ -381,6 +418,7 @@ TabPage TP_OPTPRINT_PAGE */ CheckBox CB_PAPERFROMSETUP { + HelpID = "sw:CheckBox:TP_OPTPRINT_PAGE:CB_PAPERFROMSETUP"; Pos = MAP_APPFONT ( 12 , 119 ) ; Size = MAP_APPFONT ( 200 , 10 ) ; TabStop = TRUE ; @@ -395,6 +433,7 @@ TabPage TP_OPTPRINT_PAGE }; ListBox LB_FAX { + HelpID = "sw:ListBox:TP_OPTPRINT_PAGE:LB_FAX"; Border = TRUE ; Pos = MAP_APPFONT ( 70 , 132 ) ; Size = MAP_APPFONT ( 184 , 70 ) ; @@ -437,6 +476,7 @@ TabPage TP_STD_FONT }; MetricBox LB_STANDARD_SIZE { + HelpID = "sw:MetricBox:TP_STD_FONT:LB_STANDARD_SIZE"; Pos = MAP_APPFONT ( 204 , 25 ) ; Size = MAP_APPFONT ( 30 , 60 ) ; Border = TRUE ; @@ -444,6 +484,7 @@ TabPage TP_STD_FONT }; MetricBox LB_TITLE_SIZE { + HelpID = "sw:MetricBox:TP_STD_FONT:LB_TITLE_SIZE"; Pos = MAP_APPFONT ( 204 , 42 ) ; Size = MAP_APPFONT ( 30 , 60 ) ; Border = TRUE ; @@ -451,6 +492,7 @@ TabPage TP_STD_FONT }; MetricBox LB_LIST_SIZE { + HelpID = "sw:MetricBox:TP_STD_FONT:LB_LIST_SIZE"; Pos = MAP_APPFONT ( 204 , 59 ) ; Size = MAP_APPFONT ( 30 , 60 ) ; Border = TRUE ; @@ -458,6 +500,7 @@ TabPage TP_STD_FONT }; MetricBox LB_LABEL_SIZE { + HelpID = "sw:MetricBox:TP_STD_FONT:LB_LABEL_SIZE"; Pos = MAP_APPFONT ( 204 , 76 ) ; Size = MAP_APPFONT ( 30 , 60 ) ; Border = TRUE ; @@ -465,6 +508,7 @@ TabPage TP_STD_FONT }; MetricBox LB_INDEX_SIZE { + HelpID = "sw:MetricBox:TP_STD_FONT:LB_INDEX_SIZE"; Pos = MAP_APPFONT ( 204 , 93 ) ; Size = MAP_APPFONT ( 30 , 60 ) ; Border = TRUE ; @@ -507,6 +551,7 @@ TabPage TP_STD_FONT }; ComboBox LB_STANDARD { + HelpID = "sw:ComboBox:TP_STD_FONT:LB_STANDARD"; Pos = MAP_APPFONT ( 63 , 25 ) ; Size = MAP_APPFONT ( 135 , 73 ) ; TabStop = TRUE ; @@ -515,6 +560,7 @@ TabPage TP_STD_FONT }; ComboBox LB_TITLE { + HelpID = "sw:ComboBox:TP_STD_FONT:LB_TITLE"; Pos = MAP_APPFONT ( 63 , 42 ) ; Size = MAP_APPFONT ( 135, 73 ) ; TabStop = TRUE ; @@ -523,6 +569,7 @@ TabPage TP_STD_FONT }; ComboBox LB_LIST { + HelpID = "sw:ComboBox:TP_STD_FONT:LB_LIST"; Pos = MAP_APPFONT ( 63 , 59 ) ; Size = MAP_APPFONT ( 135 , 73 ) ; TabStop = TRUE ; @@ -531,6 +578,7 @@ TabPage TP_STD_FONT }; ComboBox LB_LABEL { + HelpID = "sw:ComboBox:TP_STD_FONT:LB_LABEL"; Pos = MAP_APPFONT ( 63 , 76 ) ; Size = MAP_APPFONT ( 135 , 73 ) ; TabStop = TRUE ; @@ -539,6 +587,7 @@ TabPage TP_STD_FONT }; ComboBox LB_IDX { + HelpID = "sw:ComboBox:TP_STD_FONT:LB_IDX"; Pos = MAP_APPFONT ( 63 , 94 ) ; Size = MAP_APPFONT ( 135, 73 ) ; TabStop = TRUE ; @@ -547,12 +596,14 @@ TabPage TP_STD_FONT }; CheckBox CB_DOCONLY { + HelpID = "sw:CheckBox:TP_STD_FONT:CB_DOCONLY"; Pos = MAP_APPFONT ( 12 , 111 ) ; Size = MAP_APPFONT ( 147 , 10 ) ; Text [ en-US ] = "C~urrent document only" ; }; PushButton PB_STANDARD { + HelpID = "sw:PushButton:TP_STD_FONT:PB_STANDARD"; Pos = MAP_APPFONT ( 204 , 165 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Default" ; @@ -588,6 +639,7 @@ TabPage TP_OPTTABLE_PAGE }; CheckBox CB_HEADER { + HelpID = "sw:CheckBox:TP_OPTTABLE_PAGE:CB_HEADER"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 107 , 10 ) ; TabStop = TRUE ; @@ -595,6 +647,7 @@ TabPage TP_OPTTABLE_PAGE }; CheckBox CB_REPEAT_HEADER { + HelpID = "sw:CheckBox:TP_OPTTABLE_PAGE:CB_REPEAT_HEADER"; Pos = MAP_APPFONT ( 21 , 27 ) ; Size = MAP_APPFONT ( 99 , 10 ) ; TabStop = TRUE ; @@ -602,6 +655,7 @@ TabPage TP_OPTTABLE_PAGE }; CheckBox CB_DONT_SPLIT { + HelpID = "sw:CheckBox:TP_OPTTABLE_PAGE:CB_DONT_SPLIT"; Pos = MAP_APPFONT ( 12 , 40 ) ; Size = MAP_APPFONT ( 107 , 10 ) ; TabStop = TRUE ; @@ -609,6 +663,7 @@ TabPage TP_OPTTABLE_PAGE }; CheckBox CB_BORDER { + HelpID = "sw:CheckBox:TP_OPTTABLE_PAGE:CB_BORDER"; Pos = MAP_APPFONT ( 12 , 53 ) ; Size = MAP_APPFONT ( 107 , 10 ) ; TabStop = TRUE ; @@ -628,6 +683,7 @@ TabPage TP_OPTTABLE_PAGE }; CheckBox CB_NUMFORMATTING { + HelpID = "sw:CheckBox:TP_OPTTABLE_PAGE:CB_NUMFORMATTING"; Pos = MAP_APPFONT ( 131 , 14 ) ; Size = MAP_APPFONT ( 118 , 10 ) ; TabStop = TRUE ; @@ -635,6 +691,7 @@ TabPage TP_OPTTABLE_PAGE }; CheckBox CB_NUMFMT_FORMATTING { + HelpID = "sw:CheckBox:TP_OPTTABLE_PAGE:CB_NUMFMT_FORMATTING"; Pos = MAP_APPFONT ( 140 , 27 ) ; Size = MAP_APPFONT ( 114 , 10 ) ; TabStop = TRUE ; @@ -642,6 +699,7 @@ TabPage TP_OPTTABLE_PAGE }; CheckBox CB_NUMALIGNMENT { + HelpID = "sw:CheckBox:TP_OPTTABLE_PAGE:CB_NUMALIGNMENT"; Pos = MAP_APPFONT ( 140 , 40 ) ; Size = MAP_APPFONT ( 114 , 10 ) ; TabStop = TRUE ; @@ -667,6 +725,7 @@ TabPage TP_OPTTABLE_PAGE }; MetricField MF_ROWMOVE { + HelpID = "sw:MetricField:TP_OPTTABLE_PAGE:MF_ROWMOVE"; Border = TRUE ; Pos = MAP_APPFONT ( 83 , 91 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -689,6 +748,7 @@ TabPage TP_OPTTABLE_PAGE }; MetricField MF_COLMOVE { + HelpID = "sw:MetricField:TP_OPTTABLE_PAGE:MF_COLMOVE"; Border = TRUE ; Pos = MAP_APPFONT ( 83 , 106 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -717,6 +777,7 @@ TabPage TP_OPTTABLE_PAGE }; MetricField MF_ROWINSERT { + HelpID = "sw:MetricField:TP_OPTTABLE_PAGE:MF_ROWINSERT"; Border = TRUE ; Pos = MAP_APPFONT ( 211 , 91 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -739,6 +800,7 @@ TabPage TP_OPTTABLE_PAGE }; MetricField MF_COLINSERT { + HelpID = "sw:MetricField:TP_OPTTABLE_PAGE:MF_COLINSERT"; Border = TRUE ; Pos = MAP_APPFONT ( 211 , 106 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -761,6 +823,7 @@ TabPage TP_OPTTABLE_PAGE }; RadioButton RB_FIX { + HelpID = "sw:RadioButton:TP_OPTTABLE_PAGE:RB_FIX"; Pos = MAP_APPFONT ( 21 , 133 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "~Fixed" ; @@ -774,6 +837,7 @@ TabPage TP_OPTTABLE_PAGE }; RadioButton RB_FIXPROP { + HelpID = "sw:RadioButton:TP_OPTTABLE_PAGE:RB_FIXPROP"; Pos = MAP_APPFONT ( 21 , 151 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "Fi~xed, proportional" ; @@ -787,6 +851,7 @@ TabPage TP_OPTTABLE_PAGE }; RadioButton RB_VAR { + HelpID = "sw:RadioButton:TP_OPTTABLE_PAGE:RB_VAR"; Pos = MAP_APPFONT ( 21 , 169 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "~Variable" ; @@ -820,6 +885,7 @@ TabPage TP_OPTSHDWCRSR }; CheckBox CB_PARA { + HelpID = "sw:CheckBox:TP_OPTSHDWCRSR:CB_PARA"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; Text [ en-US ] = "Pa~ragraph end" ; @@ -828,48 +894,56 @@ TabPage TP_OPTSHDWCRSR }; CheckBox CB_SHYPH { + HelpID = "sw:CheckBox:TP_OPTSHDWCRSR:CB_SHYPH"; Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; Text [ en-US ] = "Custom h~yphens" ; }; CheckBox CB_SPACE { + HelpID = "sw:CheckBox:TP_OPTSHDWCRSR:CB_SPACE"; Pos = MAP_APPFONT ( 12 , 40 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; Text [ en-US ] = "Spac~es" ; }; CheckBox CB_HSPACE { + HelpID = "sw:CheckBox:TP_OPTSHDWCRSR:CB_HSPACE"; Pos = MAP_APPFONT ( 12 , 53 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; Text [ en-US ] = "Non-breaking s~paces" ; }; CheckBox CB_TAB { + HelpID = "sw:CheckBox:TP_OPTSHDWCRSR:CB_TAB"; Pos = MAP_APPFONT ( 12 , 66 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; Text [ en-US ] = "Ta~bs" ; }; CheckBox CB_BREAK { + HelpID = "sw:CheckBox:TP_OPTSHDWCRSR:CB_BREAK"; Pos = MAP_APPFONT ( 12 , 79 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; Text [ en-US ] = "Brea~ks" ; }; CheckBox CB_CHAR_HIDDEN { + HelpID = "sw:CheckBox:TP_OPTSHDWCRSR:CB_CHAR_HIDDEN"; Pos = MAP_APPFONT ( 12 , 92 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; Text [ en-US ] = "Hidden text" ; }; CheckBox CB_FLD_HIDDEN { + HelpID = "sw:CheckBox:TP_OPTSHDWCRSR:CB_FLD_HIDDEN"; Pos = MAP_APPFONT ( 12 , 105 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; Text [ en-US ] = "Fields: Hidden te~xt" ; }; CheckBox CB_FLD_HIDDEN_PARA { + HelpID = "sw:CheckBox:TP_OPTSHDWCRSR:CB_FLD_HIDDEN_PARA"; Pos = MAP_APPFONT ( 12 , 118 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; Text [ en-US ] = "Fields: Hidden p~aragraphs" ; @@ -888,6 +962,7 @@ TabPage TP_OPTSHDWCRSR }; CheckBox CB_SHDWCRSONOFF { + HelpID = "sw:CheckBox:TP_OPTSHDWCRSR:CB_SHDWCRSONOFF"; Pos = MAP_APPFONT ( 136 , 14 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; TabStop = TRUE ; @@ -903,6 +978,7 @@ TabPage TP_OPTSHDWCRSR }; RadioButton RB_SHDWCRSFILLMARGIN { + HelpID = "sw:RadioButton:TP_OPTSHDWCRSR:RB_SHDWCRSFILLMARGIN"; Pos = MAP_APPFONT ( 145 , 39 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; TabStop = TRUE ; @@ -911,18 +987,21 @@ TabPage TP_OPTSHDWCRSR }; RadioButton RB_SHDWCRSFILLINDENT { + HelpID = "sw:RadioButton:TP_OPTSHDWCRSR:RB_SHDWCRSFILLINDENT"; Pos = MAP_APPFONT ( 145 , 52 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; Text [ en-US ] = "~Left paragraph margin" ; }; RadioButton RB_SHDWCRSFILLTAB { + HelpID = "sw:RadioButton:TP_OPTSHDWCRSR:RB_SHDWCRSFILLTAB"; Pos = MAP_APPFONT ( 145 , 66 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; Text [ en-US ] = "~Tabs" ; }; RadioButton RB_SHDWCRSFILLSPACE { + HelpID = "sw:RadioButton:TP_OPTSHDWCRSR:RB_SHDWCRSFILLSPACE"; Pos = MAP_APPFONT ( 145 , 79 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; Text [ en-US ] = "Tabs a~nd spaces" ; @@ -935,12 +1014,25 @@ TabPage TP_OPTSHDWCRSR }; CheckBox CB_ALLOW_IN_PROT { + HelpID = "sw:CheckBox:TP_OPTSHDWCRSR:CB_ALLOW_IN_PROT"; Pos = MAP_APPFONT ( 136 , 107 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; TabStop = TRUE ; Group = TRUE ; Text [ en-US ] = "Enable"; }; + FixedLine FL_LAYOUT_OPTIONS + { + Pos = MAP_APPFONT ( 6 , 133 ) ; + Size = MAP_APPFONT ( 118 , 8 ) ; + Text [ en-US ] = "Layout assistance"; + }; + CheckBox CB_MATH_BASELINE_ALIGNMENT + { + Pos = MAP_APPFONT ( 12 , 144 ) ; + Size = MAP_APPFONT ( 236 , 10 ) ; + Text [ en-US ] = "Math baseline alignment"; + }; }; diff --git a/sw/source/ui/config/optload.src b/sw/source/ui/config/optload.src index 618c0db35b..9fad441773 100644 --- a/sw/source/ui/config/optload.src +++ b/sw/source/ui/config/optload.src @@ -53,6 +53,7 @@ TabPage TP_OPTLOAD_PAGE }; RadioButton RB_ALWAYS { + HelpID = "sw:RadioButton:TP_OPTLOAD_PAGE:RB_ALWAYS"; Pos = MAP_APPFONT ( 18 , 26 ) ; Size = MAP_APPFONT ( 75 , 10 ) ; TabStop = TRUE ; @@ -60,6 +61,7 @@ TabPage TP_OPTLOAD_PAGE }; RadioButton RB_REQUEST { + HelpID = "sw:RadioButton:TP_OPTLOAD_PAGE:RB_REQUEST"; Pos = MAP_APPFONT ( 18 , 39 ) ; Size = MAP_APPFONT ( 75 , 10 ) ; TabStop = TRUE ; @@ -67,6 +69,7 @@ TabPage TP_OPTLOAD_PAGE }; RadioButton RB_NEVER { + HelpID = "sw:RadioButton:TP_OPTLOAD_PAGE:RB_NEVER"; Pos = MAP_APPFONT ( 18 , 52 ) ; Size = MAP_APPFONT ( 75 , 10 ) ; TabStop = TRUE ; @@ -80,12 +83,14 @@ TabPage TP_OPTLOAD_PAGE }; CheckBox CB_AUTO_UPDATE_FIELDS { + HelpID = "sw:CheckBox:TP_OPTLOAD_PAGE:CB_AUTO_UPDATE_FIELDS"; Pos = MAP_APPFONT ( 136 , 26) ; Size = MAP_APPFONT ( 118 , 10 ) ; Text [ en-US ] = "~Fields"; }; CheckBox CB_AUTO_UPDATE_CHARTS { + HelpID = "sw:CheckBox:TP_OPTLOAD_PAGE:CB_AUTO_UPDATE_CHARTS"; Pos = MAP_APPFONT ( 136 , 39) ; Size = MAP_APPFONT ( 109 , 10 ) ; Text [ en-US ] = "~Charts"; @@ -104,6 +109,7 @@ TabPage TP_OPTLOAD_PAGE }; ListBox LB_METRIC { + HelpID = "sw:ListBox:TP_OPTLOAD_PAGE:LB_METRIC"; Pos = MAP_APPFONT ( 130, 77 ) ; Size = MAP_APPFONT ( 50 , 50 ) ; Border = TRUE ; @@ -118,6 +124,7 @@ TabPage TP_OPTLOAD_PAGE }; MetricField MF_TAB { + HelpID = "sw:MetricField:TP_OPTLOAD_PAGE:MF_TAB"; Border = TRUE ; Pos = MAP_APPFONT ( 130 , 93 ) ; Size = MAP_APPFONT ( 50 , 12 ) ; @@ -134,6 +141,7 @@ TabPage TP_OPTLOAD_PAGE }; CheckBox CB_USE_SQUARE_PAGE_MODE { + HelpID = "sw:CheckBox:TP_OPTLOAD_PAGE:CB_USE_SQUARE_PAGE_MODE"; Pos = MAP_APPFONT ( 12 , 111) ; Size = MAP_APPFONT ( 248 , 10 ) ; Text [ en-US ] = "Use square page mode for text grid"; @@ -173,6 +181,7 @@ TabPage TP_OPTCAPTION_PAGE }; ListBox LB_ORDER { + HelpID = "sw:ListBox:TP_OPTCAPTION_PAGE:LB_ORDER"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 141 ) ; Size = MAP_APPFONT ( 106 , 60 ) ; @@ -222,6 +231,7 @@ TabPage TP_OPTCAPTION_PAGE }; ComboBox BOX_CATEGORY { + HelpID = "sw:ComboBox:TP_OPTCAPTION_PAGE:BOX_CATEGORY"; Pos = MAP_APPFONT ( 189 , 14 ) ; Size = MAP_APPFONT ( 59 , 61 ) ; DropDown = TRUE ; @@ -237,6 +247,7 @@ TabPage TP_OPTCAPTION_PAGE }; ListBox BOX_FORMAT { + HelpID = "sw:ListBox:TP_OPTCAPTION_PAGE:BOX_FORMAT"; Border = TRUE ; Pos = MAP_APPFONT ( 189 , 29 ) ; Size = MAP_APPFONT ( 59 , 61 ) ; @@ -252,6 +263,7 @@ TabPage TP_OPTCAPTION_PAGE }; Edit ED_NUM_SEP { + HelpID = "sw:Edit:TP_OPTCAPTION_PAGE:ED_NUM_SEP"; Pos = MAP_APPFONT ( 189 , 44 ) ; Size = MAP_APPFONT ( 59 , 12 ) ; Border = TRUE ; @@ -268,6 +280,7 @@ TabPage TP_OPTCAPTION_PAGE }; Edit EDT_TEXT { + HelpID = "sw:Edit:TP_OPTCAPTION_PAGE:EDT_TEXT"; Pos = MAP_APPFONT ( 189 , 59 ) ; Size = MAP_APPFONT ( 59 , 12 ) ; Border = TRUE ; @@ -283,6 +296,7 @@ TabPage TP_OPTCAPTION_PAGE }; ListBox BOX_POS { + HelpID = "sw:ListBox:TP_OPTCAPTION_PAGE:BOX_POS"; Pos = MAP_APPFONT ( 189 , 74 ) ; Size = MAP_APPFONT ( 59 , 61 ) ; DropDown = TRUE ; @@ -304,6 +318,7 @@ TabPage TP_OPTCAPTION_PAGE }; ListBox LB_LEVEL { + HelpID = "sw:ListBox:TP_OPTCAPTION_PAGE:LB_LEVEL"; Border = TRUE ; Pos = MAP_APPFONT ( 189 , 100 ) ; Size = MAP_APPFONT ( 59 , 60 ) ; @@ -322,6 +337,7 @@ TabPage TP_OPTCAPTION_PAGE }; Edit ED_SEPARATOR { + HelpID = "sw:Edit:TP_OPTCAPTION_PAGE:ED_SEPARATOR"; Pos = MAP_APPFONT ( 189 , 115 ) ; Size = MAP_APPFONT ( 59 , 12 ) ; Border = TRUE ; @@ -342,6 +358,7 @@ TabPage TP_OPTCAPTION_PAGE }; ListBox LB_CHARSTYLE { + HelpID = "sw:ListBox:TP_OPTCAPTION_PAGE:LB_CHARSTYLE"; Border = TRUE ; Pos = MAP_APPFONT ( 189 , 141 ) ; Size = MAP_APPFONT ( 59 , 60 ) ; @@ -354,6 +371,7 @@ TabPage TP_OPTCAPTION_PAGE }; CheckBox CB_APPLYBORDER { + HelpID = "sw:CheckBox:TP_OPTCAPTION_PAGE:CB_APPLYBORDER"; Pos = MAP_APPFONT ( 125 , 158 ) ; Size = MAP_APPFONT ( 124 , 10 ) ; Text [ en-US ] = "Apply border and shadow" ; diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 8d3943834c..126cc68852 100755..100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -27,79 +27,62 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #ifdef SW_DLLIMPLEMENTATION #undef SW_DLLIMPLEMENTATION #endif - -#include <hintids.hxx> -#ifndef _CMDID_H -#include <cmdid.h> -#endif -#include <vcl/svapp.hxx> #ifndef _SVSTDARR_HXX #define _SVSTDARR_STRINGSDTOR #include <svl/svstdarr.hxx> #endif -#include <svl/cjkoptions.hxx> -#include <svtools/ctrltool.hxx> -#include <svl/eitem.hxx> -#include <svx/htmlmode.hxx> -#include <sfx2/printer.hxx> -#include <sfx2/bindings.hxx> -#include <svx/xtable.hxx> -#include <editeng/fhgtitem.hxx> -#include <editeng/fontitem.hxx> -#include <editeng/langitem.hxx> -#include <svx/dlgutil.hxx> + +#include <optpage.hxx> +#include <doc.hxx> +#include <hintids.hxx> +#include <cmdid.h> #include <fmtcol.hxx> #include <charatr.hxx> #include <swtypes.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif -#ifndef IDOCUMENTDEVICEACCESS_HXX_INCLUDED #include <IDocumentDeviceAccess.hxx> -#endif #include <swmodule.hxx> #include <wrtsh.hxx> #include <uitool.hxx> -#include <cfgitems.hxx> //Items fuer Sw-Seiten +#include <cfgitems.hxx> #include <poolfmt.hxx> #include <uiitems.hxx> #include <initui.hxx> -#include <optpage.hxx> -#include <swprtopt.hxx> -#ifndef _MODCFG_HXX +#include <printdata.hxx> #include <modcfg.hxx> -#endif -#ifndef _SRCVIEW_HXX #include <srcview.hxx> -#endif #include <crstate.hxx> #include <viewopt.hxx> -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif -#ifndef _CONFIG_HRC #include <config.hrc> -#endif -#ifndef _REDLOPT_HRC #include <redlopt.hrc> -#endif -#ifndef _OPTDLG_HRC #include <optdlg.hrc> -#endif -#include <svx/strarray.hxx> -#include <svl/slstitm.hxx> -#include <sfx2/request.hxx> #include <swwrtshitem.hxx> +#include <unomid.h> + +#include <editeng/fhgtitem.hxx> +#include <editeng/fontitem.hxx> +#include <editeng/langitem.hxx> +#include <sfx2/request.hxx> +#include <sfx2/printer.hxx> +#include <sfx2/bindings.hxx> +#include <svl/slstitm.hxx> #include <svl/ctloptions.hxx> +#include <svl/eitem.hxx> +#include <svl/cjkoptions.hxx> +#include <svtools/ctrltool.hxx> +#include <svx/htmlmode.hxx> +#include <svx/xtable.hxx> +#include <svx/dlgutil.hxx> +#include <svx/strarray.hxx> +#include <vcl/svapp.hxx> -#include <unomid.h> using namespace ::com::sun::star; @@ -1510,6 +1493,7 @@ IMPL_LINK(SwTableOptionsTabPage, CheckBoxHdl, CheckBox*, EMPTYARG) aRepeatHeaderCB.Enable(aHeaderCB.IsChecked()); return 0; } + void SwTableOptionsTabPage::PageCreated (SfxAllItemSet aSet) { SFX_ITEMSET_ARG (&aSet,pWrtSh,SwWrtShellItem,SID_WRT_SHELL,sal_False); @@ -1547,15 +1531,17 @@ SwShdwCrsrOptionsTabPage::SwShdwCrsrOptionsTabPage( Window* pParent, aFillTabRB( this, SW_RES( RB_SHDWCRSFILLTAB )), aFillSpaceRB( this, SW_RES( RB_SHDWCRSFILLSPACE )), aCrsrOptFL ( this, SW_RES( FL_CRSR_OPT)), - aCrsrInProtCB( this, SW_RES( CB_ALLOW_IN_PROT )) + aCrsrInProtCB( this, SW_RES( CB_ALLOW_IN_PROT )), + m_aLayoutOptionsFL( this, SW_RES( FL_LAYOUT_OPTIONS ) ), + m_aMathBaselineAlignmentCB( this, SW_RES( CB_MATH_BASELINE_ALIGNMENT ) ), + m_pWrtShell( NULL ) { FreeResource(); const SfxPoolItem* pItem = 0; - SwShadowCursorItem aOpt; + SwShadowCursorItem aOpt; if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, FALSE, &pItem )) aOpt = *(SwShadowCursorItem*)pItem; - aOnOffCB.Check( aOpt.IsOn() ); BYTE eMode = aOpt.GetMode(); @@ -1600,6 +1586,15 @@ SfxTabPage* SwShdwCrsrOptionsTabPage::Create( Window* pParent, const SfxItemSet& return new SwShdwCrsrOptionsTabPage( pParent, rSet ); } + +void SwShdwCrsrOptionsTabPage::PageCreated( SfxAllItemSet aSet ) +{ + SFX_ITEMSET_ARG (&aSet,pWrtSh,SwWrtShellItem,SID_WRT_SHELL,sal_False); + if (pWrtSh) + SetWrtShell(pWrtSh->GetValue()); +} + + BOOL SwShdwCrsrOptionsTabPage::FillItemSet( SfxItemSet& rSet ) { SwShadowCursorItem aOpt; @@ -1625,6 +1620,10 @@ BOOL SwShdwCrsrOptionsTabPage::FillItemSet( SfxItemSet& rSet ) bRet = TRUE; } + m_pWrtShell->GetDoc()->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT, + m_aMathBaselineAlignmentCB.IsChecked() ); + bRet |= m_aMathBaselineAlignmentCB.IsChecked() != m_aMathBaselineAlignmentCB.GetSavedValue(); + if( aCrsrInProtCB.IsChecked() != aCrsrInProtCB.GetSavedValue()) { rSet.Put(SfxBoolItem(FN_PARAM_CRSR_IN_PROTECTED, aCrsrInProtCB.IsChecked())); @@ -1658,11 +1657,10 @@ BOOL SwShdwCrsrOptionsTabPage::FillItemSet( SfxItemSet& rSet ) void SwShdwCrsrOptionsTabPage::Reset( const SfxItemSet& rSet ) { const SfxPoolItem* pItem = 0; - SwShadowCursorItem aOpt; + SwShadowCursorItem aOpt; if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, FALSE, &pItem )) aOpt = *(SwShadowCursorItem*)pItem; - aOnOffCB.Check( aOpt.IsOn() ); BYTE eMode = aOpt.GetMode(); @@ -1671,6 +1669,9 @@ void SwShdwCrsrOptionsTabPage::Reset( const SfxItemSet& rSet ) aFillTabRB.Check( FILL_TAB == eMode ); aFillSpaceRB.Check( FILL_SPACE == eMode ); + m_aMathBaselineAlignmentCB.Check( m_pWrtShell->GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) ); + m_aMathBaselineAlignmentCB.SaveValue(); + if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_CRSR_IN_PROTECTED, FALSE, &pItem )) aCrsrInProtCB.Check(((const SfxBoolItem*)pItem)->GetValue()); aCrsrInProtCB.SaveValue(); @@ -2615,4 +2616,3 @@ IMPL_LINK_INLINE_END( SwTestTabPage, AutoClickHdl, CheckBox *, EMPTYARG ) #endif - diff --git a/sw/source/ui/config/prtopt.cxx b/sw/source/ui/config/prtopt.cxx index b6631686df..188db077cf 100644 --- a/sw/source/ui/config/prtopt.cxx +++ b/sw/source/ui/config/prtopt.cxx @@ -28,16 +28,15 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include <unotools/configmgr.hxx> #include <prtopt.hxx> -#include <swprtopt.hxx> #include <tools/debug.hxx> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <unomid.h> + using namespace utl; using rtl::OUString; using namespace com::sun::star::uno; diff --git a/sw/source/ui/config/redlopt.src b/sw/source/ui/config/redlopt.src index 2d5da19772..35211f60a7 100644 --- a/sw/source/ui/config/redlopt.src +++ b/sw/source/ui/config/redlopt.src @@ -65,6 +65,7 @@ TabPage TP_REDLINE_OPT }; ListBox LB_INS_ATTR { + HelpID = "sw:ListBox:TP_REDLINE_OPT:LB_INS_ATTR"; Pos = MAP_APPFONT ( 90 , 25 ) ; Size = MAP_APPFONT ( 80 , 80 ) ; TabStop = TRUE ; @@ -92,6 +93,7 @@ TabPage TP_REDLINE_OPT }; ListBox LB_INS_COL { + HelpID = "sw:ListBox:TP_REDLINE_OPT:LB_INS_COL"; Pos = MAP_APPFONT ( 90 , 40 ) ; Size = MAP_APPFONT ( 80 , 80 ) ; TabStop = TRUE ; @@ -118,6 +120,7 @@ TabPage TP_REDLINE_OPT }; ListBox LB_DEL_ATTR { + HelpID = "sw:ListBox:TP_REDLINE_OPT:LB_DEL_ATTR"; Pos = MAP_APPFONT ( 90 , 67 ) ; Size = MAP_APPFONT ( 80 , 80 ) ; TabStop = TRUE ; @@ -131,6 +134,7 @@ TabPage TP_REDLINE_OPT }; ListBox LB_DEL_COL { + HelpID = "sw:ListBox:TP_REDLINE_OPT:LB_DEL_COL"; Pos = MAP_APPFONT ( 90 , 82 ) ; Size = MAP_APPFONT ( 80 , 80 ) ; TabStop = TRUE ; @@ -157,6 +161,7 @@ TabPage TP_REDLINE_OPT }; ListBox LB_CHG_ATTR { + HelpID = "sw:ListBox:TP_REDLINE_OPT:LB_CHG_ATTR"; Pos = MAP_APPFONT ( 90 , 111 ) ; Size = MAP_APPFONT ( 80 , 80 ) ; TabStop = TRUE ; @@ -170,6 +175,7 @@ TabPage TP_REDLINE_OPT }; ListBox LB_CHG_COL { + HelpID = "sw:ListBox:TP_REDLINE_OPT:LB_CHG_COL"; Pos = MAP_APPFONT ( 90 , 126 ) ; Size = MAP_APPFONT ( 80 , 80 ) ; TabStop = TRUE ; @@ -196,6 +202,7 @@ TabPage TP_REDLINE_OPT }; ListBox LB_MARKPOS { + HelpID = "sw:ListBox:TP_REDLINE_OPT:LB_MARKPOS"; Pos = MAP_APPFONT ( 90 , 155 ) ; Size = MAP_APPFONT ( 80 , 80 ) ; TabStop = TRUE ; @@ -217,6 +224,7 @@ TabPage TP_REDLINE_OPT }; ListBox LB_LC_COL { + HelpID = "sw:ListBox:TP_REDLINE_OPT:LB_LC_COL"; Pos = MAP_APPFONT ( 90 , 170 ) ; Size = MAP_APPFONT ( 80 , 80 ) ; TabStop = TRUE ; diff --git a/sw/source/ui/config/usrpref.cxx b/sw/source/ui/config/usrpref.cxx index 2571361b6d..46cd317ed1 100644 --- a/sw/source/ui/config/usrpref.cxx +++ b/sw/source/ui/config/usrpref.cxx @@ -245,27 +245,29 @@ Sequence<OUString> SwLayoutViewConfig::GetPropertyNames() { static const char* aPropNames[] = { - "Line/Guide", // 0 - "Line/SimpleControlPoint", // 1 - "Line/LargeControlPoint", // 2 - "Window/HorizontalScroll", // 3 - "Window/VerticalScroll", // 4 - "Window/ShowRulers", // 5 - "Window/HorizontalRuler", // 6 - "Window/VerticalRuler", // 7 - "Window/HorizontalRulerUnit", // 8 - "Window/VerticalRulerUnit", // 9 - "Window/SmoothScroll", //10 - "Zoom/Value", //11 - "Zoom/Type", //12 - "Other/MeasureUnit", //13 - "Other/TabStop", //14 - "Window/IsVerticalRulerRight", //15 - "ViewLayout/Columns", //16 - "ViewLayout/BookMode", //17 - "Other/IsSquaredPageMode" //18 + "Line/Guide", // 0 + "Line/SimpleControlPoint", // 1 + "Line/LargeControlPoint", // 2 + "Window/HorizontalScroll", // 3 + "Window/VerticalScroll", // 4 + "Window/ShowRulers", // 5 + "Window/HorizontalRuler", // 6 + "Window/VerticalRuler", // 7 + "Window/HorizontalRulerUnit", // 8 + "Window/VerticalRulerUnit", // 9 + "Window/SmoothScroll", //10 + "Zoom/Value", //11 + "Zoom/Type", //12 + "Other/IsAlignMathObjectsToBaseline", //13 + "Other/MeasureUnit", //14 + // below properties are not available in WriterWeb + "Other/TabStop", //15 + "Window/IsVerticalRulerRight", //16 + "ViewLayout/Columns", //17 + "ViewLayout/BookMode", //18 + "Other/IsSquaredPageMode" //19 }; - const int nCount = bWeb ? 14 : 19; + const int nCount = bWeb ? 15 : 20; Sequence<OUString> aNames(nCount); OUString* pNames = aNames.getArray(); for(int i = 0; i < nCount; i++) @@ -302,39 +304,38 @@ void SwLayoutViewConfig::Commit() for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - sal_Bool bSet; + Any &rVal = pValues[nProp]; switch(nProp) { - case 0: bSet = rParent.IsCrossHair(); break;// "Line/Guide", - case 1: bSet = rParent.IsSolidMarkHdl(); break;// "Line/SimpleControlPoint", - case 2: bSet = rParent.IsBigMarkHdl(); break;// "Line/LargeControlPoint", - case 3: bSet = rParent.IsViewHScrollBar(); break;// "Window/HorizontalScroll", - case 4: bSet = rParent.IsViewVScrollBar(); break;// "Window/VerticalScroll", - case 5: bSet = rParent.IsViewAnyRuler(); break; // "Window/ShowRulers" + case 0: rVal <<= (sal_Bool) rParent.IsCrossHair(); break; // "Line/Guide", + case 1: rVal <<= (sal_Bool) rParent.IsSolidMarkHdl(); break; // "Line/SimpleControlPoint", + case 2: rVal <<= (sal_Bool) rParent.IsBigMarkHdl(); break; // "Line/LargeControlPoint", + case 3: rVal <<= (sal_Bool) rParent.IsViewHScrollBar(); break; // "Window/HorizontalScroll", + case 4: rVal <<= (sal_Bool) rParent.IsViewVScrollBar(); break; // "Window/VerticalScroll", + case 5: rVal <<= (sal_Bool) rParent.IsViewAnyRuler(); break; // "Window/ShowRulers" // #i14593# use IsView*Ruler(TRUE) instead of IsView*Ruler() // this preserves the single ruler states even if "Window/ShowRulers" is off - case 6: bSet = rParent.IsViewHRuler(TRUE); break;// "Window/HorizontalRuler", - case 7: bSet = rParent.IsViewVRuler(TRUE); break;// "Window/VerticalRuler", + case 6: rVal <<= (sal_Bool) rParent.IsViewHRuler(TRUE); break; // "Window/HorizontalRuler", + case 7: rVal <<= (sal_Bool) rParent.IsViewVRuler(TRUE); break; // "Window/VerticalRuler", case 8: if(rParent.bIsHScrollMetricSet) - pValues[nProp] <<= (sal_Int32)rParent.eHScrollMetric; // "Window/HorizontalRulerUnit" + rVal <<= (sal_Int32)rParent.eHScrollMetric; // "Window/HorizontalRulerUnit" break; case 9: if(rParent.bIsVScrollMetricSet) - pValues[nProp] <<= (sal_Int32)rParent.eVScrollMetric; // "Window/VerticalRulerUnit" + rVal <<= (sal_Int32)rParent.eVScrollMetric; // "Window/VerticalRulerUnit" break; - case 10: bSet = rParent.IsSmoothScroll(); break;// "Window/SmoothScroll", - case 11: pValues[nProp] <<= (sal_Int32)rParent.GetZoom(); break;// "Zoom/Value", - case 12: pValues[nProp] <<= (sal_Int32)rParent.GetZoomType(); break;// "Zoom/Type", - case 13: pValues[nProp] <<= (sal_Int32)rParent.GetMetric(); break;// "Other/MeasureUnit", - case 14: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(rParent.GetDefTab())); break;// "Other/TabStop", - case 15: bSet = rParent.IsVRulerRight(); break;// "Window/IsVerticalRulerRight", - case 16: pValues[nProp] <<= (sal_Int32)rParent.GetViewLayoutColumns(); break;// "ViewLayout/Columns", - case 17: bSet = rParent.IsViewLayoutBookMode(); break;// "ViewLayout/BookMode", - case 18: bSet = rParent.IsSquaredPageMode(); break;// "Other/IsSquaredPageMode", + case 10: rVal <<= (sal_Bool) rParent.IsSmoothScroll(); break; // "Window/SmoothScroll", + case 11: rVal <<= (sal_Int32)rParent.GetZoom(); break; // "Zoom/Value", + case 12: rVal <<= (sal_Int32)rParent.GetZoomType(); break; // "Zoom/Type", + case 13: rVal <<= (sal_Bool) rParent.IsAlignMathObjectsToBaseline(); break; // "Other/IsAlignMathObjectsToBaseline" + case 14: rVal <<= (sal_Int32)rParent.GetMetric(); break; // "Other/MeasureUnit", + case 15: rVal <<= static_cast<sal_Int32>(TWIP_TO_MM100(rParent.GetDefTab())); break;// "Other/TabStop", + case 16: rVal <<= (sal_Bool) rParent.IsVRulerRight(); break; // "Window/IsVerticalRulerRight", + case 17: rVal <<= (sal_Int32)rParent.GetViewLayoutColumns(); break; // "ViewLayout/Columns", + case 18: rVal <<= (sal_Bool) rParent.IsViewLayoutBookMode(); break; // "ViewLayout/BookMode", + case 19: rVal <<= (sal_Bool) rParent.IsSquaredPageMode(); break; // "Other/IsSquaredPageMode", } - if(nProp < 8 || nProp == 10 || nProp == 15 || nProp == 17 || nProp == 18 ) - pValues[nProp].setValue(&bSet, ::getBooleanCppuType()); } PutProperties(aNames, aValues); } @@ -353,7 +354,11 @@ void SwLayoutViewConfig::Load() { if(pValues[nProp].hasValue()) { - sal_Bool bSet = nProp < 8 || nProp == 10 || nProp == 17 || nProp == 18 ? *(sal_Bool*)pValues[nProp].getValue() : sal_False; + sal_Int32 nInt32Val = 0; + sal_Bool bSet = sal_False; + pValues[nProp] >>= nInt32Val; + pValues[nProp] >>= bSet; + switch(nProp) { case 0: rParent.SetCrossHair(bSet); break;// "Line/Guide", @@ -367,58 +372,25 @@ void SwLayoutViewConfig::Load() case 8: { rParent.bIsHScrollMetricSet = sal_True; - sal_Int32 nUnit = 0; - pValues[nProp] >>= nUnit; - rParent.eHScrollMetric = ((FieldUnit)nUnit); // "Window/HorizontalRulerUnit" + rParent.eHScrollMetric = ((FieldUnit)nInt32Val); // "Window/HorizontalRulerUnit" } break; case 9: { rParent.bIsVScrollMetricSet = sal_True; - sal_Int32 nUnit = 0; - pValues[nProp] >>= nUnit; - rParent.eVScrollMetric = ((FieldUnit)nUnit); // "Window/VerticalRulerUnit" + rParent.eVScrollMetric = ((FieldUnit)nInt32Val); // "Window/VerticalRulerUnit" } break; case 10: rParent.SetSmoothScroll(bSet); break;// "Window/SmoothScroll", - case 11: - { - sal_Int32 nVal = 0; - pValues[nProp] >>= nVal; - rParent.SetZoom( static_cast< USHORT >(nVal) ); - } - break;// "Zoom/Value", - case 12: - { - sal_Int32 nVal = 0; - pValues[nProp] >>= nVal; - rParent.SetZoomType( static_cast< SvxZoomType >(nVal) ); - } - break;// "Zoom/Type", - case 13: - { - sal_Int32 nUnit = 0; - pValues[nProp] >>= nUnit; - rParent.SetMetric((FieldUnit)nUnit, TRUE); - } - break;// "Other/MeasureUnit", - case 14: - { - sal_Int32 nTab = 0; - pValues[nProp] >>= nTab; - rParent.SetDefTab(MM100_TO_TWIP(nTab), TRUE); - } - break;// "Other/TabStop", - case 15: rParent.SetVRulerRight(bSet); break;// "Window/IsVerticalRulerRight", - case 16: - { - sal_Int32 nColumns = 0; - pValues[nProp] >>= nColumns; - rParent.SetViewLayoutColumns( static_cast<USHORT>(nColumns) ); - } - break;// "ViewLayout/Columns", - case 17: rParent.SetViewLayoutBookMode(bSet); break;// "ViewLayout/BookMode", - case 18: rParent.SetDefaultPageMode(bSet,TRUE); break;// "Other/IsSquaredPageMode", + case 11: rParent.SetZoom( static_cast< USHORT >(nInt32Val) ); break;// "Zoom/Value", + case 12: rParent.SetZoomType( static_cast< SvxZoomType >(nInt32Val) ); break;// "Zoom/Type", + case 13: rParent.SetAlignMathObjectsToBaseline(bSet); break;// "Other/IsAlignMathObjectsToBaseline" + case 14: rParent.SetMetric((FieldUnit)nInt32Val, TRUE); break;// "Other/MeasureUnit", + case 15: rParent.SetDefTab(MM100_TO_TWIP(nInt32Val), TRUE); break;// "Other/TabStop", + case 16: rParent.SetVRulerRight(bSet); break;// "Window/IsVerticalRulerRight", + case 17: rParent.SetViewLayoutColumns( static_cast<USHORT>(nInt32Val) ); break;// "ViewLayout/Columns", + case 18: rParent.SetViewLayoutBookMode(bSet); break;// "ViewLayout/BookMode", + case 19: rParent.SetDefaultPageMode(bSet,TRUE); break;// "Other/IsSquaredPageMode", } } } diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index c543cf702c..4ddc467655 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -219,7 +219,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) : m_aListLB.SetHelpId(HID_MM_ADDRESSLIST_TLB); static long nTabs[] = {2, 0, aSz.Width()/2 }; - m_aListLB.SetWindowBits( WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP ); + m_aListLB.SetStyle( m_aListLB.GetStyle() | WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP ); m_aListLB.SetSelectionMode( SINGLE_SELECTION ); m_aListLB.SetTabs(&nTabs[0], MAP_PIXEL); m_aOK.SetClickHdl( LINK( this, SwAddressListDialog, OKHdl_Impl)); diff --git a/sw/source/ui/dbui/addresslistdialog.src b/sw/source/ui/dbui/addresslistdialog.src index 64fcaf7806..a9f933ecda 100644 --- a/sw/source/ui/dbui/addresslistdialog.src +++ b/sw/source/ui/dbui/addresslistdialog.src @@ -61,30 +61,35 @@ ModalDialog DLG_MM_ADDRESSLISTDIALOG }; PushButton PB_LOADLIST { + HelpID = "sw:PushButton:DLG_MM_ADDRESSLISTDIALOG:PB_LOADLIST"; Pos = MAP_APPFONT ( 194 , 43 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "~Add..."; }; PushButton PB_CREATELIST { + HelpID = "sw:PushButton:DLG_MM_ADDRESSLISTDIALOG:PB_CREATELIST"; Pos = MAP_APPFONT ( 194 , 60 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "~Create..."; }; PushButton PB_FILTER { + HelpID = "sw:PushButton:DLG_MM_ADDRESSLISTDIALOG:PB_FILTER"; Pos = MAP_APPFONT ( 194 , 77 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "~Filter..."; }; PushButton PB_EDIT { + HelpID = "sw:PushButton:DLG_MM_ADDRESSLISTDIALOG:PB_EDIT"; Pos = MAP_APPFONT ( 194 , 94 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "~Edit..."; }; PushButton PB_TABLE { + HelpID = "sw:PushButton:DLG_MM_ADDRESSLISTDIALOG:PB_TABLE"; Pos = MAP_APPFONT ( 194 , 111 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "Change ~Table..."; diff --git a/sw/source/ui/dbui/createaddresslistdialog.src b/sw/source/ui/dbui/createaddresslistdialog.src index c1c0c1c748..dabce5ecc9 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.src +++ b/sw/source/ui/dbui/createaddresslistdialog.src @@ -70,24 +70,28 @@ ModalDialog DLG_MM_CREATEADDRESSLIST }; PushButton PB_NEW { + HelpID = "sw:PushButton:DLG_MM_CREATEADDRESSLIST:PB_NEW"; Pos = MAP_APPFONT ( 262 , 14 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~New"; }; PushButton PB_DELETE { + HelpID = "sw:PushButton:DLG_MM_CREATEADDRESSLIST:PB_DELETE"; Pos = MAP_APPFONT ( 262 , 32 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Delete"; }; PushButton PB_FIND { + HelpID = "sw:PushButton:DLG_MM_CREATEADDRESSLIST:PB_FIND"; Pos = MAP_APPFONT ( 262 , 50 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Find..."; }; PushButton PB_CUSTOMIZE { + HelpID = "sw:PushButton:DLG_MM_CREATEADDRESSLIST:PB_CUSTOMIZE"; Pos = MAP_APPFONT ( 262 , 68 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "C~ustomize..."; @@ -100,18 +104,21 @@ ModalDialog DLG_MM_CREATEADDRESSLIST }; PushButton PB_START { + HelpID = "sw:PushButton:DLG_MM_CREATEADDRESSLIST:PB_START"; Pos = MAP_APPFONT ( 100 , 180 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; Text = "|<"; }; PushButton PB_PREV { + HelpID = "sw:PushButton:DLG_MM_CREATEADDRESSLIST:PB_PREV"; Pos = MAP_APPFONT ( 123 , 180 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; Text = "<"; }; NumericField NF_SETNO { + HelpID = "sw:NumericField:DLG_MM_CREATEADDRESSLIST:NF_SETNO"; Pos = MAP_APPFONT ( 146 , 180 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; Border = TRUE; @@ -125,12 +132,14 @@ ModalDialog DLG_MM_CREATEADDRESSLIST }; PushButton PB_NEXT { + HelpID = "sw:PushButton:DLG_MM_CREATEADDRESSLIST:PB_NEXT"; Pos = MAP_APPFONT ( 169 , 180 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; Text = ">"; }; PushButton PB_END { + HelpID = "sw:PushButton:DLG_MM_CREATEADDRESSLIST:PB_END"; Pos = MAP_APPFONT ( 192 , 180 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; Text = ">|"; @@ -185,18 +194,21 @@ ModelessDialog DLG_MM_FIND_ENTRY }; Edit ED_FIND { + HelpID = "sw:Edit:DLG_MM_FIND_ENTRY:ED_FIND"; Pos = MAP_APPFONT ( 6 , 14) ; Size = MAP_APPFONT ( 120 , 12 ) ; Border = TRUE; }; CheckBox CB_FINDONLY { + HelpID = "sw:CheckBox:DLG_MM_FIND_ENTRY:CB_FINDONLY"; Pos = MAP_APPFONT ( 6 , 32 ) ; Size = MAP_APPFONT ( 120 , 10 ) ; Text [ en-US ] = "Find ~only in"; }; ListBox LB_FINDONLY { + HelpID = "sw:ListBox:DLG_MM_FIND_ENTRY:LB_FINDONLY"; Pos = MAP_APPFONT ( 12 , 45 ) ; Size = MAP_APPFONT ( 114 , 50 ) ; Border = TRUE; @@ -204,6 +216,7 @@ ModelessDialog DLG_MM_FIND_ENTRY }; PushButton PB_FIND { + HelpID = "sw:PushButton:DLG_MM_FIND_ENTRY:PB_FIND"; Pos = MAP_APPFONT ( 132 , 3 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; DefButton = TRUE; diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.src b/sw/source/ui/dbui/customizeaddresslistdialog.src index 05892d90ec..b5a6881970 100644 --- a/sw/source/ui/dbui/customizeaddresslistdialog.src +++ b/sw/source/ui/dbui/customizeaddresslistdialog.src @@ -50,30 +50,35 @@ ModalDialog DLG_MM_CUSTOMIZE_ADDRESS_LIST }; ListBox LB_FIELDS { + HelpID = "sw:ListBox:DLG_MM_CUSTOMIZE_ADDRESS_LIST:LB_FIELDS"; Pos = MAP_APPFONT ( 6 , 14 ) ; Size = MAP_APPFONT ( 112 , 120 ) ; Border = TRUE; }; PushButton PB_ADD { + HelpID = "sw:PushButton:DLG_MM_CUSTOMIZE_ADDRESS_LIST:PB_ADD"; Pos = MAP_APPFONT ( 144 , 3 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Add..."; }; PushButton PB_DELETE { + HelpID = "sw:PushButton:DLG_MM_CUSTOMIZE_ADDRESS_LIST:PB_DELETE"; Pos = MAP_APPFONT ( 144 , 20 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Delete"; }; PushButton PB_RENAME { + HelpID = "sw:PushButton:DLG_MM_CUSTOMIZE_ADDRESS_LIST:PB_RENAME"; Pos = MAP_APPFONT ( 144 , 37 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Rename..."; }; ImageButton PB_UP { + HelpID = "sw:ImageButton:DLG_MM_CUSTOMIZE_ADDRESS_LIST:PB_UP"; Pos = MAP_APPFONT ( 124 , 58 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; SYMBOL = IMAGEBUTTON_ARROW_UP; @@ -81,6 +86,7 @@ ModalDialog DLG_MM_CUSTOMIZE_ADDRESS_LIST }; ImageButton PB_DOWN { + HelpID = "sw:ImageButton:DLG_MM_CUSTOMIZE_ADDRESS_LIST:PB_DOWN"; Pos = MAP_APPFONT ( 124 , 75 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; SYMBOL = IMAGEBUTTON_ARROW_DOWN; @@ -129,6 +135,7 @@ ModalDialog DLG_MM_ADD_RENAME_ENTRY }; Edit ED_FIELDNAME { + HelpID = "sw:Edit:DLG_MM_ADD_RENAME_ENTRY:ED_FIELDNAME"; Pos = MAP_APPFONT ( 6 , 14 ) ; Size = MAP_APPFONT ( 120 , 12 ) ; Border = TRUE; diff --git a/sw/source/ui/dbui/dbinsdlg.src b/sw/source/ui/dbui/dbinsdlg.src index d08305dde1..5a3292d1d0 100644 --- a/sw/source/ui/dbui/dbinsdlg.src +++ b/sw/source/ui/dbui/dbinsdlg.src @@ -46,6 +46,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; RadioButton RB_AS_TABLE { + HelpID = "sw:RadioButton:DLG_AP_INSERT_DB_SEL:RB_AS_TABLE"; Pos = MAP_APPFONT ( 80 , 6 ) ; Size = MAP_APPFONT ( 60 , 10 ) ; TabStop = TRUE ; @@ -54,6 +55,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; RadioButton RB_AS_FIELD { + HelpID = "sw:RadioButton:DLG_AP_INSERT_DB_SEL:RB_AS_FIELD"; Pos = MAP_APPFONT ( 145 , 6 ) ; Size = MAP_APPFONT ( 60 , 10 ) ; TabStop = TRUE ; @@ -61,6 +63,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; RadioButton RB_AS_TEXT { + HelpID = "sw:RadioButton:DLG_AP_INSERT_DB_SEL:RB_AS_TEXT"; Pos = MAP_APPFONT ( 210 , 6 ) ; Size = MAP_APPFONT ( 60 , 10 ) ; TabStop = TRUE ; @@ -106,6 +109,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; RadioButton RB_DBFMT_FROM_DB { + HelpID = "sw:RadioButton:DLG_AP_INSERT_DB_SEL:RB_DBFMT_FROM_DB"; Pos = MAP_APPFONT ( 15 , 128 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; TabStop = TRUE ; @@ -114,12 +118,14 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; RadioButton RB_DBFMT_FROM_USR { + HelpID = "sw:RadioButton:DLG_AP_INSERT_DB_SEL:RB_DBFMT_FROM_USR"; Pos = MAP_APPFONT ( 15 , 143 ) ; Size = MAP_APPFONT ( 10 , 10 ) ; TabStop = TRUE ; }; ListBox LB_DBFMT_FROM_USR { + HelpID = "sw:ListBox:DLG_AP_INSERT_DB_SEL:LB_DBFMT_FROM_USR"; Border = TRUE ; Pos = MAP_APPFONT ( 30 , 142 ) ; Size = MAP_APPFONT ( 75 , 44 ) ; @@ -130,6 +136,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL /* -------------- Page Text / Fields -------------------------------- */ ListBox LB_TXT_DB_COLUMN { + HelpID = "sw:ListBox:DLG_AP_INSERT_DB_SEL:LB_TXT_DB_COLUMN"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 41 ) ; Size = MAP_APPFONT ( 93 , 70 ) ; @@ -138,6 +145,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; ImageButton IB_DBCOL_TOEDIT { + HelpID = "sw:ImageButton:DLG_AP_INSERT_DB_SEL:IB_DBCOL_TOEDIT"; Pos = MAP_APPFONT ( 111 , 41 ) ; Size = MAP_APPFONT ( 20 , 12 ) ; TabStop = TRUE ; @@ -153,6 +161,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; MultiLineEdit ED_DB_TEXT { + HelpID = "sw:MultiLineEdit:DLG_AP_INSERT_DB_SEL:ED_DB_TEXT"; Border = TRUE ; Pos = MAP_APPFONT ( 137 , 41 ) ; Size = MAP_APPFONT ( 142 , 70 ) ; @@ -172,6 +181,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; ListBox LB_DB_PARA_COLL { + HelpID = "sw:ListBox:DLG_AP_INSERT_DB_SEL:LB_DB_PARA_COLL"; Border = TRUE ; Pos = MAP_APPFONT ( 182 , 127 ) ; Size = MAP_APPFONT ( 97 , 59 ) ; @@ -183,6 +193,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL /* -------------- Page Table ---------------------------------------- */ ListBox LB_TBL_DB_COLUMN { + HelpID = "sw:ListBox:DLG_AP_INSERT_DB_SEL:LB_TBL_DB_COLUMN"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 41 ) ; Size = MAP_APPFONT ( 93 , 70 ) ; @@ -190,6 +201,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; ImageButton IB_DBCOL_ALL_TO { + HelpID = "sw:ImageButton:DLG_AP_INSERT_DB_SEL:IB_DBCOL_ALL_TO"; Pos = MAP_APPFONT ( 111 , 41 ) ; Size = MAP_APPFONT ( 20 , 12 ) ; TabStop = TRUE ; @@ -204,6 +216,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; ImageButton IB_DBCOL_ONE_TO { + HelpID = "sw:ImageButton:DLG_AP_INSERT_DB_SEL:IB_DBCOL_ONE_TO"; Pos = MAP_APPFONT ( 111 , 56 ) ; Size = MAP_APPFONT ( 20 , 12 ) ; TabStop = TRUE ; @@ -218,6 +231,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; ImageButton IB_DBCOL_ONE_FROM { + HelpID = "sw:ImageButton:DLG_AP_INSERT_DB_SEL:IB_DBCOL_ONE_FROM"; Pos = MAP_APPFONT ( 111 , 84 ) ; Size = MAP_APPFONT ( 20 , 12 ) ; TabStop = TRUE ; @@ -232,6 +246,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; ImageButton IB_DBCOL_ALL_FROM { + HelpID = "sw:ImageButton:DLG_AP_INSERT_DB_SEL:IB_DBCOL_ALL_FROM"; Pos = MAP_APPFONT ( 111 , 99 ) ; Size = MAP_APPFONT ( 20 , 12 ) ; TabStop = TRUE ; @@ -253,6 +268,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; ListBox LB_TABLE_COL { + HelpID = "sw:ListBox:DLG_AP_INSERT_DB_SEL:LB_TABLE_COL"; Border = TRUE ; Pos = MAP_APPFONT ( 137 , 41 ) ; Size = MAP_APPFONT ( 75 , 70 ) ; @@ -265,6 +281,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; CheckBox CB_TABLE_HEADON { + HelpID = "sw:CheckBox:DLG_AP_INSERT_DB_SEL:CB_TABLE_HEADON"; Pos = MAP_APPFONT ( 111 , 128 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; TabStop = TRUE ; @@ -273,6 +290,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; RadioButton RB_HEADL_COLNMS { + HelpID = "sw:RadioButton:DLG_AP_INSERT_DB_SEL:RB_HEADL_COLNMS"; Pos = MAP_APPFONT ( 120 , 142 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; TabStop = TRUE ; @@ -281,6 +299,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; RadioButton RB_HEADL_EMPTY { + HelpID = "sw:RadioButton:DLG_AP_INSERT_DB_SEL:RB_HEADL_EMPTY"; Pos = MAP_APPFONT ( 120 , 155 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; TabStop = TRUE ; @@ -288,6 +307,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; PushButton PB_TBL_FORMAT { + HelpID = "sw:PushButton:DLG_AP_INSERT_DB_SEL:PB_TBL_FORMAT"; Pos = MAP_APPFONT ( 214 , 128 ) ; Size = MAP_APPFONT ( 65 , 12 ) ; Text [ en-US ] = "Pr~operties..." ; @@ -295,6 +315,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL }; PushButton PB_TBL_AUTOFMT { + HelpID = "sw:PushButton:DLG_AP_INSERT_DB_SEL:PB_TBL_AUTOFMT"; Pos = MAP_APPFONT ( 214 , 144 ) ; Size = MAP_APPFONT ( 65 , 12 ) ; TabStop = TRUE ; diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index d550c3b3af..052b48ba71 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -62,10 +62,8 @@ #include <unotools/tempfile.hxx> #include <unotools/pathoptions.hxx> #include <svl/urihelper.hxx> -#ifndef _SVSTDARR_HXX #define _SVSTDARR_STRINGSDTOR #include <svl/svstdarr.hxx> -#endif #include <svl/zforlist.hxx> #include <svl/zformat.hxx> #include <svl/stritem.hxx> @@ -86,7 +84,6 @@ #include <swundo.hxx> #include <flddat.hxx> #include <modcfg.hxx> -#include <swprtopt.hxx> #include <shellio.hxx> #include <dbui.hxx> #include <dbmgr.hxx> @@ -137,6 +134,7 @@ #include <memory> #include <vector> #include <unomid.h> +#include <section.hxx> using namespace ::osl; using namespace ::svx; @@ -845,6 +843,23 @@ void lcl_CopyFollowPageDesc( } } +void lcl_RemoveSectionLinks( SwWrtShell& rWorkShell ) +{ + //reset all links of the sections of synchronized labels + USHORT nSections = rWorkShell.GetSectionFmtCount(); + for( USHORT nSection = 0; nSection < nSections; ++nSection ) + { + SwSectionData aSectionData( *rWorkShell.GetSectionFmt( nSection ).GetSection() ); + if( aSectionData.GetType() == FILE_LINK_SECTION ) + { + aSectionData.SetType( CONTENT_SECTION ); + aSectionData.SetLinkFileName( String() ); + rWorkShell.UpdateSection( nSection, aSectionData ); + } + } + rWorkShell.SetLabelDoc( sal_False ); +} + BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, const SwMergeDescriptor& rMergeDescriptor) { @@ -1085,6 +1100,10 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, // copy created file into the target document rWorkShell.ConvertFieldsToText(); rWorkShell.SetNumberingRestart(); + if( bSynchronizedDoc ) + { + lcl_RemoveSectionLinks( rWorkShell ); + } // insert the document into the target document rWorkShell.SttEndDoc(FALSE); @@ -2934,7 +2953,10 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, rWorkShell.RemoveInvisibleContent(); rWorkShell.ConvertFieldsToText(); rWorkShell.SetNumberingRestart(); - + if( bSynchronizedDoc ) + { + lcl_RemoveSectionLinks( rWorkShell ); + } // insert the document into the target document rWorkShell.SttEndDoc(FALSE); diff --git a/sw/source/ui/dbui/dbtree.cxx b/sw/source/ui/dbui/dbtree.cxx index 4b31760592..ba6c6bd225 100644 --- a/sw/source/ui/dbui/dbtree.cxx +++ b/sw/source/ui/dbui/dbtree.cxx @@ -260,7 +260,7 @@ void SwDBTreeList::InitTreeList() if(!pImpl->HasContext() && pImpl->GetWrtShell()) return; SetSelectionMode(SINGLE_SELECTION); - SetWindowBits(WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); + SetStyle(GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); // Font nicht setzen, damit der Font des Controls uebernommen wird! SetSpaceBetweenEntries(0); SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE), diff --git a/sw/source/ui/dbui/dbui.src b/sw/source/ui/dbui/dbui.src index 8d073412ab..49ddd67948 100644 --- a/sw/source/ui/dbui/dbui.src +++ b/sw/source/ui/dbui/dbui.src @@ -31,6 +31,7 @@ #include "helpid.h" ModalDialog DLG_DBSELECTION { + HelpID = "sw:ModalDialog:DLG_DBSELECTION"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 168 , 132 ) ; diff --git a/sw/source/ui/dbui/mailmergechildwindow.cxx b/sw/source/ui/dbui/mailmergechildwindow.cxx index e03b129034..94fd53a80f 100644 --- a/sw/source/ui/dbui/mailmergechildwindow.cxx +++ b/sw/source/ui/dbui/mailmergechildwindow.cxx @@ -418,7 +418,7 @@ SwSendMailDialog::SwSendMailDialog(Window *pParent, SwMailMergeConfigItem& rConf m_aStatusLB.SetHelpId(HID_MM_MAILSTATUS_TLB); static long nTabs[] = {3, 0, nPos1, aSz.Width() }; - m_aStatusLB.SetWindowBits( WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP ); + m_aStatusLB.SetStyle( m_aStatusLB.GetStyle() | WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP ); m_aStatusLB.SetSelectionMode( SINGLE_SELECTION ); m_aStatusLB.SetTabs(&nTabs[0], MAP_PIXEL); m_aStatusLB.SetSpaceBetweenEntries(3); diff --git a/sw/source/ui/dbui/mailmergechildwindow.src b/sw/source/ui/dbui/mailmergechildwindow.src index 187f50b584..9e8253c917 100644 --- a/sw/source/ui/dbui/mailmergechildwindow.src +++ b/sw/source/ui/dbui/mailmergechildwindow.src @@ -258,6 +258,7 @@ ModalDialog DLG_MM_SENDWARNING }; MultiLineEdit ED_DETAILS { + HelpID = "sw:MultiLineEdit:DLG_MM_SENDWARNING:ED_DETAILS"; Pos = MAP_APPFONT ( 40 , 50 ) ; Size = MAP_APPFONT ( 194 , 50 ) ; Border = TRUE; diff --git a/sw/source/ui/dbui/mailmergewizard.src b/sw/source/ui/dbui/mailmergewizard.src index ad7d574800..2756f5ff7a 100644 --- a/sw/source/ui/dbui/mailmergewizard.src +++ b/sw/source/ui/dbui/mailmergewizard.src @@ -30,6 +30,7 @@ ModalDialog DLG_MAILMERGEWIZARD { + HelpID = "sw:ModalDialog:DLG_MAILMERGEWIZARD"; OutputSize = TRUE ; SVLook = TRUE ; Text [ en-US ] = "Mail Merge Wizard" ; diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index ae6b6b0cb0..8d32644b12 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -1097,6 +1097,25 @@ SwAssignFieldsControl::SwAssignFieldsControl( uno::Sequence< ::rtl::OUString> aAssignments = rConfigItem.GetColumnAssignment( rConfigItem.GetCurrentDBData() ); Link aMatchHdl = LINK(this, SwAssignFieldsControl, MatchHdl_Impl); Link aFocusHdl = LINK(this, SwAssignFieldsControl, GotFocusHdl_Impl); + + static const char* aHIDs[] = + { + HID_MM_HEADER_0, + HID_MM_HEADER_1, + HID_MM_HEADER_2, + HID_MM_HEADER_3, + HID_MM_HEADER_4, + HID_MM_HEADER_5, + HID_MM_HEADER_6, + HID_MM_HEADER_7, + HID_MM_HEADER_8, + HID_MM_HEADER_9, + HID_MM_HEADER_10, + HID_MM_HEADER_11, + HID_MM_HEADER_12, + HID_MM_HEADER_13 + }; + //fill the controls for(USHORT i = 0; i < rHeaders.Count(); ++i) { @@ -1106,7 +1125,7 @@ SwAssignFieldsControl::SwAssignFieldsControl( sLabel.Insert(rHeader, 1); pNewText->SetText(sLabel); ListBox* pNewLB = new ListBox(&m_aWindow, ResId(LB_FIELDS, *rResId.GetResMgr())); - pNewLB->SetHelpId( HID_MM_HEADER_0 + i ); + pNewLB->SetHelpId( aHIDs[i] ); pNewLB->SelectEntryPos(0); for(sal_Int32 nField = 0; nField < aFields.getLength(); ++nField) pNewLB->InsertEntry(pFields[nField]); @@ -1434,7 +1453,7 @@ DDListBox::DDListBox(SwCustomizeAddressBlockDialog* pParent, const ResId rResId) SvTreeListBox(pParent, rResId), m_pParentDialog(pParent) { - SetWindowBits( /*WB_HASBUTTONS|WB_HASBUTTONSATROOT|*/ + SetStyle( GetStyle() | /*WB_HASBUTTONS|WB_HASBUTTONSATROOT|*/ WB_CLIPCHILDREN ); // SetSpaceBetweenEntries(3); SetSelectionMode( SINGLE_SELECTION ); diff --git a/sw/source/ui/dbui/mmaddressblockpage.src b/sw/source/ui/dbui/mmaddressblockpage.src index 7052b27f25..d06ced7e29 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.src +++ b/sw/source/ui/dbui/mmaddressblockpage.src @@ -63,6 +63,7 @@ TabPage DLG_MM_ADDRESSBLOCK_PAGE }; PushButton PB_ADDRESSLIST { + HelpID = "sw:PushButton:DLG_MM_ADDRESSBLOCK_PAGE:PB_ADDRESSLIST"; Pos = MAP_APPFONT ( 154 , 27 ) ; Size = MAP_APPFONT ( 100 , 14 ) ; Text[ en-US ] = "Select A~ddress List..."; @@ -91,6 +92,7 @@ TabPage DLG_MM_ADDRESSBLOCK_PAGE }; CheckBox CB_ADDRESS { + HelpID = "sw:CheckBox:DLG_MM_ADDRESSBLOCK_PAGE:CB_ADDRESS"; Pos = MAP_APPFONT ( 16 , 66 ) ; Size = MAP_APPFONT ( 242 , 10 ) ; Text[ en-US ] = "~This document shall contain an address block"; @@ -103,6 +105,7 @@ TabPage DLG_MM_ADDRESSBLOCK_PAGE }; PushButton PB_SETTINGS { + HelpID = "sw:PushButton:DLG_MM_ADDRESSBLOCK_PAGE:PB_SETTINGS"; Pos = MAP_APPFONT ( 194 , 110 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Group = FALSE; @@ -110,6 +113,7 @@ TabPage DLG_MM_ADDRESSBLOCK_PAGE }; CheckBox CB_HIDE_EMPTY_PARA { + HelpID = "sw:CheckBox:DLG_MM_ADDRESSBLOCK_PAGE:CB_HIDE_EMPTY_PARA"; Pos = MAP_APPFONT ( 24 , 127 ) ; Size = MAP_APPFONT ( 230 , 10 ) ; Text[ en-US ] = "~Suppress lines with just empty fields"; @@ -134,6 +138,7 @@ TabPage DLG_MM_ADDRESSBLOCK_PAGE }; PushButton PB_ASSIGN { + HelpID = "sw:PushButton:DLG_MM_ADDRESSBLOCK_PAGE:PB_ASSIGN"; Pos = MAP_APPFONT ( 194 , 151 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text[ en-US ] = "Match ~Fields..."; @@ -169,6 +174,7 @@ TabPage DLG_MM_ADDRESSBLOCK_PAGE }; ImageButton IB_PREVSET { + HelpID = "sw:ImageButton:DLG_MM_ADDRESSBLOCK_PAGE:IB_PREVSET"; Pos = MAP_APPFONT ( 167 , 238 ) ; Size = MAP_APPFONT ( 10 , 10 ) ; SYMBOL = IMAGEBUTTON_PREV; @@ -176,6 +182,7 @@ TabPage DLG_MM_ADDRESSBLOCK_PAGE }; ImageButton IB_NEXTSET { + HelpID = "sw:ImageButton:DLG_MM_ADDRESSBLOCK_PAGE:IB_NEXTSET"; Pos = MAP_APPFONT ( 178 , 238 ) ; Size = MAP_APPFONT ( 10 , 10 ) ; SYMBOL = IMAGEBUTTON_NEXT ; @@ -215,18 +222,21 @@ ModalDialog DLG_MM_SELECTADDRESSBLOCK }; PushButton PB_NEW { + HelpID = "sw:PushButton:DLG_MM_SELECTADDRESSBLOCK:PB_NEW"; Pos = MAP_APPFONT ( 204 , 14 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text[ en-US ] = "~New..."; }; PushButton PB_CUSTOMIZE { + HelpID = "sw:PushButton:DLG_MM_SELECTADDRESSBLOCK:PB_CUSTOMIZE"; Pos = MAP_APPFONT ( 204 , 31 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text[ en-US ] = "~Edit..."; }; PushButton PB_DELETE { + HelpID = "sw:PushButton:DLG_MM_SELECTADDRESSBLOCK:PB_DELETE"; Pos = MAP_APPFONT ( 204 , 48 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Group = FALSE; @@ -241,24 +251,28 @@ ModalDialog DLG_MM_SELECTADDRESSBLOCK }; RadioButton RB_NEVER { + HelpID = "sw:RadioButton:DLG_MM_SELECTADDRESSBLOCK:RB_NEVER"; Pos = MAP_APPFONT ( 12 , 131 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; Text[ en-US ] = "N~ever include the country/region"; }; RadioButton RB_ALWAYS { + HelpID = "sw:RadioButton:DLG_MM_SELECTADDRESSBLOCK:RB_ALWAYS"; Pos = MAP_APPFONT ( 12 , 145 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; Text[ en-US ] = "~Always include the country/region"; }; RadioButton RB_DEPENDENT { + HelpID = "sw:RadioButton:DLG_MM_SELECTADDRESSBLOCK:RB_DEPENDENT"; Pos = MAP_APPFONT ( 12 , 159 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; Text[ en-US ] = "Only ~include the country/region if it is not:"; }; Edit ED_COUNTRY { + HelpID = "sw:Edit:DLG_MM_SELECTADDRESSBLOCK:ED_COUNTRY"; Pos = MAP_APPFONT ( 18 , 172 ) ; Size = MAP_APPFONT ( 180 , 12 ) ; Border = TRUE; @@ -337,6 +351,7 @@ ModalDialog DLG_MM_CUSTOMIZEADDRESSBLOCK }; ImageButton IB_INSERTFIELD { + HelpID = "sw:ImageButton:DLG_MM_CUSTOMIZEADDRESSBLOCK:IB_INSERTFIELD"; Pos = MAP_APPFONT ( 80 , 29 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; Symbol = IMAGEBUTTON_ARROW_RIGHT; @@ -348,6 +363,7 @@ ModalDialog DLG_MM_CUSTOMIZEADDRESSBLOCK }; ImageButton IB_REMOVEFIELD { + HelpID = "sw:ImageButton:DLG_MM_CUSTOMIZEADDRESSBLOCK:IB_REMOVEFIELD"; Pos = MAP_APPFONT ( 80 , 46 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; Symbol = IMAGEBUTTON_ARROW_LEFT; @@ -369,12 +385,14 @@ ModalDialog DLG_MM_CUSTOMIZEADDRESSBLOCK }; MultiLineEdit ED_DRAG { + HelpID = "sw:MultiLineEdit:DLG_MM_CUSTOMIZEADDRESSBLOCK:ED_DRAG"; Pos = MAP_APPFONT ( 106 , 14 ) ; Size = MAP_APPFONT ( 160 , 60 ) ; Border = TRUE; }; ImageButton IB_UP { + HelpID = "sw:ImageButton:DLG_MM_CUSTOMIZEADDRESSBLOCK:IB_UP"; Pos = MAP_APPFONT ( 285 , 14 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; Symbol = IMAGEBUTTON_ARROW_UP; @@ -382,6 +400,7 @@ ModalDialog DLG_MM_CUSTOMIZEADDRESSBLOCK }; ImageButton IB_LEFT { + HelpID = "sw:ImageButton:DLG_MM_CUSTOMIZEADDRESSBLOCK:IB_LEFT"; Pos = MAP_APPFONT ( 270 , 29 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; Symbol = IMAGEBUTTON_ARROW_LEFT; @@ -389,6 +408,7 @@ ModalDialog DLG_MM_CUSTOMIZEADDRESSBLOCK }; ImageButton IB_RIGHT { + HelpID = "sw:ImageButton:DLG_MM_CUSTOMIZEADDRESSBLOCK:IB_RIGHT"; Pos = MAP_APPFONT ( 300 , 29 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; Symbol = IMAGEBUTTON_ARROW_RIGHT; @@ -396,6 +416,7 @@ ModalDialog DLG_MM_CUSTOMIZEADDRESSBLOCK }; ImageButton IB_DOWN { + HelpID = "sw:ImageButton:DLG_MM_CUSTOMIZEADDRESSBLOCK:IB_DOWN"; Pos = MAP_APPFONT ( 285 , 48 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; Symbol = IMAGEBUTTON_ARROW_DOWN; @@ -410,6 +431,7 @@ ModalDialog DLG_MM_CUSTOMIZEADDRESSBLOCK }; ComboBox CB_FIELD { + HelpID = "sw:ComboBox:DLG_MM_CUSTOMIZEADDRESSBLOCK:CB_FIELD"; Pos = MAP_APPFONT ( 106 , 89 ) ; Size = MAP_APPFONT ( 160 , 50 ) ; Border = TRUE; @@ -560,6 +582,7 @@ ModalDialog DLG_MM_ASSIGNFIELDS }; ListBox LB_FIELDS { + HelpID = "sw:ListBox:DLG_MM_ASSIGNFIELDS:LB_FIELDS"; Pos = MAP_APPFONT ( 83 , 4 ) ; Size = MAP_APPFONT ( 74 , 50 ) ; TabStop = TRUE; diff --git a/sw/source/ui/dbui/mmdocselectpage.src b/sw/source/ui/dbui/mmdocselectpage.src index ace679af4f..9f6c1df5df 100644 --- a/sw/source/ui/dbui/mmdocselectpage.src +++ b/sw/source/ui/dbui/mmdocselectpage.src @@ -47,48 +47,56 @@ TabPage DLG_MM_DOCSELECT_PAGE }; RadioButton RB_CURRENTDOC { + HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_CURRENTDOC"; Pos = MAP_APPFONT ( 12 , 48 ) ; Size = MAP_APPFONT ( 190 , 10 ) ; Text[ en-US ] = "Use the current ~document"; }; RadioButton RB_NEWDOC { + HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_NEWDOC"; Pos = MAP_APPFONT ( 12 , 66 ) ; Size = MAP_APPFONT ( 190 , 10 ) ; Text[ en-US ] = "Create a ne~w document"; }; RadioButton RB_LOADDOC { + HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_LOADDOC"; Pos = MAP_APPFONT ( 12 , 84) ; Size = MAP_APPFONT ( 190 , 10 ) ; Text[ en-US ] = "Start from ~existing document"; }; PushButton PB_LOADDOC { + HelpID = "sw:PushButton:DLG_MM_DOCSELECT_PAGE:PB_LOADDOC"; Pos = MAP_APPFONT ( 204 , 80) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text[ en-US ] = "B~rowse..."; }; RadioButton RB_LOADTEMPLATE { + HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_LOADTEMPLATE"; Pos = MAP_APPFONT ( 12 , 103 ) ; Size = MAP_APPFONT ( 190 , 10 ) ; Text[ en-US ] = "Start from a t~emplate"; }; PushButton PB_BROWSETEMPLATE { + HelpID = "sw:PushButton:DLG_MM_DOCSELECT_PAGE:PB_BROWSETEMPLATE"; Pos = MAP_APPFONT ( 204 , 99 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text[ en-US ] = "B~rowse..."; }; RadioButton RB_RECENTDOC { + HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_RECENTDOC"; Pos = MAP_APPFONT ( 12 , 120) ; Size = MAP_APPFONT ( 190 , 10 ) ; Text[ en-US ] = "Start fro~m a recently saved starting document"; }; ListBox LB_RECENTDOC { + HelpID = "sw:ListBox:DLG_MM_DOCSELECT_PAGE:LB_RECENTDOC"; Pos = MAP_APPFONT ( 20 , 134 ) ; Size = MAP_APPFONT ( 180 , 50 ) ; DropDown = TRUE; diff --git a/sw/source/ui/dbui/mmgreetingspage.src b/sw/source/ui/dbui/mmgreetingspage.src index fff77d9240..5cae953a35 100644 --- a/sw/source/ui/dbui/mmgreetingspage.src +++ b/sw/source/ui/dbui/mmgreetingspage.src @@ -144,6 +144,7 @@ TabPage DLG_MM_GREETINGS_PAGE }; CheckBox CB_GREETINGLINE { + HelpID = "sw:CheckBox:DLG_MM_GREETINGS_PAGE:CB_GREETINGLINE"; Pos = MAP_APPFONT ( 12 , 27 ); Size = MAP_APPFONT ( 242 , 10 ); Text[ en-US ] = "This document should contain a salutation"; @@ -163,6 +164,7 @@ TabPage DLG_MM_GREETINGS_PAGE }; PushButton PB_ASSIGN { + HelpID = "sw:PushButton:DLG_MM_GREETINGS_PAGE:PB_ASSIGN"; Pos = MAP_APPFONT ( 204 , 179 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text[ en-US ] = "~Match fields..."; @@ -175,6 +177,7 @@ TabPage DLG_MM_GREETINGS_PAGE }; ImageButton IB_PREVSET { + HelpID = "sw:ImageButton:DLG_MM_GREETINGS_PAGE:IB_PREVSET"; Pos = MAP_APPFONT ( 177 , 204 ) ; Size = MAP_APPFONT ( 10 , 10 ) ; SYMBOL = IMAGEBUTTON_PREV; @@ -182,6 +185,7 @@ TabPage DLG_MM_GREETINGS_PAGE }; ImageButton IB_NEXTSET { + HelpID = "sw:ImageButton:DLG_MM_GREETINGS_PAGE:IB_NEXTSET"; Pos = MAP_APPFONT ( 188 , 204 ) ; Size = MAP_APPFONT ( 10 , 10 ) ; SYMBOL = IMAGEBUTTON_NEXT ; @@ -208,6 +212,7 @@ ModalDialog DLG_MM_MAILBODY Text [ en-US ] = "E-Mail Message"; CheckBox CB_GREETINGLINE { + HelpID = "sw:CheckBox:DLG_MM_MAILBODY:CB_GREETINGLINE"; Pos = MAP_APPFONT ( 6 , 3 ) ; Size = MAP_APPFONT ( 242 , 10 ) ; Text[ en-US ] = "This e-mail should contain a salutation"; @@ -221,6 +226,7 @@ ModalDialog DLG_MM_MAILBODY }; MultiLineEdit MLE_BODY { + HelpID = "sw:MultiLineEdit:DLG_MM_MAILBODY:MLE_BODY"; Pos = MAP_APPFONT ( 12, 151 ) ; Size = MAP_APPFONT ( 180 , 50 ) ; Border = TRUE; diff --git a/sw/source/ui/dbui/mmlayoutpage.src b/sw/source/ui/dbui/mmlayoutpage.src index 07582a45ef..94e1387306 100644 --- a/sw/source/ui/dbui/mmlayoutpage.src +++ b/sw/source/ui/dbui/mmlayoutpage.src @@ -48,6 +48,7 @@ TabPage DLG_MM_LAYOUT_PAGE }; CheckBox CB_ALIGN { + HelpID = "sw:CheckBox:DLG_MM_LAYOUT_PAGE:CB_ALIGN"; Pos = MAP_APPFONT ( 6 , 40 ) ; Size = MAP_APPFONT ( 118 , 10 ) ; Text[ en-US ] = "Align to text body"; @@ -60,6 +61,7 @@ TabPage DLG_MM_LAYOUT_PAGE }; MetricField MF_LEFT { + HelpID = "sw:MetricField:DLG_MM_LAYOUT_PAGE:MF_LEFT"; Pos = MAP_APPFONT ( 78 , 52 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; Border = TRUE ; @@ -83,6 +85,7 @@ TabPage DLG_MM_LAYOUT_PAGE }; MetricField MF_TOP { + HelpID = "sw:MetricField:DLG_MM_LAYOUT_PAGE:MF_TOP"; Pos = MAP_APPFONT ( 78 , 67 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; Border = TRUE ; @@ -112,6 +115,7 @@ TabPage DLG_MM_LAYOUT_PAGE }; PushButton MF_UP { + HelpID = "sw:PushButton:DLG_MM_LAYOUT_PAGE:MF_UP"; Pos = MAP_APPFONT ( 68 , 96 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text[ en-US ] = "~Up"; @@ -124,6 +128,7 @@ TabPage DLG_MM_LAYOUT_PAGE }; PushButton PB_DOWN { + HelpID = "sw:PushButton:DLG_MM_LAYOUT_PAGE:PB_DOWN"; Pos = MAP_APPFONT ( 68 , 113 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text[ en-US ] = "~Down"; @@ -143,6 +148,7 @@ TabPage DLG_MM_LAYOUT_PAGE }; ListBox LB_ZOOM { + HelpID = "sw:ListBox:DLG_MM_LAYOUT_PAGE:LB_ZOOM"; Pos = MAP_APPFONT ( 204 , 182 ) ; Size = MAP_APPFONT ( 50 , 50 ) ; Border = TRUE; diff --git a/sw/source/ui/dbui/mmmergepage.src b/sw/source/ui/dbui/mmmergepage.src index fd9fffc0de..8480e97e0e 100644 --- a/sw/source/ui/dbui/mmmergepage.src +++ b/sw/source/ui/dbui/mmmergepage.src @@ -49,6 +49,7 @@ TabPage DLG_MM_MERGE_PAGE }; PushButton PB_EDIT { + HelpID = "sw:PushButton:DLG_MM_MERGE_PAGE:PB_EDIT"; Pos = MAP_APPFONT ( 70 , 67 ) ; Size = MAP_APPFONT ( 120 , 14 ) ; Text [ en-US ] = "~Edit individual document..."; @@ -67,30 +68,35 @@ TabPage DLG_MM_MERGE_PAGE }; Edit ED_FIND { + HelpID = "sw:Edit:DLG_MM_MERGE_PAGE:ED_FIND"; Pos = MAP_APPFONT ( 55 ,114 ) ; Size = MAP_APPFONT ( 140 , 12 ) ; Border = TRUE; }; PushButton PB_FIND { + HelpID = "sw:PushButton:DLG_MM_MERGE_PAGE:PB_FIND"; Pos = MAP_APPFONT ( 198 ,113 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Find..."; }; CheckBox CB_WHOLEWORDS { + HelpID = "sw:CheckBox:DLG_MM_MERGE_PAGE:CB_WHOLEWORDS"; Pos = MAP_APPFONT ( 55 , 131 ) ; Size = MAP_APPFONT ( 180 , 10 ) ; Text [ en-US ] = "Whole wor~ds only"; }; CheckBox CB_BACKWARDS { + HelpID = "sw:CheckBox:DLG_MM_MERGE_PAGE:CB_BACKWARDS"; Pos = MAP_APPFONT ( 55 , 144 ) ; Size = MAP_APPFONT ( 180 , 10 ) ; Text [ en-US ] = "Back~wards"; }; CheckBox CB_MATCHCASE { + HelpID = "sw:CheckBox:DLG_MM_MERGE_PAGE:CB_MATCHCASE"; Pos = MAP_APPFONT ( 55 , 157 ) ; Size = MAP_APPFONT ( 180 , 10 ) ; Text [ en-US ] = "Ma~tch case"; diff --git a/sw/source/ui/dbui/mmoutputpage.src b/sw/source/ui/dbui/mmoutputpage.src index 29e54bbb40..4801706083 100644 --- a/sw/source/ui/dbui/mmoutputpage.src +++ b/sw/source/ui/dbui/mmoutputpage.src @@ -48,24 +48,28 @@ TabPage DLG_MM_OUTPUT_PAGE }; RadioButton RB_SAVESTARTDOC { + HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_SAVESTARTDOC"; Pos = MAP_APPFONT ( 45 , 40 ) ; Size = MAP_APPFONT ( 209 , 10 ) ; Text[ en-US ] = "~Save starting document"; }; RadioButton RB_SAVEMERGEDDOC { + HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_SAVEMERGEDDOC"; Pos = MAP_APPFONT ( 45 , 53 ) ; Size = MAP_APPFONT ( 209 , 10 ) ; Text[ en-US ] = "Save ~merged document" ; }; RadioButton RB_PRINT { + HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_PRINT"; Pos = MAP_APPFONT ( 45 , 66 ) ; Size = MAP_APPFONT ( 209 , 10 ) ; Text[ en-US ] = "~Print merged document"; }; RadioButton RB_SENDMAIL { + HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_SENDMAIL"; Pos = MAP_APPFONT ( 45 , 79 ) ; Size = MAP_APPFONT ( 209 , 10 ) ; Text[ en-US ] = "Send merged document as ~E-Mail"; @@ -77,30 +81,35 @@ TabPage DLG_MM_OUTPUT_PAGE }; PushButton PB_SAVESTARTDOC { + HelpID = "sw:PushButton:DLG_MM_OUTPUT_PAGE:PB_SAVESTARTDOC"; Pos = MAP_APPFONT ( 55 , 108 ) ; Size = MAP_APPFONT ( 100 , 14 ) ; Text[ en-US ] = "Save starting ~document"; }; RadioButton RB_SAVEASONE { + HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_SAVEASONE"; Pos = MAP_APPFONT ( 45 , 109 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; Text[ en-US ] = "S~ave as single document"; }; RadioButton RB_SAVEINDIVIDUAL { + HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_SAVEINDIVIDUAL"; Pos = MAP_APPFONT ( 45, 123 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; Text[ en-US ] = "Sa~ve as individual documents"; }; RadioButton RB_FROM { + HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_FROM"; Pos = MAP_APPFONT ( 45 , 137 ) ; Size = MAP_APPFONT ( 30 , 10 ) ; Text[ en-US ] = "~From"; }; NumericField NF_FROM { + HelpID = "sw:NumericField:DLG_MM_OUTPUT_PAGE:NF_FROM"; Pos = MAP_APPFONT ( 78 , 136 ) ; Size = MAP_APPFONT ( 20 , 10 ) ; Border = TRUE; @@ -120,6 +129,7 @@ TabPage DLG_MM_OUTPUT_PAGE }; NumericField NF_TO { + HelpID = "sw:NumericField:DLG_MM_OUTPUT_PAGE:NF_TO"; Pos = MAP_APPFONT ( 124 , 136 ) ; Size = MAP_APPFONT ( 20 , 10 ) ; Border = TRUE; @@ -132,6 +142,7 @@ TabPage DLG_MM_OUTPUT_PAGE }; PushButton PB_SAVENOW { + HelpID = "sw:PushButton:DLG_MM_OUTPUT_PAGE:PB_SAVENOW"; Pos = MAP_APPFONT ( 45 , 150 ) ; Size = MAP_APPFONT ( 80 , 14 ) ; Text[ en-US ] = "Save Do~cuments"; @@ -144,6 +155,7 @@ TabPage DLG_MM_OUTPUT_PAGE }; ListBox LB_PRINT { + HelpID = "sw:ListBox:DLG_MM_OUTPUT_PAGE:LB_PRINT"; Pos = MAP_APPFONT ( 45 , 109 ) ; Size = MAP_APPFONT ( 147 , 50 ) ; Border = TRUE; @@ -152,18 +164,21 @@ TabPage DLG_MM_OUTPUT_PAGE }; PushButton PB_PRINTERSETTINGS { + HelpID = "sw:PushButton:DLG_MM_OUTPUT_PAGE:PB_PRINTERSETTINGS"; Pos = MAP_APPFONT ( 198 , 108 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text[ en-US ] = "P~roperties..."; }; RadioButton RB_PRINTALL { + HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_PRINTALL"; Pos = MAP_APPFONT ( 45 , 126 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; Text[ en-US ] = "Print ~all documents"; }; PushButton PB_PRINTNOW { + HelpID = "sw:PushButton:DLG_MM_OUTPUT_PAGE:PB_PRINTNOW"; Pos = MAP_APPFONT ( 45 , 155 ) ; Size = MAP_APPFONT ( 80 , 14 ) ; Text[ en-US ] = "Prin~t Documents"; @@ -177,6 +192,7 @@ TabPage DLG_MM_OUTPUT_PAGE }; ListBox LB_MAILTO { + HelpID = "sw:ListBox:DLG_MM_OUTPUT_PAGE:LB_MAILTO"; Pos = MAP_APPFONT ( 45 , 109 ) ; Size = MAP_APPFONT ( 147 , 50 ) ; DropDown = TRUE; @@ -184,6 +200,7 @@ TabPage DLG_MM_OUTPUT_PAGE }; PushButton PB_COPYTO { + HelpID = "sw:PushButton:DLG_MM_OUTPUT_PAGE:PB_COPYTO"; Pos = MAP_APPFONT ( 198 , 108 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text[ en-US ] = "~Copy to..."; @@ -196,6 +213,7 @@ TabPage DLG_MM_OUTPUT_PAGE }; Edit ED_SUBJECT { + HelpID = "sw:Edit:DLG_MM_OUTPUT_PAGE:ED_SUBJECT"; Pos = MAP_APPFONT ( 45 , 125 ) ; Size = MAP_APPFONT ( 147 , 12 ) ; Border = TRUE; @@ -208,6 +226,7 @@ TabPage DLG_MM_OUTPUT_PAGE }; ListBox LB_SENDAS { + HelpID = "sw:ListBox:DLG_MM_OUTPUT_PAGE:LB_SENDAS"; Pos = MAP_APPFONT ( 45 , 141 ) ; Size = MAP_APPFONT (147 , 70 ) ; DropDown = TRUE; @@ -231,6 +250,7 @@ TabPage DLG_MM_OUTPUT_PAGE }; PushButton PB_SENDAS { + HelpID = "sw:PushButton:DLG_MM_OUTPUT_PAGE:PB_SENDAS"; Pos = MAP_APPFONT ( 198 , 140 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text[ en-US ] = "Pr~operties..."; @@ -243,18 +263,21 @@ TabPage DLG_MM_OUTPUT_PAGE }; Edit ED_ATTACHMENT { + HelpID = "sw:Edit:DLG_MM_OUTPUT_PAGE:ED_ATTACHMENT"; Pos = MAP_APPFONT ( 45 , 168 ) ; Size = MAP_APPFONT ( 147 , 12 ) ; Border = TRUE; }; RadioButton RB_SENDALL { + HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_SENDALL"; Pos = MAP_APPFONT ( 45 , 184 ) ; Size = MAP_APPFONT ( 153 , 10 ) ; Text[ en-US ] = "S~end all documents"; }; PushButton PB_SENDDOCUMENTS { + HelpID = "sw:PushButton:DLG_MM_OUTPUT_PAGE:PB_SENDDOCUMENTS"; Pos = MAP_APPFONT ( 45 , 212 ) ; Size = MAP_APPFONT ( 80 , 14 ) ; Text[ en-US ] = "Se~nd documents"; @@ -321,6 +344,7 @@ ModalDialog DLG_MM_COPYTO }; Edit ED_CC { + HelpID = "sw:Edit:DLG_MM_COPYTO:ED_CC"; Pos = MAP_APPFONT ( 40 , 15 ) ; Size = MAP_APPFONT ( 204 , 12 ) ; Border = TRUE; @@ -333,6 +357,7 @@ ModalDialog DLG_MM_COPYTO }; Edit ED_BCC { + HelpID = "sw:Edit:DLG_MM_COPYTO:ED_BCC"; Pos = MAP_APPFONT ( 40 , 31 ) ; Size = MAP_APPFONT ( 204 , 12 ) ; Border = TRUE; @@ -396,6 +421,7 @@ ModalDialog DLG_MM_SAVEWARNING }; Edit ED_FILENAME { + HelpID = "sw:Edit:DLG_MM_SAVEWARNING:ED_FILENAME"; Pos = MAP_APPFONT ( 40 , 50 ) ; Size = MAP_APPFONT ( 154 , 12 ) ; Border = TRUE; @@ -439,6 +465,7 @@ ModalDialog DLG_MM_QUERY }; Edit ED_TEXT { + HelpID = "sw:Edit:DLG_MM_QUERY:ED_TEXT"; Pos = MAP_APPFONT ( 40 , 39 ) ; Size = MAP_APPFONT ( 194 , 12 ) ; Border = TRUE; diff --git a/sw/source/ui/dbui/mmoutputtypepage.src b/sw/source/ui/dbui/mmoutputtypepage.src index a6dd74cc7a..72d7e39365 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.src +++ b/sw/source/ui/dbui/mmoutputtypepage.src @@ -48,12 +48,14 @@ TabPage DLG_MM_OUTPUTTYPE_PAGE }; RadioButton RB_LETTER { + HelpID = "sw:RadioButton:DLG_MM_OUTPUTTYPE_PAGE:RB_LETTER"; Pos = MAP_APPFONT ( 12 , 43 ) ; Size = MAP_APPFONT ( 240 , 10 ) ; Text[ en-US ] = "~Letter"; }; RadioButton RB_MAIL { + HelpID = "sw:RadioButton:DLG_MM_OUTPUTTYPE_PAGE:RB_MAIL"; Pos = MAP_APPFONT ( 12 , 57 ) ; Size = MAP_APPFONT ( 240 , 10 ) ; Text[ en-US ] = "~E-mail message"; diff --git a/sw/source/ui/dbui/mmpreparemergepage.src b/sw/source/ui/dbui/mmpreparemergepage.src index b1ecd375d4..c763cfa465 100644 --- a/sw/source/ui/dbui/mmpreparemergepage.src +++ b/sw/source/ui/dbui/mmpreparemergepage.src @@ -57,6 +57,7 @@ TabPage DLG_MM_PREPAREMERGE_PAGE PushButton PB_FIRST { + HelpID = "sw:PushButton:DLG_MM_PREPAREMERGE_PAGE:PB_FIRST"; Pos = MAP_APPFONT ( 75 , 55 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; Text = "|<" ; @@ -64,6 +65,7 @@ TabPage DLG_MM_PREPAREMERGE_PAGE }; PushButton PB_PREV { + HelpID = "sw:PushButton:DLG_MM_PREPAREMERGE_PAGE:PB_PREV"; Pos = MAP_APPFONT ( 98 , 55 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; Text = "<" ; @@ -71,6 +73,7 @@ TabPage DLG_MM_PREPAREMERGE_PAGE }; NumericField ED_RECORD { + HelpID = "sw:NumericField:DLG_MM_PREPAREMERGE_PAGE:ED_RECORD"; Pos = MAP_APPFONT ( 121 , 56 ) ; Size = MAP_APPFONT ( 20 , 12 ) ; Border = TRUE ; @@ -83,6 +86,7 @@ TabPage DLG_MM_PREPAREMERGE_PAGE }; PushButton PB_NEXT { + HelpID = "sw:PushButton:DLG_MM_PREPAREMERGE_PAGE:PB_NEXT"; Pos = MAP_APPFONT ( 144 , 55 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; Text = ">" ; @@ -90,6 +94,7 @@ TabPage DLG_MM_PREPAREMERGE_PAGE }; PushButton PB_LAST { + HelpID = "sw:PushButton:DLG_MM_PREPAREMERGE_PAGE:PB_LAST"; Pos = MAP_APPFONT ( 167 , 55 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; Text = ">|" ; @@ -97,6 +102,7 @@ TabPage DLG_MM_PREPAREMERGE_PAGE }; CheckBox CB_EXCLUDE { + HelpID = "sw:CheckBox:DLG_MM_PREPAREMERGE_PAGE:CB_EXCLUDE"; Pos = MAP_APPFONT ( 75, 77 ) ; Size = MAP_APPFONT ( 179 , 10 ) ; Text[ en-US ] = "E~xclude this recipient"; @@ -116,6 +122,7 @@ TabPage DLG_MM_PREPAREMERGE_PAGE }; PushButton PB_EDIT { + HelpID = "sw:PushButton:DLG_MM_PREPAREMERGE_PAGE:PB_EDIT"; Pos = MAP_APPFONT ( 90 , 185 ) ; Size = MAP_APPFONT ( 80 , 14 ) ; Text[ en-US ] = "~Edit Document..."; diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx index 51277a1fed..049b99e611 100644 --- a/sw/source/ui/dbui/selectdbtabledialog.cxx +++ b/sw/source/ui/dbui/selectdbtabledialog.cxx @@ -109,7 +109,7 @@ SwSelectDBTableDialog::SwSelectDBTableDialog(Window* pParent, static long nTabs[] = {3, 0, aSz.Width()/2, aSz.Width() }; m_aTableLB.SetTabs(&nTabs[0], MAP_PIXEL); m_aTableLB.SetHelpId(HID_MM_SELECTDBTABLEDDIALOG_LISTBOX); - m_aTableLB.SetWindowBits( WB_CLIPCHILDREN ); + m_aTableLB.SetStyle( m_aTableLB.GetStyle() | WB_CLIPCHILDREN ); m_aTableLB.SetSpaceBetweenEntries(3); m_aTableLB.SetSelectionMode( SINGLE_SELECTION ); m_aTableLB.SetDragDropMode( 0 ); diff --git a/sw/source/ui/dbui/selectdbtabledialog.src b/sw/source/ui/dbui/selectdbtabledialog.src index 467cb8333e..61d68f6fde 100644 --- a/sw/source/ui/dbui/selectdbtabledialog.src +++ b/sw/source/ui/dbui/selectdbtabledialog.src @@ -54,6 +54,7 @@ ModalDialog DLG_MM_SELECTDBTABLEDDIALOG }; PushButton PB_PREVIEW { + HelpID = "sw:PushButton:DLG_MM_SELECTDBTABLEDDIALOG:PB_PREVIEW"; Pos = MAP_APPFONT ( 6 , 84 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Preview"; diff --git a/sw/source/ui/dialog/abstract.src b/sw/source/ui/dialog/abstract.src index ab5a86394b..a29b7e6339 100644 --- a/sw/source/ui/dialog/abstract.src +++ b/sw/source/ui/dialog/abstract.src @@ -53,6 +53,7 @@ ModalDialog DLG_INSERT_ABSTRACT }; NumericField NF_LEVEL { + HelpID = "sw:NumericField:DLG_INSERT_ABSTRACT:NF_LEVEL"; Border = TRUE ; Pos = MAP_APPFONT ( 153 , 12 ) ; Size = MAP_APPFONT ( 24 , 12 ) ; @@ -75,6 +76,7 @@ ModalDialog DLG_INSERT_ABSTRACT }; NumericField NF_PARA { + HelpID = "sw:NumericField:DLG_INSERT_ABSTRACT:NF_PARA"; Border = TRUE ; Pos = MAP_APPFONT ( 153 , 27 ) ; Size = MAP_APPFONT ( 24 , 12 ) ; diff --git a/sw/source/ui/dialog/ascfldlg.src b/sw/source/ui/dialog/ascfldlg.src index f10fed8a87..66be6d35c9 100644 --- a/sw/source/ui/dialog/ascfldlg.src +++ b/sw/source/ui/dialog/ascfldlg.src @@ -50,6 +50,7 @@ ModalDialog DLG_ASCII_FILTER }; ListBox LB_CHARSET { + HelpID = "sw:ListBox:DLG_ASCII_FILTER:LB_CHARSET"; Pos = MAP_APPFONT ( 80 , 14 ) ; Size = MAP_APPFONT ( 90 , 61 ) ; TabStop = TRUE ; @@ -64,6 +65,7 @@ ModalDialog DLG_ASCII_FILTER }; ListBox LB_FONT { + HelpID = "sw:ListBox:DLG_ASCII_FILTER:LB_FONT"; Pos = MAP_APPFONT ( 80 , 30 ) ; Size = MAP_APPFONT ( 90 , 61 ) ; TabStop = TRUE ; @@ -78,6 +80,7 @@ ModalDialog DLG_ASCII_FILTER }; ListBox LB_LANGUAGE { + HelpID = "sw:ListBox:DLG_ASCII_FILTER:LB_LANGUAGE"; Pos = MAP_APPFONT ( 80 , 46 ) ; Size = MAP_APPFONT ( 90 , 61 ) ; TabStop = TRUE ; @@ -92,6 +95,7 @@ ModalDialog DLG_ASCII_FILTER }; RadioButton RB_CRLF { + HelpID = "sw:RadioButton:DLG_ASCII_FILTER:RB_CRLF"; Pos = MAP_APPFONT ( 80 , 64 ) ; Size = MAP_APPFONT ( 40 , 10 ) ; TabStop = TRUE ; @@ -100,6 +104,7 @@ ModalDialog DLG_ASCII_FILTER }; RadioButton RB_CR { + HelpID = "sw:RadioButton:DLG_ASCII_FILTER:RB_CR"; Pos = MAP_APPFONT ( 121 , 64 ) ; Size = MAP_APPFONT ( 20 , 10 ) ; // TabStop = TRUE ; @@ -107,6 +112,7 @@ ModalDialog DLG_ASCII_FILTER }; RadioButton RB_LF { + HelpID = "sw:RadioButton:DLG_ASCII_FILTER:RB_LF"; Pos = MAP_APPFONT ( 155 , 64 ) ; Size = MAP_APPFONT ( 20 , 10 ) ; // TabStop = TRUE ; diff --git a/sw/source/ui/dialog/docstdlg.src b/sw/source/ui/dialog/docstdlg.src index 5926321d88..3cce7454c5 100644 --- a/sw/source/ui/dialog/docstdlg.src +++ b/sw/source/ui/dialog/docstdlg.src @@ -140,6 +140,7 @@ TabPage TP_DOC_STAT }; PushButton PB_PDATE { + HelpID = "sw:PushButton:TP_DOC_STAT:PB_PDATE"; Pos = MAP_APPFONT ( 204 , 94 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Update" ; diff --git a/sw/source/ui/dialog/regionsw.src b/sw/source/ui/dialog/regionsw.src index e0da42f07f..833426fd8a 100644 --- a/sw/source/ui/dialog/regionsw.src +++ b/sw/source/ui/dialog/regionsw.src @@ -87,7 +87,7 @@ *************************************************************************/ ModalDialog MD_EDIT_REGION { - HelpID = FN_EDIT_REGION ; + HelpID = CMD_FN_EDIT_REGION ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 316 , 185 ) ; @@ -102,6 +102,7 @@ ModalDialog MD_EDIT_REGION }; Edit ED_RANAME { + HelpID = "sw:Edit:MD_EDIT_REGION:ED_RANAME"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 71 , 12 ) ; @@ -124,6 +125,7 @@ ModalDialog MD_EDIT_REGION }; TriStateBox CB_FILE { + HelpID = "sw:TriStateBox:MD_EDIT_REGION:CB_FILE"; Pos = MAP_APPFONT ( 98 , 14 ) ; Size = MAP_APPFONT ( 59 , 10 ) ; TabStop = TRUE ; @@ -131,6 +133,7 @@ ModalDialog MD_EDIT_REGION }; CheckBox CB_DDE { + HelpID = "sw:CheckBox:MD_EDIT_REGION:CB_DDE"; Pos = MAP_APPFONT ( 98 , 28 ) ; Size = MAP_APPFONT ( 30 , 10 ) ; Disable = TRUE ; @@ -152,6 +155,7 @@ ModalDialog MD_EDIT_REGION }; Edit ED_FILE { + HelpID = "sw:Edit:MD_EDIT_REGION:ED_FILE"; Border = TRUE ; Pos = MAP_APPFONT ( 165 , 42 ) ; Size = MAP_APPFONT ( 68 , 12 ) ; @@ -160,6 +164,7 @@ ModalDialog MD_EDIT_REGION }; PushButton PB_FILE { + HelpID = "sw:PushButton:MD_EDIT_REGION:PB_FILE"; Pos = MAP_APPFONT ( 239 , 42 ) ; Size = MAP_APPFONT ( 12 , 12 ) ; TabStop = TRUE ; @@ -175,6 +180,7 @@ ModalDialog MD_EDIT_REGION }; ComboBox LB_SUBREG { + HelpID = "sw:ComboBox:MD_EDIT_REGION:LB_SUBREG"; Pos = MAP_APPFONT ( 165 , 57 ) ; Size = MAP_APPFONT ( 68 , 50 ) ; Disable = TRUE ; @@ -191,6 +197,7 @@ ModalDialog MD_EDIT_REGION }; TriStateBox CB_PROTECT { + HelpID = "sw:TriStateBox:MD_EDIT_REGION:CB_PROTECT"; Pos = MAP_APPFONT ( 98 , 86 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; TabStop = TRUE ; @@ -200,6 +207,7 @@ ModalDialog MD_EDIT_REGION }; CheckBox CB_PASSWD { + HelpID = "sw:CheckBox:MD_EDIT_REGION:CB_PASSWD"; Pos = MAP_APPFONT ( 107 , 100 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; TabStop = TRUE ; @@ -207,6 +215,7 @@ ModalDialog MD_EDIT_REGION }; PushButton PB_PASSWD { + HelpID = "sw:PushButton:MD_EDIT_REGION:PB_PASSWD"; Pos = MAP_APPFONT ( 239 , 98 ) ; Size = MAP_APPFONT ( 12 , 12 ) ; TabStop = TRUE ; @@ -221,6 +230,7 @@ ModalDialog MD_EDIT_REGION }; TriStateBox CB_HIDE { + HelpID = "sw:TriStateBox:MD_EDIT_REGION:CB_HIDE"; Pos = MAP_APPFONT ( 98 , 127 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; TabStop = TRUE ; @@ -236,6 +246,7 @@ ModalDialog MD_EDIT_REGION }; Edit ED_CONDITION { + HelpID = "sw:Edit:MD_EDIT_REGION:ED_CONDITION"; Border = TRUE ; Pos = MAP_APPFONT ( 165 , 141) ; Size = MAP_APPFONT ( 86 , 12 ) ; @@ -252,6 +263,7 @@ ModalDialog MD_EDIT_REGION }; TriStateBox CB_EDIT_IN_READONLY { + HelpID = "sw:TriStateBox:MD_EDIT_REGION:CB_EDIT_IN_READONLY"; Pos = MAP_APPFONT ( 98 , 170 ) ; Size = MAP_APPFONT ( 156 , 10 ) ; TabStop = TRUE ; @@ -275,6 +287,7 @@ ModalDialog MD_EDIT_REGION }; PushButton PB_OPTIONS { + HelpID = "sw:PushButton:MD_EDIT_REGION:PB_OPTIONS"; Pos = MAP_APPFONT ( 263 , 40 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -283,6 +296,7 @@ ModalDialog MD_EDIT_REGION }; PushButton CB_DISMISS { + HelpID = "sw:PushButton:MD_EDIT_REGION:CB_DISMISS"; Pos = MAP_APPFONT ( 263 , 57 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Disable = TRUE ; @@ -412,6 +426,7 @@ TabPage TP_INSERT_SECTION }; ComboBox ED_RNAME { + HelpID = "sw:ComboBox:TP_INSERT_SECTION:ED_RNAME"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 69 , 140 ) ; TabStop = TRUE ; @@ -427,6 +442,7 @@ TabPage TP_INSERT_SECTION }; CheckBox CB_FILE { + HelpID = "sw:CheckBox:TP_INSERT_SECTION:CB_FILE"; Pos = MAP_APPFONT ( 96 , 14 ) ; Size = MAP_APPFONT ( 60 , 10 ) ; TabStop = TRUE ; @@ -434,6 +450,7 @@ TabPage TP_INSERT_SECTION }; CheckBox CB_DDE { + HelpID = "sw:CheckBox:TP_INSERT_SECTION:CB_DDE"; Pos = MAP_APPFONT ( 96 , 28) ; Size = MAP_APPFONT ( 60 , 10 ) ; Disable = TRUE ; @@ -455,6 +472,7 @@ TabPage TP_INSERT_SECTION }; Edit ED_FILE { + HelpID = "sw:Edit:TP_INSERT_SECTION:ED_FILE"; Border = TRUE ; Pos = MAP_APPFONT ( 160 , 42 ) ; Size = MAP_APPFONT ( 76 , 12 ) ; @@ -463,6 +481,7 @@ TabPage TP_INSERT_SECTION }; PushButton PB_FILE { + HelpID = "sw:PushButton:TP_INSERT_SECTION:PB_FILE"; Pos = MAP_APPFONT ( 239 , 42 ) ; Size = MAP_APPFONT ( 12 , 12 ) ; Disable = TRUE ; @@ -478,6 +497,7 @@ TabPage TP_INSERT_SECTION }; ComboBox LB_SUBREG { + HelpID = "sw:ComboBox:TP_INSERT_SECTION:LB_SUBREG"; Pos = MAP_APPFONT ( 160 , 58 ) ; Size = MAP_APPFONT ( 76 , 50 ) ; DropDown = TRUE ; @@ -494,6 +514,7 @@ TabPage TP_INSERT_SECTION }; CheckBox CB_PROTECT { + HelpID = "sw:CheckBox:TP_INSERT_SECTION:CB_PROTECT"; Pos = MAP_APPFONT ( 96 , 87 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; TabStop = TRUE ; @@ -501,6 +522,7 @@ TabPage TP_INSERT_SECTION }; CheckBox CB_PASSWD { + HelpID = "sw:CheckBox:TP_INSERT_SECTION:CB_PASSWD"; Pos = MAP_APPFONT ( 105 , 101 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; TabStop = TRUE ; @@ -508,6 +530,7 @@ TabPage TP_INSERT_SECTION }; PushButton PB_PASSWD { + HelpID = "sw:PushButton:TP_INSERT_SECTION:PB_PASSWD"; Pos = MAP_APPFONT ( 239 , 99 ) ; Size = MAP_APPFONT ( 12 , 12 ) ; TabStop = TRUE ; @@ -522,6 +545,7 @@ TabPage TP_INSERT_SECTION }; CheckBox CB_HIDE { + HelpID = "sw:CheckBox:TP_INSERT_SECTION:CB_HIDE"; Pos = MAP_APPFONT ( 96 , 128 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; CB_HIDE_TEXT @@ -535,6 +559,7 @@ TabPage TP_INSERT_SECTION }; Edit ED_CONDITION { + HelpID = "sw:Edit:TP_INSERT_SECTION:ED_CONDITION"; Border = TRUE ; Pos = MAP_APPFONT ( 160 , 142 ) ; Size = MAP_APPFONT ( 91 , 12 ) ; @@ -551,6 +576,7 @@ TabPage TP_INSERT_SECTION }; CheckBox CB_EDIT_IN_READONLY { + HelpID = "sw:CheckBox:TP_INSERT_SECTION:CB_EDIT_IN_READONLY"; Pos = MAP_APPFONT ( 96 , 170 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; CB_EDIT_IN_READONLY_TEXT @@ -615,6 +641,7 @@ TabPage TP_SECTION_FTNENDNOTES }; CheckBox CB_FTN_AT_TXTEND { + HelpID = "sw:CheckBox:TP_SECTION_FTNENDNOTES:CB_FTN_AT_TXTEND"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; TabStop = TRUE ; @@ -623,6 +650,7 @@ TabPage TP_SECTION_FTNENDNOTES }; CheckBox CB_FTN_NUM { + HelpID = "sw:CheckBox:TP_SECTION_FTNENDNOTES:CB_FTN_NUM"; Pos = MAP_APPFONT ( 18 , 29 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; TabStop = TRUE ; @@ -637,6 +665,7 @@ TabPage TP_SECTION_FTNENDNOTES }; NumericField FLD_FTN_OFFSET { + HelpID = "sw:NumericField:TP_SECTION_FTNENDNOTES:FLD_FTN_OFFSET"; Pos = MAP_APPFONT ( 90 , 44 ) ; Size = MAP_APPFONT ( 30 , 12 ) ; Spin = TRUE ; @@ -649,6 +678,7 @@ TabPage TP_SECTION_FTNENDNOTES }; CheckBox CB_FTN_NUM_FMT { + HelpID = "sw:CheckBox:TP_SECTION_FTNENDNOTES:CB_FTN_NUM_FMT"; Pos = MAP_APPFONT ( 24 , 61 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; TabStop = TRUE ; @@ -663,6 +693,7 @@ TabPage TP_SECTION_FTNENDNOTES }; Edit ED_FTN_PREFIX { + HelpID = "sw:Edit:TP_SECTION_FTNENDNOTES:ED_FTN_PREFIX"; Border = TRUE ; Pos = MAP_APPFONT ( 90 , 74 ) ; Size = MAP_APPFONT ( 30 , 12 ) ; @@ -672,6 +703,7 @@ TabPage TP_SECTION_FTNENDNOTES }; ListBox LB_FTN_NUMVIEW { + HelpID = "sw:ListBox:TP_SECTION_FTNENDNOTES:LB_FTN_NUMVIEW"; Border = TRUE ; Pos = MAP_APPFONT ( 123 , 74 ) ; Size = MAP_APPFONT ( 62 , 50 ) ; @@ -688,6 +720,7 @@ TabPage TP_SECTION_FTNENDNOTES }; Edit ED_FTN_SUFFIX { + HelpID = "sw:Edit:TP_SECTION_FTNENDNOTES:ED_FTN_SUFFIX"; Border = TRUE ; Pos = MAP_APPFONT ( 219 , 74 ) ; Size = MAP_APPFONT ( 30 , 12 ) ; @@ -706,6 +739,7 @@ TabPage TP_SECTION_FTNENDNOTES }; CheckBox CB_END_AT_TXTEND { + HelpID = "sw:CheckBox:TP_SECTION_FTNENDNOTES:CB_END_AT_TXTEND"; Pos = MAP_APPFONT ( 12 , 103 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; TabStop = TRUE ; @@ -713,6 +747,7 @@ TabPage TP_SECTION_FTNENDNOTES }; CheckBox CB_END_NUM { + HelpID = "sw:CheckBox:TP_SECTION_FTNENDNOTES:CB_END_NUM"; Pos = MAP_APPFONT ( 16 , 118 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; TabStop = TRUE ; @@ -727,6 +762,7 @@ TabPage TP_SECTION_FTNENDNOTES }; NumericField FLD_END_OFFSET { + HelpID = "sw:NumericField:TP_SECTION_FTNENDNOTES:FLD_END_OFFSET"; Pos = MAP_APPFONT ( 90 , 133 ) ; Size = MAP_APPFONT ( 30 , 12 ) ; Spin = TRUE ; @@ -739,6 +775,7 @@ TabPage TP_SECTION_FTNENDNOTES }; CheckBox CB_END_NUM_FMT { + HelpID = "sw:CheckBox:TP_SECTION_FTNENDNOTES:CB_END_NUM_FMT"; Pos = MAP_APPFONT ( 24 , 150 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; TabStop = TRUE ; @@ -754,6 +791,7 @@ TabPage TP_SECTION_FTNENDNOTES }; Edit ED_END_PREFIX { + HelpID = "sw:Edit:TP_SECTION_FTNENDNOTES:ED_END_PREFIX"; Border = TRUE ; Pos = MAP_APPFONT ( 90 , 163 ) ; Size = MAP_APPFONT ( 30 , 12 ) ; @@ -763,6 +801,7 @@ TabPage TP_SECTION_FTNENDNOTES }; ListBox LB_END_NUMVIEW { + HelpID = "sw:ListBox:TP_SECTION_FTNENDNOTES:LB_END_NUMVIEW"; Border = TRUE ; Pos = MAP_APPFONT ( 123 , 163 ) ; Size = MAP_APPFONT ( 62 , 50 ) ; @@ -780,6 +819,7 @@ TabPage TP_SECTION_FTNENDNOTES }; Edit ED_END_SUFFIX { + HelpID = "sw:Edit:TP_SECTION_FTNENDNOTES:ED_END_SUFFIX"; Border = TRUE ; Pos = MAP_APPFONT ( 219 , 163 ) ; Size = MAP_APPFONT ( 30 , 12 ) ; @@ -811,6 +851,7 @@ TabPage TP_SECTION_INDENTS }; MetricField MF_BEFORE { + HelpID = "sw:MetricField:TP_SECTION_INDENTS:MF_BEFORE"; Border = TRUE ; Pos = MAP_APPFONT ( 135 , 14 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -834,6 +875,7 @@ TabPage TP_SECTION_INDENTS }; MetricField MF_AFTER { + HelpID = "sw:MetricField:TP_SECTION_INDENTS:MF_AFTER"; Border = TRUE ; Pos = MAP_APPFONT ( 135 , 30 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 9af9dfbd0b..284b26135a 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -451,9 +451,9 @@ String AbstractInsFootNoteDlg_Impl::GetStr() { return pDlg->GetStr(); } -void AbstractInsFootNoteDlg_Impl::SetHelpId( ULONG nHelpId ) +void AbstractInsFootNoteDlg_Impl::SetHelpId( const rtl::OString& sHelpId ) { - pDlg->SetHelpId( nHelpId ); + pDlg->SetHelpId( sHelpId ); } void AbstractInsFootNoteDlg_Impl::SetText( const XubString& rStr ) { diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 8c3355bb6b..3793d6c57f 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -283,7 +283,7 @@ class AbstractInsFootNoteDlg_Impl : public AbstractInsFootNoteDlg virtual BOOL IsEndNote(); virtual String GetStr(); //from class Window - virtual void SetHelpId( ULONG nHelpId ); + virtual void SetHelpId( const rtl::OString& sHelpId ); virtual void SetText( const XubString& rStr ); }; //for SwInsFootNoteDlg end @@ -582,5 +582,3 @@ struct SwDialogsResMgr }; #endif - - diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 440457f0b1..01c8abcbbe 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -432,7 +432,7 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh ) aTree.SetHelpId(HID_REGION_TREE); aTree.SetSelectionMode( MULTIPLE_SELECTION ); - aTree.SetWindowBits(WB_HASBUTTONSATROOT|WB_CLIPCHILDREN|WB_HSCROLL); + aTree.SetStyle(aTree.GetStyle()|WB_HASBUTTONSATROOT|WB_CLIPCHILDREN|WB_HSCROLL); aTree.SetSpaceBetweenEntries(0); if(bWeb) diff --git a/sw/source/ui/dochdl/selglos.src b/sw/source/ui/dochdl/selglos.src index 81162518c1..5a79079fe7 100644 --- a/sw/source/ui/dochdl/selglos.src +++ b/sw/source/ui/dochdl/selglos.src @@ -33,7 +33,7 @@ // #define DLG_SEL_GLOS 256 ModalDialog DLG_SEL_GLOS { - HelpID = FN_EXPAND_GLOSSARY ; + HelpID = CMD_FN_EXPAND_GLOSSARY ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 220 , 100 ) ; @@ -68,6 +68,7 @@ ModalDialog DLG_SEL_GLOS }; ListBox LB_GLOS { + HelpID = "sw:ListBox:DLG_SEL_GLOS:LB_GLOS"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 140 , 74 ) ; diff --git a/sw/source/ui/docvw/AnnotationMenuButton.cxx b/sw/source/ui/docvw/AnnotationMenuButton.cxx index 6022a4646a..c49c689851 100644 --- a/sw/source/ui/docvw/AnnotationMenuButton.cxx +++ b/sw/source/ui/docvw/AnnotationMenuButton.cxx @@ -85,20 +85,13 @@ void AnnotationMenuButton::MouseButtonDown( const MouseEvent& rMEvt ) if ( mrSidebarWin.IsReadOnly() ) { pButtonPopup->EnableItem( FN_REPLY, false ); - pButtonPopup->EnableItem( FN_DELETE_NOTE, false ); + pButtonPopup->EnableItem( FN_DELETE_COMMENT, false ); pButtonPopup->EnableItem( FN_DELETE_NOTE_AUTHOR, false ); pButtonPopup->EnableItem( FN_DELETE_ALL_NOTES, false ); } else { - if ( mrSidebarWin.IsProtected() ) - { - pButtonPopup->EnableItem( FN_DELETE_NOTE, false ); - } - else - { - pButtonPopup->EnableItem( FN_DELETE_NOTE, true ); - } + pButtonPopup->EnableItem( FN_DELETE_COMMENT, !mrSidebarWin.IsProtected() ); pButtonPopup->EnableItem( FN_DELETE_NOTE_AUTHOR, true ); pButtonPopup->EnableItem( FN_DELETE_ALL_NOTES, true ); } diff --git a/sw/source/ui/docvw/AnnotationWin.cxx b/sw/source/ui/docvw/AnnotationWin.cxx index 91ea1e13b0..08fb91dcc3 100644 --- a/sw/source/ui/docvw/AnnotationWin.cxx +++ b/sw/source/ui/docvw/AnnotationWin.cxx @@ -208,7 +208,8 @@ void SwAnnotationWin::InitAnswer(OutlinerParaObject* pText) { //collect our old meta data SwSidebarWin* pWin = Mgr().GetNextPostIt(KEY_PAGEUP, this); - const LocaleDataWrapper& rLocalData = SvtSysLocale().GetLocaleData(); + const SvtSysLocale aSysLocale; + const LocaleDataWrapper& rLocalData = aSysLocale.GetLocaleData(); String aText = String(SW_RES(STR_REPLY)); SwRewriter aRewriter; aRewriter.AddRule(UNDO_ARG1, pWin->GetAuthor()); diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx index 8caf11c84d..8ce45ae318 100755..100644 --- a/sw/source/ui/docvw/SidebarWin.cxx +++ b/sw/source/ui/docvw/SidebarWin.cxx @@ -389,7 +389,8 @@ void SwSidebarWin::InitControls() void SwSidebarWin::CheckMetaText() { - const LocaleDataWrapper& rLocalData = SvtSysLocale().GetLocaleData(); + const SvtSysLocale aSysLocale; + const LocaleDataWrapper& rLocalData = aSysLocale.GetLocaleData(); String sMeta = GetAuthor(); if (sMeta.Len() == 0) { @@ -934,7 +935,6 @@ void SwSidebarWin::ExecuteCommand(USHORT nSlot) break; } case FN_DELETE_COMMENT: - case FN_DELETE_NOTE: //Delete(); // do not kill the parent of our open popup menu mnEventId = Application::PostUserEvent( LINK( this, SwSidebarWin, DeleteHdl), 0 ); diff --git a/sw/source/ui/docvw/docvw.src b/sw/source/ui/docvw/docvw.src index dcd0f98103..459b673cb1 100644 --- a/sw/source/ui/docvw/docvw.src +++ b/sw/source/ui/docvw/docvw.src @@ -36,56 +36,56 @@ Menu MN_READONLY_POPUP MenuItem { Identifier = MN_READONLY_OPENURL ; - HelpID = SID_OPENDOC ; + HelpId = CMD_SID_OPENDOC ; Text [ en-US ] = "~Open" ; }; MenuItem { Identifier = MN_READONLY_OPENURLNEW ; - HelpID = SID_OPENDOC ; + HelpId = CMD_SID_OPENDOC ; Text [ en-US ] = "Open in New Window" ; }; MenuItem { Identifier = MN_READONLY_EDITDOC ; - HelpID = SID_EDITDOC ; + HelpId = CMD_SID_EDITDOC ; Text [ en-US ] = "~Edit" ; }; MenuItem { Identifier = MN_READONLY_SELECTION_MODE ; - HelpID = FN_READONLY_SELECTION_MODE ; + HelpId = CMD_FN_READONLY_SELECTION_MODE ; Text [ en-US ] = "Select Text"; }; MenuItem { Identifier = MN_READONLY_RELOAD; - HelpID = SID_RELOAD; + HelpId = CMD_SID_RELOAD; Text [ en-US ] = "Re~load"; }; MenuItem { Identifier = MN_READONLY_RELOAD_FRAME; - HelpID = SID_RELOAD; + HelpId = CMD_SID_RELOAD; Text [ en-US ] = "Reload Frame"; }; MenuItem { Identifier = MN_READONLY_SOURCEVIEW ; - HelpID = HID_SOURCEVIEW ; + HelpId = HID_SOURCEVIEW ; Text [ en-US ] = "HT~ML Source" ; }; SEPARATOR MenuItem { Identifier = MN_READONLY_BROWSE_BACKWARD ; - HelpID = SID_BROWSE_BACKWARD ; + HelpId = CMD_SID_BROWSE_BACKWARD ; Text [ en-US ] = "Backwards" ; }; MenuItem { Identifier = MN_READONLY_BROWSE_FORWARD ; - HelpID = SID_BROWSE_FORWARD ; + HelpId = CMD_SID_BROWSE_FORWARD ; Text [ en-US ] = "~Forward" ; }; SEPARATOR @@ -190,14 +190,14 @@ Menu MN_READONLY_POPUP MenuItem { Identifier = SID_WIN_FULLSCREEN; - HelpID = SID_WIN_FULLSCREEN; + HelpId = CMD_SID_WIN_FULLSCREEN; Text [ en-US ] = "Leave Full-Screen Mode" ; }; SEPARATOR MenuItem { Identifier = MN_READONLY_COPY ; - HelpID = SID_COPY; + HelpId = CMD_SID_COPY; Text [ en-US ] = "~Copy" ; }; }; diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx index 8aa6c2e766..f84c74f0a2 100644 --- a/sw/source/ui/docvw/edtwin2.cxx +++ b/sw/source/ui/docvw/edtwin2.cxx @@ -304,8 +304,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) { USHORT nOldSubType = pFld->GetSubType(); ((SwField*)pFld)->SetSubType(nsSwExtendedSubType::SUB_CMD); - sTxt = - pFld->ExpandField(rSh.GetDoc()->IsClipBoard()); + sTxt = pFld->ExpandField(true); ((SwField*)pFld)->SetSubType(nOldSubType); } break; @@ -340,7 +339,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) break; case RES_DBFLD: - sTxt = ((SwDBField*)pFld)->GetCntnt(TRUE); + sTxt = pFld->GetFieldName(); break; case RES_USERFLD: diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx index 2ea48e2a7e..be71b1aa38 100644 --- a/sw/source/ui/docvw/srcedtw.cxx +++ b/sw/source/ui/docvw/srcedtw.cxx @@ -62,6 +62,8 @@ #ifndef _HELPID_H #include <helpid.h> #endif +#include <deque> + struct SwTextPortion @@ -75,17 +77,8 @@ struct SwTextPortion #define MAX_HIGHLIGHTTIME 200 #define SYNTAX_HIGHLIGHT_TIMEOUT 200 -SV_DECL_VARARR(SwTextPortions, SwTextPortion,16,16) - -/* -----------------15.01.97 12.07------------------- - ---------------------------------------------------*/ +typedef std::deque<SwTextPortion> SwTextPortions; -SV_IMPL_VARARR(SwTextPortions, SwTextPortion) - -/*-----------------15.01.97 12.08------------------- - ---------------------------------------------------*/ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) { @@ -101,11 +94,11 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) const USHORT nStrLen = rSource.Len(); - USHORT nInsert = 0; // Anzahl der eingefuegten Portions - USHORT nActPos = 0; //Position, an der '<' gefunden wurde - USHORT nOffset = 0; //Offset von nActPos zur '<' - USHORT nPortStart = USHRT_MAX; // fuer die TextPortion - USHORT nPortEnd = 0; // + USHORT nInsert = 0; // Number of inserted Portions + USHORT nActPos = 0; // Position, at the '<' was found + USHORT nOffset = 0; // Offset of nActPos for '<' + USHORT nPortStart = USHRT_MAX; // For the TextPortion + USHORT nPortEnd = 0; // SwTextPortion aText; while(nActPos < nStrLen) { @@ -122,7 +115,8 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) aText.nStart += 1; aText.nEnd = nActPos - 1; aText.eType = svtools::HTMLUNKNOWN; - aPortionList.Insert(aText, nInsert++); + aPortionList.push_back( aText ); + nInsert++; } sal_Unicode cFollowFirst = rSource.GetChar((xub_StrLen)(nActPos + 1)); sal_Unicode cFollowNext = rSource.GetChar((xub_StrLen)(nActPos + 2)); @@ -212,7 +206,8 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) aTextPortion.nStart = nPortStart + 1; aTextPortion.nEnd = nPortEnd; aTextPortion.eType = eFoundType; - aPortionList.Insert(aTextPortion, nInsert++); + aPortionList.push_back( aTextPortion ); + nInsert++; eFoundType = svtools::HTMLUNKNOWN; } @@ -226,7 +221,8 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) aText.nStart = nPortEnd + 1; aText.nEnd = nActPos - 1; aText.eType = svtools::HTMLUNKNOWN; - aPortionList.Insert(aText, nInsert++); + aPortionList.push_back( aText ); + nInsert++; } } @@ -749,7 +745,7 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff ) SwTextPortions aPortionList; lcl_Highlight(rSource, aPortionList); - USHORT nCount = aPortionList.Count(); + size_t nCount = aPortionList.size(); if ( !nCount ) return; @@ -757,7 +753,7 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff ) if ( rLast.nStart > rLast.nEnd ) // Nur bis Bug von MD behoeben { nCount--; - aPortionList.Remove( nCount); + aPortionList.pop_back(); if ( !nCount ) return; } @@ -777,7 +773,7 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff ) #ifdef DBG_UTIL USHORT nLine = aPortionList[0].nLine; #endif - for ( USHORT i = 0; i < nCount; i++ ) + for ( size_t i = 0; i < nCount; i++ ) { SwTextPortion& r = aPortionList[i]; DBG_ASSERT( r.nLine == nLine, "doch mehrere Zeilen ?" ); @@ -796,7 +792,7 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff ) } } - for ( USHORT i = 0; i < aPortionList.Count(); i++ ) + for ( size_t i = 0; i < aPortionList.size(); i++ ) { SwTextPortion& r = aPortionList[i]; if ( r.nStart > r.nEnd ) // Nur bis Bug von MD behoeben diff --git a/sw/source/ui/envelp/envfmt.src b/sw/source/ui/envelp/envfmt.src index 16987430b7..ccca0c6b44 100644 --- a/sw/source/ui/envelp/envfmt.src +++ b/sw/source/ui/envelp/envfmt.src @@ -57,6 +57,7 @@ TabPage TP_ENV_FMT }; MetricField FLD_ADDR_LEFT { + HelpID = "sw:MetricField:TP_ENV_FMT:FLD_ADDR_LEFT"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 25 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -81,6 +82,7 @@ TabPage TP_ENV_FMT }; MetricField FLD_ADDR_TOP { + HelpID = "sw:MetricField:TP_ENV_FMT:FLD_ADDR_TOP"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 41 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -105,6 +107,7 @@ TabPage TP_ENV_FMT }; MenuButton BTN_ADDR_EDIT { + HelpID = "sw:MenuButton:TP_ENV_FMT:BTN_ADDR_EDIT"; Pos = MAP_APPFONT ( 194 , 24 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -132,6 +135,7 @@ TabPage TP_ENV_FMT }; MetricField FLD_SEND_LEFT { + HelpID = "sw:MetricField:TP_ENV_FMT:FLD_SEND_LEFT"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 78 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -156,6 +160,7 @@ TabPage TP_ENV_FMT }; MetricField FLD_SEND_TOP { + HelpID = "sw:MetricField:TP_ENV_FMT:FLD_SEND_TOP"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 94 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -180,6 +185,7 @@ TabPage TP_ENV_FMT }; MenuButton BTN_SEND_EDIT { + HelpID = "sw:MenuButton:TP_ENV_FMT:BTN_SEND_EDIT"; Pos = MAP_APPFONT ( 194 , 77 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "Edit" ; @@ -200,6 +206,7 @@ TabPage TP_ENV_FMT }; ListBox BOX_SIZE_FORMAT { + HelpID = "sw:ListBox:TP_ENV_FMT:BOX_SIZE_FORMAT"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 120 ) ; Size = MAP_APPFONT ( 40 , 72 ) ; @@ -215,6 +222,7 @@ TabPage TP_ENV_FMT }; MetricField FLD_SIZE_WIDTH { + HelpID = "sw:MetricField:TP_ENV_FMT:FLD_SIZE_WIDTH"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 136 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -239,6 +247,7 @@ TabPage TP_ENV_FMT }; MetricField FLD_SIZE_HEIGHT { + HelpID = "sw:MetricField:TP_ENV_FMT:FLD_SIZE_HEIGHT"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 152 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; diff --git a/sw/source/ui/envelp/envlop.src b/sw/source/ui/envelp/envlop.src index 2c025633b0..8f27ff976d 100644 --- a/sw/source/ui/envelp/envlop.src +++ b/sw/source/ui/envelp/envlop.src @@ -86,6 +86,7 @@ TabPage TP_ENV_ENV }; MultiLineEdit EDT_ADDR { + HelpID = "sw:MultiLineEdit:TP_ENV_ENV:EDT_ADDR"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 17 ) ; Size = MAP_APPFONT ( 124 , 66 ) ; @@ -103,6 +104,7 @@ TabPage TP_ENV_ENV }; ListBox LB_DATABASE { + HelpID = "sw:ListBox:TP_ENV_ENV:LB_DATABASE"; Border = TRUE ; Pos = MAP_APPFONT ( 162 , 17 ) ; Size = MAP_APPFONT ( 82 , 50 ) ; @@ -117,6 +119,7 @@ TabPage TP_ENV_ENV }; ListBox LB_TABLE { + HelpID = "sw:ListBox:TP_ENV_ENV:LB_TABLE"; Border = TRUE ; Pos = MAP_APPFONT ( 162 , 44 ) ; Size = MAP_APPFONT ( 82 , 50 ) ; @@ -125,6 +128,7 @@ TabPage TP_ENV_ENV }; ImageButton BTN_INSERT { + HelpID = "sw:ImageButton:TP_ENV_ENV:BTN_INSERT"; Pos = MAP_APPFONT ( 137 , 71 ) ; Size = MAP_APPFONT ( 18 , 12 ) ; SYMBOL = IMAGEBUTTON_ARROW_LEFT ; @@ -138,6 +142,7 @@ TabPage TP_ENV_ENV }; ListBox LB_DBFIELD { + HelpID = "sw:ListBox:TP_ENV_ENV:LB_DBFIELD"; Border = TRUE ; Pos = MAP_APPFONT ( 162 , 71 ) ; Size = MAP_APPFONT ( 82 , 50 ) ; @@ -146,6 +151,7 @@ TabPage TP_ENV_ENV }; CheckBox BOX_SEND { + HelpID = "sw:CheckBox:TP_ENV_ENV:BOX_SEND"; Pos = MAP_APPFONT ( 6 , 105 ) ; Size = MAP_APPFONT ( 124 , 8 ) ; Text [ en-US ] = "~Sender" ; @@ -153,6 +159,7 @@ TabPage TP_ENV_ENV }; MultiLineEdit EDT_SEND { + HelpID = "sw:MultiLineEdit:TP_ENV_ENV:EDT_SEND"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 116) ; Size = MAP_APPFONT ( 124 , 63 ) ; diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx index 12b0f1f38f..2c68ee52a6 100644 --- a/sw/source/ui/envelp/envlop1.cxx +++ b/sw/source/ui/envelp/envlop1.cxx @@ -103,9 +103,9 @@ void SwEnvPreview::Paint(const Rectangle &) USHORT nPageW = (USHORT) Max(rItem.lWidth, rItem.lHeight), nPageH = (USHORT) Min(rItem.lWidth, rItem.lHeight); - float fx = static_cast< float >(GetOutputSizePixel().Width () / nPageW), - fy = static_cast< float >(GetOutputSizePixel().Height() / nPageH), - f = static_cast< float >(0.8 * ( fx < fy ? fx : fy )); + float fx = (float)GetOutputSizePixel().Width () / (float)nPageW, + fy = (float)GetOutputSizePixel().Height() / (float)nPageH, + f = 0.8f * ( fx < fy ? fx : fy ); Color aBack = rSettings.GetWindowColor( ); Color aFront = SwViewOption::GetFontColor(); diff --git a/sw/source/ui/envelp/envprt.src b/sw/source/ui/envelp/envprt.src index 25a92fcda2..6b5801b0cf 100644 --- a/sw/source/ui/envelp/envprt.src +++ b/sw/source/ui/envelp/envprt.src @@ -49,37 +49,38 @@ TabPage TP_ENV_PRT ToolBoxItem { Identifier = ITM_HOR_LEFT ; - HelpID = ITM_HOR_LEFT ; + HelpID = HID_ITM_HOR_LEFT ; }; ToolBoxItem { Identifier = ITM_HOR_CNTR ; - HelpID = ITM_HOR_CNTR ; + HelpID = HID_ITM_HOR_CNTR ; }; ToolBoxItem { Identifier = ITM_HOR_RGHT ; - HelpID = ITM_HOR_RGHT ; + HelpID = HID_ITM_HOR_RGHT ; }; ToolBoxItem { Identifier = ITM_VER_LEFT ; - HelpID = ITM_VER_LEFT ; + HelpID = HID_ITM_VER_LEFT ; }; ToolBoxItem { Identifier = ITM_VER_CNTR ; - HelpID = ITM_VER_CNTR ; + HelpID = HID_ITM_VER_CNTR ; }; ToolBoxItem { Identifier = ITM_VER_RGHT ; - HelpID = ITM_VER_RGHT ; + HelpID = HID_ITM_VER_RGHT ; }; }; }; RadioButton BTN_TOP { + HelpID = "sw:RadioButton:TP_ENV_PRT:BTN_TOP"; Pos = MAP_APPFONT ( 18 , 42 ) ; Size = MAP_APPFONT ( 179 , 10 ) ; Text [ en-US ] = "~Print from top" ; @@ -89,6 +90,7 @@ TabPage TP_ENV_PRT }; RadioButton BTN_BOTTOM { + HelpID = "sw:RadioButton:TP_ENV_PRT:BTN_BOTTOM"; Pos = MAP_APPFONT ( 18 , 56 ) ; Size = MAP_APPFONT ( 179 , 10 ) ; Text [ en-US ] = "Print from ~bottom" ; @@ -103,6 +105,7 @@ TabPage TP_ENV_PRT }; MetricField FLD_RIGHT { + HelpID = "sw:MetricField:TP_ENV_PRT:FLD_RIGHT"; Border = TRUE ; Pos = MAP_APPFONT ( 86 , 72 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -127,6 +130,7 @@ TabPage TP_ENV_PRT }; MetricField FLD_DOWN { + HelpID = "sw:MetricField:TP_ENV_PRT:FLD_DOWN"; Border = TRUE ; Pos = MAP_APPFONT ( 86 , 88 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -157,6 +161,7 @@ TabPage TP_ENV_PRT }; PushButton BTN_PRTSETUP { + HelpID = "sw:PushButton:TP_ENV_PRT:BTN_PRTSETUP"; Pos = MAP_APPFONT ( 198 , 114 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; diff --git a/sw/source/ui/envelp/label.src b/sw/source/ui/envelp/label.src index f2200a0c44..dbcea27b94 100644 --- a/sw/source/ui/envelp/label.src +++ b/sw/source/ui/envelp/label.src @@ -110,6 +110,7 @@ TabPage TP_LAB_LAB }; CheckBox BOX_ADDR { + HelpID = "sw:CheckBox:TP_LAB_LAB:BOX_ADDR"; Pos = MAP_APPFONT ( 67 , 14 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; TabStop = TRUE ; @@ -117,6 +118,7 @@ TabPage TP_LAB_LAB }; MultiLineEdit EDT_WRITING { + HelpID = "sw:MultiLineEdit:TP_LAB_LAB:EDT_WRITING"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 105 , 89 ) ; @@ -134,6 +136,7 @@ TabPage TP_LAB_LAB }; ListBox LB_DATABASE { + HelpID = "sw:ListBox:TP_LAB_LAB:LB_DATABASE"; Border = TRUE ; Pos = MAP_APPFONT ( 149 , 27 ) ; Size = MAP_APPFONT ( 99 , 70 ) ; @@ -148,6 +151,7 @@ TabPage TP_LAB_LAB }; ListBox LB_TABLE { + HelpID = "sw:ListBox:TP_LAB_LAB:LB_TABLE"; Border = TRUE ; Pos = MAP_APPFONT ( 149 , 56 ) ; Size = MAP_APPFONT ( 99 , 70 ) ; @@ -156,6 +160,7 @@ TabPage TP_LAB_LAB }; ImageButton BTN_INSERT { + HelpID = "sw:ImageButton:TP_LAB_LAB:BTN_INSERT"; Pos = MAP_APPFONT ( 124 , 92 ) ; Size = MAP_APPFONT ( 18 , 12 ) ; SYMBOL = IMAGEBUTTON_ARROW_LEFT ; @@ -169,6 +174,7 @@ TabPage TP_LAB_LAB }; ListBox LB_DBFIELD { + HelpID = "sw:ListBox:TP_LAB_LAB:LB_DBFIELD"; Border = TRUE ; Pos = MAP_APPFONT ( 149 , 92 ) ; Size = MAP_APPFONT ( 99 , 70 ) ; @@ -184,6 +190,7 @@ TabPage TP_LAB_LAB }; RadioButton BTN_CONT { + HelpID = "sw:RadioButton:TP_LAB_LAB:BTN_CONT"; Pos = MAP_APPFONT ( 12 , 137 ) ; Size = MAP_APPFONT ( 65 , 10 ) ; TabStop = TRUE ; @@ -192,6 +199,7 @@ TabPage TP_LAB_LAB }; RadioButton BTN_SHEET { + HelpID = "sw:RadioButton:TP_LAB_LAB:BTN_SHEET"; Pos = MAP_APPFONT ( 12 , 153 ) ; Size = MAP_APPFONT ( 65 , 10 ) ; Text [ en-US ] = "~Sheet" ; @@ -205,6 +213,7 @@ TabPage TP_LAB_LAB }; ListBox BOX_MAKE { + HelpID = "sw:ListBox:TP_LAB_LAB:BOX_MAKE"; Border = TRUE ; Pos = MAP_APPFONT ( 124 , 136 ) ; Size = MAP_APPFONT ( 124 , 90 ) ; @@ -220,6 +229,7 @@ TabPage TP_LAB_LAB }; ListBox BOX_TYPE { + HelpID = "sw:ListBox:TP_LAB_LAB:BOX_TYPE"; Border = TRUE ; Pos = MAP_APPFONT ( 124 , 152 ) ; Size = MAP_APPFONT ( 124 , 90 ) ; @@ -255,6 +265,7 @@ FloatingWindow DLG_SYNC_BTN Hide = TRUE ; PushButton BTN_SYNC { + HelpID = "sw:PushButton:DLG_SYNC_BTN:BTN_SYNC"; Pos = MAP_APPFONT ( 1 , 1 ) ; Size = MAP_APPFONT ( WIDTH - 1 , HEIGHT - 1 ) ; Text [ en-US ] = "Synchronize Labels" ; @@ -291,6 +302,7 @@ TabPage TP_VISITING_CARDS }; ListBox LB_AUTO_TEXT_GROUP { + HelpID = "sw:ListBox:TP_VISITING_CARDS:LB_AUTO_TEXT_GROUP"; Pos = MAP_APPFONT ( 12 , 164) ; Size = MAP_APPFONT ( 109 , 50 ) ; Border = TRUE ; @@ -332,18 +344,21 @@ TabPage TP_PRIVATE_DATA }; Edit ED_FIRSTNAME { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_FIRSTNAME"; Pos = MAP_APPFONT ( 105 , 14 ) ; Size = MAP_APPFONT ( 55 , 12 ) ; Border = TRUE ; }; Edit ED_NAME { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_NAME"; Pos = MAP_APPFONT ( 163 , 14 ) ; Size = MAP_APPFONT ( 55 , 12 ) ; Border = TRUE ; }; Edit ED_SHORTCUT { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_SHORTCUT"; Pos = MAP_APPFONT ( 221 , 14 ) ; Size = MAP_APPFONT ( 27 , 12 ) ; Border = TRUE ; @@ -356,18 +371,21 @@ TabPage TP_PRIVATE_DATA }; Edit ED_FIRSTNAME_2 { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_FIRSTNAME_2"; Pos = MAP_APPFONT ( 105 , 30 ) ; Size = MAP_APPFONT ( 55 , 12 ) ; Border = TRUE ; }; Edit ED_NAME_2 { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_NAME_2"; Pos = MAP_APPFONT ( 163 , 30 ) ; Size = MAP_APPFONT ( 55 , 12 ) ; Border = TRUE ; }; Edit ED_SHORTCUT_2 { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_SHORTCUT_2"; Pos = MAP_APPFONT ( 221 , 30 ) ; Size = MAP_APPFONT ( 27 , 12 ) ; Border = TRUE ; @@ -380,6 +398,7 @@ TabPage TP_PRIVATE_DATA }; Edit ED_STREET { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_STREET"; Pos = MAP_APPFONT ( 105 , 46 ) ; Size = MAP_APPFONT ( 143 , 12 ) ; Border = TRUE ; @@ -392,12 +411,14 @@ TabPage TP_PRIVATE_DATA }; Edit ED_ZIP { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_ZIP"; Pos = MAP_APPFONT ( 105 , 62 ) ; Size = MAP_APPFONT ( 50 , 12 ) ; Border = TRUE ; }; Edit ED_CITY { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_CITY"; Pos = MAP_APPFONT ( 158 , 62 ) ; Size = MAP_APPFONT ( 90 , 12 ) ; Border = TRUE ; @@ -410,12 +431,14 @@ TabPage TP_PRIVATE_DATA }; Edit ED_COUNTRY { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_COUNTRY"; Pos = MAP_APPFONT ( 105 , 78 ) ; Size = MAP_APPFONT ( 71 , 12 ) ; Border = TRUE ; }; Edit ED_STATE { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_STATE"; Pos = MAP_APPFONT ( 179 , 78 ) ; Size = MAP_APPFONT ( 69 , 12 ) ; Border = TRUE ; @@ -428,12 +451,14 @@ TabPage TP_PRIVATE_DATA }; Edit ED_TITLE { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_TITLE"; Pos = MAP_APPFONT ( 105 , 94 ) ; Size = MAP_APPFONT ( 71 , 12 ) ; Border = TRUE ; }; Edit ED_PROFESSION { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_PROFESSION"; Pos = MAP_APPFONT ( 179 , 94 ) ; Size = MAP_APPFONT ( 69 , 12 ) ; Border = TRUE ; @@ -446,12 +471,14 @@ TabPage TP_PRIVATE_DATA }; Edit ED_PHONE { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_PHONE"; Pos = MAP_APPFONT ( 105 , 110 ) ; Size = MAP_APPFONT ( 71 , 12 ) ; Border = TRUE ; }; Edit ED_MOBILE { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_MOBILE"; Pos = MAP_APPFONT ( 179 , 110 ) ; Size = MAP_APPFONT ( 69 , 12 ) ; Border = TRUE ; @@ -464,6 +491,7 @@ TabPage TP_PRIVATE_DATA }; Edit ED_FAX { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_FAX"; Pos = MAP_APPFONT ( 105 , 126 ) ; Size = MAP_APPFONT ( 143 , 12 ) ; Border = TRUE ; @@ -476,12 +504,14 @@ TabPage TP_PRIVATE_DATA }; Edit ED_WWW { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_WWW"; Pos = MAP_APPFONT ( 105 , 142) ; Size = MAP_APPFONT ( 71 , 12 ) ; Border = TRUE ; }; Edit ED_MAIL { + HelpID = "sw:Edit:TP_PRIVATE_DATA:ED_MAIL"; Pos = MAP_APPFONT ( 179 , 142) ; Size = MAP_APPFONT ( 69 , 12 ) ; Border = TRUE ; @@ -506,6 +536,7 @@ TabPage TP_BUSINESS_DATA }; Edit ED_COMP { + HelpID = "sw:Edit:TP_BUSINESS_DATA:ED_COMP"; Pos = MAP_APPFONT ( 105 , 14) ; Size = MAP_APPFONT ( 143 , 12 ) ; Border = TRUE ; @@ -518,6 +549,7 @@ TabPage TP_BUSINESS_DATA }; Edit ED_COMP_EXT { + HelpID = "sw:Edit:TP_BUSINESS_DATA:ED_COMP_EXT"; Pos = MAP_APPFONT ( 105 , 30) ; Size = MAP_APPFONT ( 143 , 12 ) ; Border = TRUE ; @@ -530,6 +562,7 @@ TabPage TP_BUSINESS_DATA }; Edit ED_SLOGAN { + HelpID = "sw:Edit:TP_BUSINESS_DATA:ED_SLOGAN"; Pos = MAP_APPFONT ( 105 , 46) ; Size = MAP_APPFONT ( 143 , 12 ) ; Border = TRUE ; @@ -542,6 +575,7 @@ TabPage TP_BUSINESS_DATA }; Edit ED_STREET { + HelpID = "sw:Edit:TP_BUSINESS_DATA:ED_STREET"; Pos = MAP_APPFONT ( 105 , 62) ; Size = MAP_APPFONT ( 143 , 12 ) ; Border = TRUE ; @@ -554,12 +588,14 @@ TabPage TP_BUSINESS_DATA }; Edit ED_ZIP { + HelpID = "sw:Edit:TP_BUSINESS_DATA:ED_ZIP"; Pos = MAP_APPFONT ( 105 , 78) ; Size = MAP_APPFONT ( 50 , 12 ) ; Border = TRUE ; }; Edit ED_CITY { + HelpID = "sw:Edit:TP_BUSINESS_DATA:ED_CITY"; Pos = MAP_APPFONT ( 158 , 78) ; Size = MAP_APPFONT ( 90 , 12 ) ; Border = TRUE ; @@ -572,12 +608,14 @@ TabPage TP_BUSINESS_DATA }; Edit ED_COUNTRY { + HelpID = "sw:Edit:TP_BUSINESS_DATA:ED_COUNTRY"; Pos = MAP_APPFONT ( 105 , 94) ; Size = MAP_APPFONT ( 71 , 12 ) ; Border = TRUE ; }; Edit ED_STATE { + HelpID = "sw:Edit:TP_BUSINESS_DATA:ED_STATE"; Pos = MAP_APPFONT ( 179 , 94) ; Size = MAP_APPFONT ( 69 , 12 ) ; Border = TRUE ; @@ -590,6 +628,7 @@ TabPage TP_BUSINESS_DATA }; Edit ED_POSITION { + HelpID = "sw:Edit:TP_BUSINESS_DATA:ED_POSITION"; Pos = MAP_APPFONT ( 105 , 110) ; Size = MAP_APPFONT ( 143 , 12 ) ; Border = TRUE ; @@ -602,12 +641,14 @@ TabPage TP_BUSINESS_DATA }; Edit ED_PHONE { + HelpID = "sw:Edit:TP_BUSINESS_DATA:ED_PHONE"; Pos = MAP_APPFONT ( 105 , 126) ; Size = MAP_APPFONT ( 71 , 12 ) ; Border = TRUE ; }; Edit ED_MOBILE { + HelpID = "sw:Edit:TP_BUSINESS_DATA:ED_MOBILE"; Pos = MAP_APPFONT ( 179 , 126) ; Size = MAP_APPFONT ( 69 , 12 ) ; Border = TRUE ; @@ -620,6 +661,7 @@ TabPage TP_BUSINESS_DATA }; Edit ED_FAX { + HelpID = "sw:Edit:TP_BUSINESS_DATA:ED_FAX"; Pos = MAP_APPFONT ( 105 , 142) ; Size = MAP_APPFONT ( 143 , 12 ) ; Border = TRUE ; @@ -632,12 +674,14 @@ TabPage TP_BUSINESS_DATA }; Edit ED_WWW { + HelpID = "sw:Edit:TP_BUSINESS_DATA:ED_WWW"; Pos = MAP_APPFONT ( 105 , 158) ; Size = MAP_APPFONT ( 71 , 12 ) ; Border = TRUE ; }; Edit ED_MAIL { + HelpID = "sw:Edit:TP_BUSINESS_DATA:ED_MAIL"; Pos = MAP_APPFONT ( 179 , 158) ; Size = MAP_APPFONT ( 69 , 12 ) ; Border = TRUE ; diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx index 05c2cf90be..a9f6af7ba6 100644 --- a/sw/source/ui/envelp/label1.cxx +++ b/sw/source/ui/envelp/label1.cxx @@ -724,7 +724,7 @@ SwVisitingCardPage::SwVisitingCardPage(Window* pParent, const SfxItemSet& rSet) pExampleFrame(0) { FreeResource(); - aAutoTextLB.SetWindowBits( WB_HSCROLL ); + aAutoTextLB.SetStyle( aAutoTextLB.GetStyle() | WB_HSCROLL ); aAutoTextLB.SetSpaceBetweenEntries(0); aAutoTextLB.SetSelectionMode( SINGLE_SELECTION ); aAutoTextLB.SetHelpId(HID_BUSINESS_CARD_CONTENT); diff --git a/sw/source/ui/envelp/labfmt.src b/sw/source/ui/envelp/labfmt.src index 8d39f44b58..107791b2e8 100644 --- a/sw/source/ui/envelp/labfmt.src +++ b/sw/source/ui/envelp/labfmt.src @@ -61,6 +61,7 @@ TabPage TP_LAB_FMT }; MetricField FLD_HDIST { + HelpID = "sw:MetricField:TP_LAB_FMT:FLD_HDIST"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 17 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -81,6 +82,7 @@ TabPage TP_LAB_FMT }; MetricField FLD_VDIST { + HelpID = "sw:MetricField:TP_LAB_FMT:FLD_VDIST"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 33 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -101,6 +103,7 @@ TabPage TP_LAB_FMT }; MetricField FLD_WIDTH { + HelpID = "sw:MetricField:TP_LAB_FMT:FLD_WIDTH"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 49 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -121,6 +124,7 @@ TabPage TP_LAB_FMT }; MetricField FLD_HEIGHT { + HelpID = "sw:MetricField:TP_LAB_FMT:FLD_HEIGHT"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 65 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -141,6 +145,7 @@ TabPage TP_LAB_FMT }; MetricField FLD_LEFT { + HelpID = "sw:MetricField:TP_LAB_FMT:FLD_LEFT"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 81 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -163,6 +168,7 @@ TabPage TP_LAB_FMT }; MetricField FLD_UPPER { + HelpID = "sw:MetricField:TP_LAB_FMT:FLD_UPPER"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 97 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -185,6 +191,7 @@ TabPage TP_LAB_FMT }; NumericField FLD_COLUMNS { + HelpID = "sw:NumericField:TP_LAB_FMT:FLD_COLUMNS"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 113 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -204,6 +211,7 @@ TabPage TP_LAB_FMT }; NumericField FLD_ROWS { + HelpID = "sw:NumericField:TP_LAB_FMT:FLD_ROWS"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 129 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -216,6 +224,7 @@ TabPage TP_LAB_FMT }; PushButton PB_SAVE { + HelpID = "sw:PushButton:TP_LAB_FMT:PB_SAVE"; Pos = MAP_APPFONT ( 50 , 148 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Save..."; @@ -270,6 +279,7 @@ ModalDialog DLG_SAVE_LABEL }; ComboBox CB_MAKE { + HelpID = "sw:ComboBox:DLG_SAVE_LABEL:CB_MAKE"; Pos = MAP_APPFONT ( 65 , 15 ) ; Size = MAP_APPFONT ( 100 , 50 ) ; Border = TRUE; @@ -284,6 +294,7 @@ ModalDialog DLG_SAVE_LABEL }; Edit ED_TYPE { + HelpID = "sw:Edit:DLG_SAVE_LABEL:ED_TYPE"; Pos = MAP_APPFONT ( 65 , 30 ) ; Size = MAP_APPFONT ( 100 , 12 ) ; Border = TRUE; diff --git a/sw/source/ui/envelp/labprt.src b/sw/source/ui/envelp/labprt.src index b6452f56ce..7e1b5c4c58 100644 --- a/sw/source/ui/envelp/labprt.src +++ b/sw/source/ui/envelp/labprt.src @@ -37,6 +37,7 @@ TabPage TP_LAB_PRT Hide = TRUE ; RadioButton BTN_PAGE { + HelpID = "sw:RadioButton:TP_LAB_PRT:BTN_PAGE"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; TabStop = TRUE ; @@ -45,6 +46,7 @@ TabPage TP_LAB_PRT }; RadioButton BTN_SINGLE { + HelpID = "sw:RadioButton:TP_LAB_PRT:BTN_SINGLE"; Pos = MAP_APPFONT ( 12 , 28 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "~Single label" ; @@ -58,6 +60,7 @@ TabPage TP_LAB_PRT }; NumericField FLD_COL { + HelpID = "sw:NumericField:TP_LAB_PRT:FLD_COL"; Border = TRUE ; Pos = MAP_APPFONT ( 160 , 27 ) ; Size = MAP_APPFONT ( 24 , 12 ) ; @@ -77,6 +80,7 @@ TabPage TP_LAB_PRT }; NumericField FLD_ROW { + HelpID = "sw:NumericField:TP_LAB_PRT:FLD_ROW"; Border = TRUE ; Pos = MAP_APPFONT ( 224 , 27 ) ; Size = MAP_APPFONT ( 24 , 12 ) ; @@ -89,6 +93,7 @@ TabPage TP_LAB_PRT }; CheckBox CB_SYNCHRON { + HelpID = "sw:CheckBox:TP_LAB_PRT:CB_SYNCHRON"; Pos = MAP_APPFONT ( 12 , 43 ) ; Size = MAP_APPFONT ( 120 , 10 ) ; TabStop = TRUE ; @@ -109,6 +114,7 @@ TabPage TP_LAB_PRT }; PushButton BTN_PRTSETUP { + HelpID = "sw:PushButton:TP_LAB_PRT:BTN_PRTSETUP"; Pos = MAP_APPFONT ( 198 , 70 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx index a80438afe8..76595d5543 100644 --- a/sw/source/ui/envelp/mailmrge.cxx +++ b/sw/source/ui/envelp/mailmrge.cxx @@ -779,7 +779,7 @@ bool SwMailMergeDlg::ExecQryShell() m_aSelection.realloc(nEnd - nStart + 1); Any* pSelection = m_aSelection.getArray(); - for (sal_Int32 i = nStart; i != nEnd; ++i, ++pSelection) + for (sal_Int32 i = nStart; i <= nEnd; ++i, ++pSelection) *pSelection <<= i; } else if (aAllRB.IsChecked() ) diff --git a/sw/source/ui/envelp/mailmrge.src b/sw/source/ui/envelp/mailmrge.src index f87f08478a..48eedbf3ce 100644 --- a/sw/source/ui/envelp/mailmrge.src +++ b/sw/source/ui/envelp/mailmrge.src @@ -41,7 +41,7 @@ ModalDialog DLG_MAILMERGE _MAIL_MERGE_STRING_ Moveable = TRUE ; Sizeable = TRUE; - HelpID = FN_QRY_MERGE ; + HelpID = CMD_FN_QRY_MERGE ; Window WIN_BEAMER { Pos = MAP_APPFONT ( 6 , 3 ) ; @@ -49,6 +49,7 @@ ModalDialog DLG_MAILMERGE }; RadioButton RB_ALL { + HelpID = "sw:RadioButton:DLG_MAILMERGE:RB_ALL"; Pos = MAP_APPFONT ( 12 , 97 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; Text [ en-US ] = "~All" ; @@ -56,6 +57,7 @@ ModalDialog DLG_MAILMERGE }; RadioButton RB_MARKED { + HelpID = "sw:RadioButton:DLG_MAILMERGE:RB_MARKED"; Pos = MAP_APPFONT ( 12 , 110 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; Text [ en-US ] = "~Selected records" ; @@ -63,6 +65,7 @@ ModalDialog DLG_MAILMERGE }; RadioButton RB_FROM { + HelpID = "sw:RadioButton:DLG_MAILMERGE:RB_FROM"; Pos = MAP_APPFONT ( 12 , 123 ) ; Size = MAP_APPFONT ( 33 , 10 ) ; Text [ en-US ] = "~From:" ; @@ -70,6 +73,7 @@ ModalDialog DLG_MAILMERGE }; NumericField NF_FROM { + HelpID = "sw:NumericField:DLG_MAILMERGE:NF_FROM"; Border = TRUE ; Pos = MAP_APPFONT ( 48 , 122 ) ; Size = MAP_APPFONT ( 24 , 12 ) ; @@ -87,6 +91,7 @@ ModalDialog DLG_MAILMERGE }; NumericField NF_TO { + HelpID = "sw:NumericField:DLG_MAILMERGE:NF_TO"; Border = TRUE ; Pos = MAP_APPFONT ( 105 , 122 ) ; Size = MAP_APPFONT ( 24 , 12 ) ; @@ -103,6 +108,7 @@ ModalDialog DLG_MAILMERGE }; RadioButton RB_PRINTER { + HelpID = "sw:RadioButton:DLG_MAILMERGE:RB_PRINTER"; Pos = MAP_APPFONT ( 144 , 97 ) ; Size = MAP_APPFONT ( 53 , 10 ) ; Check = TRUE ; @@ -111,6 +117,7 @@ ModalDialog DLG_MAILMERGE }; RadioButton RB_MAILING { + HelpID = "sw:RadioButton:DLG_MAILMERGE:RB_MAILING"; Pos = MAP_APPFONT ( 200 , 97 ) ; Size = MAP_APPFONT ( 53 , 10 ) ; TabStop = TRUE ; @@ -118,6 +125,7 @@ ModalDialog DLG_MAILMERGE }; RadioButton RB_FILE { + HelpID = "sw:RadioButton:DLG_MAILMERGE:RB_FILE"; Pos = MAP_APPFONT ( 256 , 97 ) ; Size = MAP_APPFONT ( 56 , 10 ) ; TabStop = TRUE ; @@ -125,6 +133,7 @@ ModalDialog DLG_MAILMERGE }; CheckBox CB_SINGLE_JOBS { + HelpID = "sw:CheckBox:DLG_MAILMERGE:CB_SINGLE_JOBS"; Pos = MAP_APPFONT ( 150 , 112 ) ; Size = MAP_APPFONT ( 142 , 10 ) ; TabStop = TRUE ; @@ -138,6 +147,7 @@ ModalDialog DLG_MAILMERGE }; RadioButton RB_SAVE_SINGLE_DOC { + HelpID = "sw:RadioButton:DLG_MAILMERGE:RB_SAVE_SINGLE_DOC"; Pos = MAP_APPFONT ( 150, 139 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; TabStop = TRUE ; @@ -145,6 +155,7 @@ ModalDialog DLG_MAILMERGE }; RadioButton RB_SAVE_INDIVIDUAL { + HelpID = "sw:RadioButton:DLG_MAILMERGE:RB_SAVE_INDIVIDUAL"; Pos = MAP_APPFONT ( 150, 152 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; TabStop = TRUE ; @@ -152,6 +163,7 @@ ModalDialog DLG_MAILMERGE }; CheckBox RB_GENERATE_FROM_DATABASE { + HelpID = "sw:CheckBox:DLG_MAILMERGE:RB_GENERATE_FROM_DATABASE"; Pos = MAP_APPFONT ( 156, 168 ) ; Size = MAP_APPFONT ( 144 , 10 ) ; TabStop = TRUE ; @@ -165,6 +177,7 @@ ModalDialog DLG_MAILMERGE }; ListBox LB_COLUMN { + HelpID = "sw:ListBox:DLG_MAILMERGE:LB_COLUMN"; Border = TRUE ; Pos = MAP_APPFONT ( 205 , 182 ) ; Size = MAP_APPFONT ( 103 , 84 ) ; @@ -179,6 +192,7 @@ ModalDialog DLG_MAILMERGE }; Edit ED_PATH { + HelpID = "sw:Edit:DLG_MAILMERGE:ED_PATH"; Pos = MAP_APPFONT ( 205 , 198 ) ; Size = MAP_APPFONT ( 86 , 12 ) ; Border = TRUE ; @@ -186,6 +200,7 @@ ModalDialog DLG_MAILMERGE }; PushButton PB_PATH { + HelpID = "sw:PushButton:DLG_MAILMERGE:PB_PATH"; Pos = MAP_APPFONT ( 294 , 198 ) ; Size = MAP_APPFONT ( 14 , 12 ) ; // Soll Groesse des Edits haben (12)! @@ -200,6 +215,7 @@ ModalDialog DLG_MAILMERGE }; ListBox LB_FILTER { + HelpID = "sw:ListBox:DLG_MAILMERGE:LB_FILTER"; Border = TRUE ; Pos = MAP_APPFONT ( 205 , 214 ) ; Size = MAP_APPFONT ( 103 , 84 ) ; @@ -209,6 +225,7 @@ ModalDialog DLG_MAILMERGE }; ListBox LB_ADDRESSFLD { + HelpID = "sw:ListBox:DLG_MAILMERGE:LB_ADDRESSFLD"; Border = TRUE ; Pos = MAP_APPFONT ( 220 , 110 ) ; Size = MAP_APPFONT ( 74 , 84 ) ; @@ -226,6 +243,7 @@ ModalDialog DLG_MAILMERGE }; Edit ED_SUBJECT { + HelpID = "sw:Edit:DLG_MAILMERGE:ED_SUBJECT"; Border = TRUE ; Pos = MAP_APPFONT ( 220 , 127 ) ; Size = MAP_APPFONT ( 88 , 12 ) ; @@ -241,6 +259,7 @@ ModalDialog DLG_MAILMERGE }; Edit ED_ATTACH { + HelpID = "sw:Edit:DLG_MAILMERGE:ED_ATTACH"; Border = TRUE ; Pos = MAP_APPFONT ( 220 , 140 ) ; Size = MAP_APPFONT ( 72 , 12 ) ; @@ -250,6 +269,7 @@ ModalDialog DLG_MAILMERGE }; PushButton PB_ATTACH { + HelpID = "sw:PushButton:DLG_MAILMERGE:PB_ATTACH"; Pos = MAP_APPFONT ( 294 , 140 ) ; Size = MAP_APPFONT ( 14 , 12 ) ; // Soll Groesse des Edits haben (12)! @@ -266,6 +286,7 @@ ModalDialog DLG_MAILMERGE }; CheckBox CB_FORMAT_HTML { + HelpID = "sw:CheckBox:DLG_MAILMERGE:CB_FORMAT_HTML"; Pos = MAP_APPFONT ( 220 , 156 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; Disable = TRUE ; @@ -275,6 +296,7 @@ ModalDialog DLG_MAILMERGE }; CheckBox CB_FORMAT_RTF { + HelpID = "sw:CheckBox:DLG_MAILMERGE:CB_FORMAT_RTF"; Pos = MAP_APPFONT ( 220 , 169 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; Disable = TRUE ; @@ -283,6 +305,7 @@ ModalDialog DLG_MAILMERGE }; CheckBox CB_FORMAT_SW { + HelpID = "sw:CheckBox:DLG_MAILMERGE:CB_FORMAT_SW"; Pos = MAP_APPFONT ( 220, 182 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; Disable = TRUE ; @@ -340,6 +363,7 @@ ModalDialog DLG_MERGE_CREATE }; RadioButton RB_THISDOC { + HelpID = "sw:RadioButton:DLG_MERGE_CREATE:RB_THISDOC"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Check = TRUE; @@ -348,6 +372,7 @@ ModalDialog DLG_MERGE_CREATE }; RadioButton RB_TEMPLATE { + HelpID = "sw:RadioButton:DLG_MERGE_CREATE:RB_TEMPLATE"; Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; TabStop = TRUE ; @@ -387,6 +412,7 @@ ModalDialog DLG_MERGE_FIELD_CONNECTIONS }; RadioButton RB_USEEXISTING { + HelpID = "sw:RadioButton:DLG_MERGE_FIELD_CONNECTIONS:RB_USEEXISTING"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 130 , 10 ) ; Check = TRUE; @@ -395,6 +421,7 @@ ModalDialog DLG_MERGE_FIELD_CONNECTIONS }; RadioButton RB_CREATENEW { + HelpID = "sw:RadioButton:DLG_MERGE_FIELD_CONNECTIONS:RB_CREATENEW"; Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 130 , 10 ) ; TabStop = TRUE ; diff --git a/sw/source/ui/fldui/DropDownFieldDialog.cxx b/sw/source/ui/fldui/DropDownFieldDialog.cxx index a32e6634b2..823ce5570c 100644 --- a/sw/source/ui/fldui/DropDownFieldDialog.cxx +++ b/sw/source/ui/fldui/DropDownFieldDialog.cxx @@ -32,21 +32,14 @@ #undef SW_DLLIMPLEMENTATION #endif - #include <wrtsh.hxx> #include <fldbas.hxx> #include <fldmgr.hxx> -#ifndef _MSGBOX_HXX #include <vcl/msgbox.hxx> -#endif #include <DropDownFieldDialog.hxx> #include <flddropdown.hxx> -#ifndef _FLDUI_HRC #include <fldui.hrc> -#endif -#ifndef _SW_DROPDOWNFIELDDIALOG_HRC #include <DropDownFieldDialog.hrc> -#endif using namespace ::com::sun::star; @@ -124,13 +117,12 @@ void sw::DropDownFieldDialog::Apply() { rSh.StartAllAction(); - SwDropDownField * pCopy = (SwDropDownField *) pDropField->Copy(); + ::std::auto_ptr<SwDropDownField> const pCopy( + static_cast<SwDropDownField *>( pDropField->CopyField() ) ); pCopy->SetPar1(sSelect); rSh.SwEditShell::UpdateFlds(*pCopy); - delete pCopy; - rSh.SetUndoNoResetModified(); rSh.EndAllAction(); } diff --git a/sw/source/ui/fldui/DropDownFieldDialog.src b/sw/source/ui/fldui/DropDownFieldDialog.src index 25f6c4ac15..2d5c98cfe5 100644 --- a/sw/source/ui/fldui/DropDownFieldDialog.src +++ b/sw/source/ui/fldui/DropDownFieldDialog.src @@ -45,6 +45,7 @@ ModalDialog DLG_FLD_DROPDOWN }; ListBox LB_LISTITEMS { + HelpID = "sw:ListBox:DLG_FLD_DROPDOWN:LB_LISTITEMS"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 115 , 99 ) ; @@ -67,6 +68,7 @@ ModalDialog DLG_FLD_DROPDOWN }; PushButton PB_NEXT { + HelpID = "sw:PushButton:DLG_FLD_DROPDOWN:PB_NEXT"; Pos = MAP_APPFONT ( 139 , 40 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -81,6 +83,7 @@ ModalDialog DLG_FLD_DROPDOWN }; PushButton PB_EDIT { + HelpID = "sw:PushButton:DLG_FLD_DROPDOWN:PB_EDIT"; Pos = MAP_APPFONT ( 139 , 99 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx index bd35309e68..17759f7a3b 100644 --- a/sw/source/ui/fldui/changedb.cxx +++ b/sw/source/ui/fldui/changedb.cxx @@ -115,7 +115,7 @@ SwChangeDBDlg::SwChangeDBDlg(SwView& rVw) : aAddDBPB.SetClickHdl(LINK(this, SwChangeDBDlg, AddDBHdl)); aUsedDBTLB.SetSelectionMode(MULTIPLE_SELECTION); - aUsedDBTLB.SetWindowBits(WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); + aUsedDBTLB.SetStyle(aUsedDBTLB.GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); aUsedDBTLB.SetSpaceBetweenEntries(0); aUsedDBTLB.SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE), diff --git a/sw/source/ui/fldui/changedb.src b/sw/source/ui/fldui/changedb.src index a461a1d7ac..8c4e21d5b3 100644 --- a/sw/source/ui/fldui/changedb.src +++ b/sw/source/ui/fldui/changedb.src @@ -31,6 +31,7 @@ ModalDialog DLG_CHANGE_DB { + HelpID = "sw:ModalDialog:DLG_CHANGE_DB"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 286 , 175 ) ; @@ -74,6 +75,7 @@ ModalDialog DLG_CHANGE_DB }; PushButton PB_ADDDB { + HelpID = "sw:PushButton:DLG_CHANGE_DB:PB_ADDDB"; Pos = MAP_APPFONT ( 118 , 90 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "Browse..." ; diff --git a/sw/source/ui/fldui/flddb.src b/sw/source/ui/fldui/flddb.src index e7bc8b99f9..d88d8790ba 100644 --- a/sw/source/ui/fldui/flddb.src +++ b/sw/source/ui/fldui/flddb.src @@ -43,6 +43,7 @@ TabPage TP_FLD_DB }; ListBox LB_DBTYPE { + HelpID = "sw:ListBox:TP_FLD_DB:LB_DBTYPE"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 14 ) ; Size = MAP_APPFONT ( 76 , 104 ) ; @@ -67,6 +68,7 @@ TabPage TP_FLD_DB }; Edit ED_DBCONDITION { + HelpID = "sw:Edit:TP_FLD_DB:ED_DBCONDITION"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 137 ) ; Size = MAP_APPFONT ( 76 , 12 ) ; @@ -82,6 +84,7 @@ TabPage TP_FLD_DB }; Edit ED_DBSETNUMBER { + HelpID = "sw:Edit:TP_FLD_DB:ED_DBSETNUMBER"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 167 ) ; Size = MAP_APPFONT ( 76 , 12 ) ; @@ -110,6 +113,7 @@ TabPage TP_FLD_DB }; PushButton PB_ADDDB { + HelpID = "sw:PushButton:TP_FLD_DB:PB_ADDDB"; Pos = MAP_APPFONT ( 198 , 121) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "Browse..." ; @@ -117,6 +121,7 @@ TabPage TP_FLD_DB RadioButton RB_DBOWNFORMAT { + HelpID = "sw:RadioButton:TP_FLD_DB:RB_DBOWNFORMAT"; Pos = MAP_APPFONT ( 94 , 153 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; Check = TRUE ; @@ -124,12 +129,14 @@ TabPage TP_FLD_DB }; RadioButton RB_DBFORMAT { + HelpID = "sw:RadioButton:TP_FLD_DB:RB_DBFORMAT"; Pos = MAP_APPFONT ( 94 , 166 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; Text [ en-US ] = "User-defined" ; }; ListBox LB_DBNUMFORMAT { + HelpID = "sw:ListBox:TP_FLD_DB:LB_DBNUMFORMAT"; Border = TRUE ; Pos = MAP_APPFONT ( 195 , 164 ) ; Size = MAP_APPFONT ( 53 , 60 ) ; @@ -139,6 +146,7 @@ TabPage TP_FLD_DB }; ListBox LB_DBFORMAT { + HelpID = "sw:ListBox:TP_FLD_DB:LB_DBFORMAT"; Border = TRUE ; Pos = MAP_APPFONT ( 195 , 163 ) ; Size = MAP_APPFONT ( 53 , 60 ) ; diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx index dabb6b91e5..9243037bb2 100644 --- a/sw/source/ui/fldui/flddinf.cxx +++ b/sw/source/ui/fldui/flddinf.cxx @@ -89,7 +89,7 @@ SwFldDokInfPage::SwFldDokInfPage(Window* pWindow, const SfxItemSet& rCoreSet ) : aTypeTLB.SetHelpId(HID_FIELD_DINF_TYPE); aTypeTLB.SetSelectionMode(SINGLE_SELECTION); - aTypeTLB.SetWindowBits(WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); + aTypeTLB.SetStyle(aTypeTLB.GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); // Font nicht setzen, damit der Font des Controls uebernommen wird! // Sonst bei falschem Font Bug an OV. aTypeTLB.SetSpaceBetweenEntries(0); diff --git a/sw/source/ui/fldui/flddinf.src b/sw/source/ui/fldui/flddinf.src index 9f65b88fa3..8f68883456 100644 --- a/sw/source/ui/fldui/flddinf.src +++ b/sw/source/ui/fldui/flddinf.src @@ -57,6 +57,7 @@ TabPage TP_FLD_DOKINF }; ListBox LB_DOKINFSELECTION { + HelpID = "sw:ListBox:TP_FLD_DOKINF:LB_DOKINFSELECTION"; Border = TRUE ; Pos = MAP_APPFONT ( 88 , 16 ) ; Size = MAP_APPFONT ( 76 , 163 ) ; @@ -78,6 +79,7 @@ TabPage TP_FLD_DOKINF }; ListBox LB_DOKINFFORMAT { + HelpID = "sw:ListBox:TP_FLD_DOKINF:LB_DOKINFFORMAT"; Border = TRUE ; Pos = MAP_APPFONT ( 170 , 16 ) ; Size = MAP_APPFONT ( 84 , 148 ) ; @@ -86,6 +88,7 @@ TabPage TP_FLD_DOKINF }; CheckBox CB_DOKINFFIXEDCONTENT { + HelpID = "sw:CheckBox:TP_FLD_DOKINF:CB_DOKINFFIXEDCONTENT"; Pos = MAP_APPFONT ( 170 , 170 ) ; Size = MAP_APPFONT ( 72 , 10 ) ; TabStop = TRUE ; diff --git a/sw/source/ui/fldui/flddok.src b/sw/source/ui/fldui/flddok.src index 6a60f8b53f..4723a55425 100644 --- a/sw/source/ui/fldui/flddok.src +++ b/sw/source/ui/fldui/flddok.src @@ -43,6 +43,7 @@ TabPage TP_FLD_DOK }; ListBox LB_DOKTYPE { + HelpID = "sw:ListBox:TP_FLD_DOK:LB_DOKTYPE"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 14 ) ; Size = MAP_APPFONT ( 76 , 165 ) ; @@ -59,6 +60,7 @@ TabPage TP_FLD_DOK }; ListBox LB_DOKSELECTION { + HelpID = "sw:ListBox:TP_FLD_DOK:LB_DOKSELECTION"; Border = TRUE ; Pos = MAP_APPFONT ( 88 , 15 ) ; Size = MAP_APPFONT ( 76 , 165 ) ; @@ -73,6 +75,7 @@ TabPage TP_FLD_DOK }; ListBox LB_DOKFORMAT { + HelpID = "sw:ListBox:TP_FLD_DOK:LB_DOKFORMAT"; Border = TRUE ; Pos = MAP_APPFONT ( 170 , 14 ) ; Size = MAP_APPFONT ( 84 , 151 ) ; @@ -83,6 +86,7 @@ TabPage TP_FLD_DOK }; ListBox LB_DOKNUMFORMAT { + HelpID = "sw:ListBox:TP_FLD_DOK:LB_DOKNUMFORMAT"; Border = TRUE ; Pos = MAP_APPFONT ( 170 , 14 ) ; Size = MAP_APPFONT ( 84 , 151 ) ; @@ -100,6 +104,7 @@ TabPage TP_FLD_DOK }; Edit ED_DOKVALUE { + HelpID = "sw:Edit:TP_FLD_DOK:ED_DOKVALUE"; Border = TRUE ; Pos = MAP_APPFONT ( 170 , 167 ) ; Size = MAP_APPFONT ( 84 , 12 ) ; @@ -109,6 +114,7 @@ TabPage TP_FLD_DOK }; NumericField ED_DOKLEVEL { + HelpID = "sw:NumericField:TP_FLD_DOK:ED_DOKLEVEL"; Border = TRUE ; Pos = MAP_APPFONT ( 170 , 167 ) ; Size = MAP_APPFONT ( 84 , 12 ) ; @@ -125,6 +131,7 @@ TabPage TP_FLD_DOK }; NumericField ED_DOKDATEOFF { + HelpID = "sw:NumericField:TP_FLD_DOK:ED_DOKDATEOFF"; Border = TRUE ; Pos = MAP_APPFONT ( 170 , 167 ) ; Size = MAP_APPFONT ( 84 , 12 ) ; @@ -138,6 +145,7 @@ TabPage TP_FLD_DOK }; CheckBox CB_DOKFIXEDCONTENT { + HelpID = "sw:CheckBox:TP_FLD_DOK:CB_DOKFIXEDCONTENT"; Pos = MAP_APPFONT ( 170 , 170 ) ; Size = MAP_APPFONT ( 72 , 10 ) ; TabStop = TRUE ; diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx index 76f0fbcfc7..832dabf344 100644 --- a/sw/source/ui/fldui/fldedt.cxx +++ b/sw/source/ui/fldui/fldedt.cxx @@ -195,21 +195,21 @@ SfxTabPage* SwFldEditDlg::CreatePage(USHORT nGroup) { // TabPage erzeugen SfxTabPage* pTabPage = 0; - USHORT nHelpId = 0; + const char* pHelpId = 0; switch (nGroup) { case GRP_DOC: pTabPage = SwFldDokPage::Create(this, *(SfxItemSet*)0); - nHelpId = HID_EDIT_FLD_DOK; + pHelpId = HID_EDIT_FLD_DOK; break; case GRP_FKT: pTabPage = SwFldFuncPage::Create(this, *(SfxItemSet*)0); - nHelpId = HID_EDIT_FLD_FUNC; + pHelpId = HID_EDIT_FLD_FUNC; break; case GRP_REF: pTabPage = SwFldRefPage::Create(this, *(SfxItemSet*)0); - nHelpId = HID_EDIT_FLD_REF; + pHelpId = HID_EDIT_FLD_REF; break; case GRP_REG: { @@ -233,21 +233,22 @@ SfxTabPage* SwFldEditDlg::CreatePage(USHORT nGroup) // } pSet->Put( SfxUnoAnyItem( SID_DOCINFO, uno::makeAny(xUDProps) ) ); pTabPage = SwFldDokInfPage::Create(this, *pSet); - nHelpId = HID_EDIT_FLD_DOKINF; + pHelpId = HID_EDIT_FLD_DOKINF; break; } case GRP_DB: pTabPage = SwFldDBPage::Create(this, *(SfxItemSet*)0); static_cast<SwFldDBPage*>(pTabPage)->SetWrtShell(*pSh); - nHelpId = HID_EDIT_FLD_DB; + pHelpId = HID_EDIT_FLD_DB; break; case GRP_VAR: pTabPage = SwFldVarPage::Create(this, *(SfxItemSet*)0); - nHelpId = HID_EDIT_FLD_VAR; + pHelpId = HID_EDIT_FLD_VAR; break; } - pTabPage->SetHelpId(nHelpId); + + pTabPage->SetHelpId(pHelpId); static_cast<SwFldPage*>(pTabPage)->SetWrtShell(pSh); SetTabPage(pTabPage); diff --git a/sw/source/ui/fldui/fldfunc.src b/sw/source/ui/fldui/fldfunc.src index ca67c448fb..aa5e42b078 100644 --- a/sw/source/ui/fldui/fldfunc.src +++ b/sw/source/ui/fldui/fldfunc.src @@ -43,6 +43,7 @@ TabPage TP_FLD_FUNC }; ListBox LB_FUNCTYPE { + HelpID = "sw:ListBox:TP_FLD_FUNC:LB_FUNCTYPE"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 14 ) ; Size = MAP_APPFONT ( 76 , 165 ) ; @@ -60,6 +61,7 @@ TabPage TP_FLD_FUNC }; ListBox LB_FUNCSELECTION { + HelpID = "sw:ListBox:TP_FLD_FUNC:LB_FUNCSELECTION"; Border = TRUE ; Pos = MAP_APPFONT ( 88 , 14 ) ; Size = MAP_APPFONT ( 76 , 165 ) ; @@ -77,6 +79,7 @@ TabPage TP_FLD_FUNC }; ListBox LB_FUNCFORMAT { + HelpID = "sw:ListBox:TP_FLD_FUNC:LB_FUNCFORMAT"; Border = TRUE ; Pos = MAP_APPFONT ( 88 , 14 ) ; Size = MAP_APPFONT ( 76 , 165 ) ; @@ -91,6 +94,7 @@ TabPage TP_FLD_FUNC }; Edit ED_FUNCNAME { + HelpID = "sw:Edit:TP_FLD_FUNC:ED_FUNCNAME"; Border = TRUE ; Pos = MAP_APPFONT ( 170 , 14 ) ; Size = MAP_APPFONT ( 84 , 12 ) ; @@ -106,6 +110,7 @@ TabPage TP_FLD_FUNC }; Edit ED_FUNCVALUE { + HelpID = "sw:Edit:TP_FLD_FUNC:ED_FUNCVALUE"; Border = TRUE ; Pos = MAP_APPFONT ( 170 , 41 ) ; Size = MAP_APPFONT ( 84 , 12 ) ; @@ -122,6 +127,7 @@ TabPage TP_FLD_FUNC }; Edit ED_FUNCCOND1 { + HelpID = "sw:Edit:TP_FLD_FUNC:ED_FUNCCOND1"; Border = TRUE ; Pos = MAP_APPFONT ( 170 , 41 ) ; Size = MAP_APPFONT ( 84 , 12 ) ; @@ -139,6 +145,7 @@ TabPage TP_FLD_FUNC }; Edit ED_FUNCCOND2 { + HelpID = "sw:Edit:TP_FLD_FUNC:ED_FUNCCOND2"; Border = TRUE ; Pos = MAP_APPFONT ( 170 , 68 ) ; Size = MAP_APPFONT ( 84 , 12 ) ; @@ -148,6 +155,7 @@ TabPage TP_FLD_FUNC }; PushButton BT_FUNCMACRO { + HelpID = "sw:PushButton:TP_FLD_FUNC:BT_FUNCMACRO"; Pos = MAP_APPFONT ( 204 , 165 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Macro..." ; @@ -163,6 +171,7 @@ TabPage TP_FLD_FUNC }; Edit ED_LISTITEM { + HelpID = "sw:Edit:TP_FLD_FUNC:ED_LISTITEM"; Border = TRUE ; Pos = MAP_APPFONT ( 170 , 14 ) ; Size = MAP_APPFONT ( 84 , 12 ) ; @@ -172,6 +181,7 @@ TabPage TP_FLD_FUNC }; PushButton PB_LISTADD { + HelpID = "sw:PushButton:TP_FLD_FUNC:PB_LISTADD"; Pos = MAP_APPFONT ( 170 , 29 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Hide = TRUE; @@ -186,6 +196,7 @@ TabPage TP_FLD_FUNC }; ListBox LB_LISTITEMS { + HelpID = "sw:ListBox:TP_FLD_FUNC:LB_LISTITEMS"; Border = TRUE ; Pos = MAP_APPFONT ( 170 , 57 ) ; Size = MAP_APPFONT ( 83 , 44 ) ; @@ -195,6 +206,7 @@ TabPage TP_FLD_FUNC }; PushButton PB_LISTREMOVE { + HelpID = "sw:PushButton:TP_FLD_FUNC:PB_LISTREMOVE"; Pos = MAP_APPFONT ( 203 , 104 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Hide = TRUE; @@ -202,6 +214,7 @@ TabPage TP_FLD_FUNC }; PushButton PB_LISTUP { + HelpID = "sw:PushButton:TP_FLD_FUNC:PB_LISTUP"; Pos = MAP_APPFONT ( 203 , 121 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Hide = TRUE; @@ -209,6 +222,7 @@ TabPage TP_FLD_FUNC }; PushButton PB_LISTDOWN { + HelpID = "sw:PushButton:TP_FLD_FUNC:PB_LISTDOWN"; Pos = MAP_APPFONT ( 203 , 138 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Hide = TRUE; @@ -223,6 +237,7 @@ TabPage TP_FLD_FUNC }; Edit ED_LISTNAME { + HelpID = "sw:Edit:TP_FLD_FUNC:ED_LISTNAME"; Border = TRUE ; Pos = MAP_APPFONT ( 170 , 167 ) ; Size = MAP_APPFONT ( 84 , 12 ) ; diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index 10ee25b477..5b7b70b5f9 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -124,7 +124,7 @@ SwFldRefPage::SwFldRefPage(Window* pParent, const SfxItemSet& rCoreSet ) : // --> OD 2007-11-21 #i83479# aSelectionToolTipLB.SetSelectHdl( LINK(this, SwFldRefPage, SubTypeHdl) ); aSelectionToolTipLB.SetDoubleClickHdl( LINK(this, SwFldRefPage, InsertHdl) ); - aSelectionToolTipLB.SetWindowBits( aSelectionToolTipLB.GetWindowBits() | WB_HSCROLL ); + aSelectionToolTipLB.SetStyle( aSelectionToolTipLB.GetStyle() | WB_HSCROLL ); aSelectionToolTipLB.SetSpaceBetweenEntries(1); aSelectionToolTipLB.SetHighlightRange(); // <-- diff --git a/sw/source/ui/fldui/fldref.src b/sw/source/ui/fldui/fldref.src index 8abf02e980..c3aa0f737e 100644 --- a/sw/source/ui/fldui/fldref.src +++ b/sw/source/ui/fldui/fldref.src @@ -43,6 +43,7 @@ TabPage TP_FLD_REF }; ListBox LB_REFTYPE { + HelpID = "sw:ListBox:TP_FLD_REF:LB_REFTYPE"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 14 ) ; Size = MAP_APPFONT ( 76 , 165 ) ; @@ -58,6 +59,7 @@ TabPage TP_FLD_REF }; ListBox LB_REFSELECTION { + HelpID = "sw:ListBox:TP_FLD_REF:LB_REFSELECTION"; Border = TRUE ; Pos = MAP_APPFONT ( 88 , 14 ) ; Size = MAP_APPFONT ( 166 , 73 ) ; @@ -82,6 +84,7 @@ TabPage TP_FLD_REF }; ListBox LB_REFFORMAT { + HelpID = "sw:ListBox:TP_FLD_REF:LB_REFFORMAT"; Border = TRUE ; Pos = MAP_APPFONT ( 88 , 104 ) ; Size = MAP_APPFONT ( 76 , 75 ) ; @@ -98,6 +101,7 @@ TabPage TP_FLD_REF }; Edit ED_REFNAME { + HelpID = "sw:Edit:TP_FLD_REF:ED_REFNAME"; Border = TRUE ; Pos = MAP_APPFONT ( 170 , 104 ) ; Size = MAP_APPFONT ( 84 , 12 ) ; @@ -114,6 +118,7 @@ TabPage TP_FLD_REF }; Edit ED_REFVALUE { + HelpID = "sw:Edit:TP_FLD_REF:ED_REFVALUE"; Border = TRUE ; Pos = MAP_APPFONT ( 170 , 136 ) ; Size = MAP_APPFONT ( 84 , 12 ) ; diff --git a/sw/source/ui/fldui/fldvar.src b/sw/source/ui/fldui/fldvar.src index eda28b7fb4..4c42c971d2 100644 --- a/sw/source/ui/fldui/fldvar.src +++ b/sw/source/ui/fldui/fldvar.src @@ -44,6 +44,7 @@ TabPage TP_FLD_VAR }; ListBox LB_VARTYPE { + HelpID = "sw:ListBox:TP_FLD_VAR:LB_VARTYPE"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 14 ) ; Size = MAP_APPFONT ( 76 , 135 ) ; @@ -60,6 +61,7 @@ TabPage TP_FLD_VAR }; ListBox LB_VARSELECTION { + HelpID = "sw:ListBox:TP_FLD_VAR:LB_VARSELECTION"; Border = TRUE ; Pos = MAP_APPFONT ( 88 , 14 ) ; Size = MAP_APPFONT ( 76 , 135 ) ; @@ -75,6 +77,7 @@ TabPage TP_FLD_VAR }; ListBox LB_VARFORMAT { + HelpID = "sw:ListBox:TP_FLD_VAR:LB_VARFORMAT"; Border = TRUE ; Pos = MAP_APPFONT ( 170 , 14 ) ; Size = MAP_APPFONT ( 84 , 123 ) ; @@ -83,6 +86,7 @@ TabPage TP_FLD_VAR }; ListBox LB_VARNUMFORMAT { + HelpID = "sw:ListBox:TP_FLD_VAR:LB_VARNUMFORMAT"; Border = TRUE ; Pos = MAP_APPFONT ( 170 , 14 ) ; Size = MAP_APPFONT ( 84 , 123 ) ; @@ -91,6 +95,7 @@ TabPage TP_FLD_VAR }; CheckBox CB_VARINVISIBLE { + HelpID = "sw:CheckBox:TP_FLD_VAR:CB_VARINVISIBLE"; Pos = MAP_APPFONT ( 170 , 141 ) ; Size = MAP_APPFONT ( 84 , 10 ) ; Text [ en-US ] = "Invisi~ble" ; @@ -112,6 +117,7 @@ TabPage TP_FLD_VAR }; ListBox LB_VARCHAPTERLEVEL { + HelpID = "sw:ListBox:TP_FLD_VAR:LB_VARCHAPTERLEVEL"; Border = TRUE ; Hide = TRUE ; Pos = MAP_APPFONT ( 208 , 123 ) ; @@ -132,6 +138,7 @@ TabPage TP_FLD_VAR }; Edit ED_VARSEPARATOR { + HelpID = "sw:Edit:TP_FLD_VAR:ED_VARSEPARATOR"; Pos = MAP_APPFONT ( 208 , 138 ) ; Size = MAP_APPFONT ( 46 , 12 ) ; Border = TRUE ; @@ -148,6 +155,7 @@ TabPage TP_FLD_VAR }; Edit ED_VARNAME { + HelpID = "sw:Edit:TP_FLD_VAR:ED_VARNAME"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 166 ) ; Size = MAP_APPFONT ( 76 , 12 ) ; @@ -163,6 +171,7 @@ TabPage TP_FLD_VAR }; Edit ED_VARVALUE { + HelpID = "sw:Edit:TP_FLD_VAR:ED_VARVALUE"; Border = TRUE ; Pos = MAP_APPFONT ( 88 , 166 ) ; Size = MAP_APPFONT ( 76 , 12 ) ; diff --git a/sw/source/ui/fldui/inpdlg.cxx b/sw/source/ui/fldui/inpdlg.cxx index 002b312af8..a197147021 100644 --- a/sw/source/ui/fldui/inpdlg.cxx +++ b/sw/source/ui/fldui/inpdlg.cxx @@ -32,13 +32,7 @@ #undef SW_DLLIMPLEMENTATION #endif - - -#define _INPDLG_CXX - -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <unotools/charclass.hxx> #include <editeng/unolingu.hxx> #include <wrtsh.hxx> @@ -48,12 +42,8 @@ #include <inpdlg.hxx> #include <fldmgr.hxx> -#ifndef _FLDUI_HRC #include <fldui.hrc> -#endif -#ifndef _INPDLG_HRC #include <inpdlg.hrc> -#endif /*-------------------------------------------------------------------- @@ -128,7 +118,9 @@ SwFldInputDlg::SwFldInputDlg( Window *pParent, SwWrtShell &rS, //values are formatted - formulas are not CharClass aCC( SvxCreateLocale( pSetFld->GetLanguage() )); if( aCC.isNumeric( sFormula )) - aStr = pSetFld->Expand(); + { + aStr = pSetFld->ExpandField(true); + } else aStr = sFormula; aLabelED.SetText( pSetFld->GetPromptText() ); diff --git a/sw/source/ui/fldui/inpdlg.src b/sw/source/ui/fldui/inpdlg.src index f615b68f48..8cd70d8247 100644 --- a/sw/source/ui/fldui/inpdlg.src +++ b/sw/source/ui/fldui/inpdlg.src @@ -46,6 +46,7 @@ ModalDialog DLG_FLD_INPUT };*/ Edit ED_LABEL { + HelpID = "sw:Edit:DLG_FLD_INPUT:ED_LABEL"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 115 , 12 ) ; @@ -56,6 +57,7 @@ ModalDialog DLG_FLD_INPUT }; MultiLineEdit ED_EDIT { + HelpID = "sw:MultiLineEdit:DLG_FLD_INPUT:ED_EDIT"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 32 ) ; Size = MAP_APPFONT ( 115 , 72 ) ; @@ -83,6 +85,7 @@ ModalDialog DLG_FLD_INPUT }; PushButton PB_NEXT { + HelpID = "sw:PushButton:DLG_FLD_INPUT:PB_NEXT"; Pos = MAP_APPFONT ( 139 , 40 ) ; Size = MAP_APPFONT ( 50 , 15 ) ; TabStop = TRUE ; diff --git a/sw/source/ui/fldui/javaedit.src b/sw/source/ui/fldui/javaedit.src index ffeb2b84e8..cbcc83f055 100644 --- a/sw/source/ui/fldui/javaedit.src +++ b/sw/source/ui/fldui/javaedit.src @@ -33,6 +33,7 @@ // RID_SVXDLG_POSTIT ----------------------------------------------------- ModalDialog DLG_JAVAEDIT { + HelpID = "sw:ModalDialog:DLG_JAVAEDIT"; OutputSize = TRUE ; SvLook = TRUE ; Size = MAP_APPFONT ( 248 , 157 ) ; @@ -45,6 +46,7 @@ ModalDialog DLG_JAVAEDIT }; Edit ED_TYPE { + HelpID = "sw:Edit:DLG_JAVAEDIT:ED_TYPE"; Border = TRUE ; Text = "JavaScript" ; // Nicht uebersetzen!!! @@ -54,6 +56,7 @@ ModalDialog DLG_JAVAEDIT }; RadioButton RB_URL { + HelpID = "sw:RadioButton:DLG_JAVAEDIT:RB_URL"; Pos = MAP_APPFONT ( 12 , 28 ) ; Size = MAP_APPFONT ( 55 , 10 ) ; TabStop = TRUE ; @@ -61,6 +64,7 @@ ModalDialog DLG_JAVAEDIT }; Edit ED_URL { + HelpID = "sw:Edit:DLG_JAVAEDIT:ED_URL"; Border = TRUE ; Pos = MAP_APPFONT ( 70 , 27 ) ; Size = MAP_APPFONT ( 87 , 12 ) ; @@ -68,6 +72,7 @@ ModalDialog DLG_JAVAEDIT }; PushButton PB_URL { + HelpID = "sw:PushButton:DLG_JAVAEDIT:PB_URL"; Pos = MAP_APPFONT ( 163 , 26 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; Text = "~..." ; @@ -75,6 +80,7 @@ ModalDialog DLG_JAVAEDIT }; RadioButton RB_EDIT { + HelpID = "sw:RadioButton:DLG_JAVAEDIT:RB_EDIT"; Pos = MAP_APPFONT ( 12 , 40 ) ; Size = MAP_APPFONT ( 140 , 10 ) ; Text [ en-US ] = "~Text" ; @@ -83,6 +89,7 @@ ModalDialog DLG_JAVAEDIT }; MultiLineEdit ED_EDIT { + HelpID = "sw:MultiLineEdit:DLG_JAVAEDIT:ED_EDIT"; Border = TRUE ; Pos = MAP_APPFONT ( 23 , 54 ) ; Size = MAP_APPFONT ( 155 , 91 ) ; @@ -116,12 +123,14 @@ ModalDialog DLG_JAVAEDIT }; ImageButton BTN_PREV { + HelpID = "sw:ImageButton:DLG_JAVAEDIT:BTN_PREV"; Pos = MAP_APPFONT ( 191 , 60 ) ; Size = MAP_APPFONT ( 24 , 14 ) ; Symbol = IMAGEBUTTON_ARROW_LEFT ; }; ImageButton BTN_NEXT { + HelpID = "sw:ImageButton:DLG_JAVAEDIT:BTN_NEXT"; Pos = MAP_APPFONT ( 217 , 60 ) ; Size = MAP_APPFONT ( 24 , 14 ) ; Symbol = IMAGEBUTTON_ARROW_RIGHT ; diff --git a/sw/source/ui/frmdlg/column.src b/sw/source/ui/frmdlg/column.src index 449fbbf121..537cf1ce9c 100644 --- a/sw/source/ui/frmdlg/column.src +++ b/sw/source/ui/frmdlg/column.src @@ -46,6 +46,7 @@ TabPage TP_COLUMN }; NumericField ED_NUMBER { + HelpID = "sw:NumericField:TP_COLUMN:ED_NUMBER"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 30 ) ; Size = MAP_APPFONT ( 24 , 12 ) ; @@ -68,6 +69,7 @@ TabPage TP_COLUMN }; CheckBox CB_BALANCECOLS { + HelpID = "sw:CheckBox:TP_COLUMN:CB_BALANCECOLS"; Pos = MAP_APPFONT ( 7 , 46 ) ; Size = MAP_APPFONT ( 163 , 10 ) ; Hide = TRUE; @@ -93,6 +95,7 @@ TabPage TP_COLUMN }; ImageButton BTN_DOWN { + HelpID = "sw:ImageButton:TP_COLUMN:BTN_DOWN"; Disable = TRUE ; Pos = MAP_APPFONT ( 62 , 69 ) ; Size = MAP_APPFONT ( 10 , 10 ) ; @@ -122,6 +125,7 @@ TabPage TP_COLUMN }; ImageButton BTN_UP { + HelpID = "sw:ImageButton:TP_COLUMN:BTN_UP"; Disable = TRUE ; Pos = MAP_APPFONT ( 238 , 69 ) ; Size = MAP_APPFONT ( 10 , 10 ) ; @@ -137,6 +141,7 @@ TabPage TP_COLUMN }; MetricField ED_1 { + HelpID = "sw:MetricField:TP_COLUMN:ED_1"; Disable = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 87 , 83 ) ; @@ -155,6 +160,7 @@ TabPage TP_COLUMN }; MetricField ED_2 { + HelpID = "sw:MetricField:TP_COLUMN:ED_2"; Disable = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 137 , 83 ) ; @@ -173,6 +179,7 @@ TabPage TP_COLUMN }; MetricField ED_3 { + HelpID = "sw:MetricField:TP_COLUMN:ED_3"; Disable = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 187 , 83 ) ; @@ -198,6 +205,7 @@ TabPage TP_COLUMN }; MetricField ED_DIST1 { + HelpID = "sw:MetricField:TP_COLUMN:ED_DIST1"; Disable = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 112 , 99 ) ; @@ -216,6 +224,7 @@ TabPage TP_COLUMN }; MetricField ED_DIST2 { + HelpID = "sw:MetricField:TP_COLUMN:ED_DIST2"; Disable = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 162 , 99 ) ; @@ -234,6 +243,7 @@ TabPage TP_COLUMN }; CheckBox CB_AUTO_WIDTH { + HelpID = "sw:CheckBox:TP_COLUMN:CB_AUTO_WIDTH"; Pos = MAP_APPFONT ( 87 , 115 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; Text [ en-US ] = "Auto~Width" ; @@ -255,6 +265,7 @@ TabPage TP_COLUMN }; ListBox LB_STYLE { + HelpID = "sw:ListBox:TP_COLUMN:LB_STYLE"; Pos = MAP_APPFONT ( 50 , 138 ) ; Size = MAP_APPFONT ( 60 , 66 ) ; TabStop = TRUE ; @@ -273,6 +284,7 @@ TabPage TP_COLUMN }; MetricField ED_HEIGHT { + HelpID = "sw:MetricField:TP_COLUMN:ED_HEIGHT"; Border = TRUE ; Pos = MAP_APPFONT ( 50 , 154 ) ; Size = MAP_APPFONT ( 60 , 12 ) ; @@ -297,6 +309,7 @@ TabPage TP_COLUMN }; ListBox LB_POSITION { + HelpID = "sw:ListBox:TP_COLUMN:LB_POSITION"; Pos = MAP_APPFONT ( 50 , 170 ) ; Size = MAP_APPFONT ( 60 , 40 ) ; TabStop = TRUE ; @@ -337,6 +350,7 @@ TabPage TP_COLUMN }; ListBox LB_TEXTDIRECTION { + HelpID = "sw:ListBox:TP_COLUMN:LB_TEXTDIRECTION"; Border = TRUE ; Pos = MAP_APPFONT ( 127 , 149 ) ; Size = MAP_APPFONT ( 127 , 50 ) ; @@ -385,6 +399,7 @@ ModalDialog DLG_COLUMN }; ListBox LB_APPLY_TO { + HelpID = "sw:ListBox:DLG_COLUMN:LB_APPLY_TO"; Pos = MAP_APPFONT ( 260 , 74 ) ; Size = MAP_APPFONT ( 50 , 66 ) ; TabStop = TRUE ; diff --git a/sw/source/ui/frmdlg/cption.src b/sw/source/ui/frmdlg/cption.src index da651a4573..30be09080a 100644 --- a/sw/source/ui/frmdlg/cption.src +++ b/sw/source/ui/frmdlg/cption.src @@ -61,6 +61,7 @@ ModalDialog DLG_CAPTION }; PushButton BTN_AUTOCAPTION { + HelpID = "sw:PushButton:DLG_CAPTION:BTN_AUTOCAPTION"; Pos = MAP_APPFONT ( 194 , 63 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -68,6 +69,7 @@ ModalDialog DLG_CAPTION }; PushButton BTN_OPTION { + HelpID = "sw:PushButton:DLG_CAPTION:BTN_OPTION"; Pos = MAP_APPFONT ( 194 , 80 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -83,6 +85,7 @@ ModalDialog DLG_CAPTION }; Edit EDT_TEXT { + HelpID = "sw:Edit:DLG_CAPTION:EDT_TEXT"; Pos = MAP_APPFONT ( 6 , 17 ) ; Size = MAP_APPFONT ( 182 , 12 ) ; Border = TRUE ; @@ -104,6 +107,7 @@ ModalDialog DLG_CAPTION }; ComboBox BOX_CATEGORY { + HelpID = "sw:ComboBox:DLG_CAPTION:BOX_CATEGORY"; Pos = MAP_APPFONT ( 82 , 46 ) ; Size = MAP_APPFONT ( 106 , 61 ) ; DropDown = TRUE ; @@ -119,6 +123,7 @@ ModalDialog DLG_CAPTION }; ListBox BOX_FORMAT { + HelpID = "sw:ListBox:DLG_CAPTION:BOX_FORMAT"; Border = TRUE ; Pos = MAP_APPFONT ( 82 , 63 ) ; Size = MAP_APPFONT ( 106 , 83 ) ; @@ -135,6 +140,7 @@ ModalDialog DLG_CAPTION }; Edit ED_NUM_SEP { + HelpID = "sw:Edit:DLG_CAPTION:ED_NUM_SEP"; Pos = MAP_APPFONT ( 82 , 63 ) ; Size = MAP_APPFONT ( 106 , 12 ) ; Border = TRUE ; @@ -152,6 +158,7 @@ ModalDialog DLG_CAPTION }; Edit EDT_SEP { + HelpID = "sw:Edit:DLG_CAPTION:EDT_SEP"; Pos = MAP_APPFONT ( 82 , 80 ) ; Size = MAP_APPFONT ( 106 , 12 ) ; Border = TRUE ; @@ -168,6 +175,7 @@ ModalDialog DLG_CAPTION }; ListBox BOX_POS { + HelpID = "sw:ListBox:DLG_CAPTION:BOX_POS"; Pos = MAP_APPFONT ( 82 , 97 ) ; Size = MAP_APPFONT ( 106 , 61 ) ; DropDown = TRUE ; @@ -244,6 +252,7 @@ ModalDialog DLG_SEQUENCE_OPTION }; ListBox LB_LEVEL { + HelpID = "sw:ListBox:DLG_SEQUENCE_OPTION:LB_LEVEL"; Border = TRUE ; Pos = MAP_APPFONT ( 65 , 18 ) ; Size = MAP_APPFONT ( 72 , 60 ) ; @@ -262,6 +271,7 @@ ModalDialog DLG_SEQUENCE_OPTION }; Edit ED_SEPARATOR { + HelpID = "sw:Edit:DLG_SEQUENCE_OPTION:ED_SEPARATOR"; Pos = MAP_APPFONT ( 65 , 34 ) ; Size = MAP_APPFONT ( 72 , 12 ) ; Border = TRUE ; @@ -282,6 +292,7 @@ ModalDialog DLG_SEQUENCE_OPTION }; ListBox LB_CHARSTYLE { + HelpID = "sw:ListBox:DLG_SEQUENCE_OPTION:LB_CHARSTYLE"; Border = TRUE ; Pos = MAP_APPFONT ( 65 , 68 ) ; Size = MAP_APPFONT ( 72 , 60 ) ; @@ -294,6 +305,7 @@ ModalDialog DLG_SEQUENCE_OPTION }; CheckBox CB_APPLYBAS { + HelpID = "sw:CheckBox:DLG_SEQUENCE_OPTION:CB_APPLYBAS"; Pos = MAP_APPFONT ( 12 , 84 ) ; Size = MAP_APPFONT ( 136 , 10 ) ; TabStop = TRUE ; @@ -313,6 +325,7 @@ ModalDialog DLG_SEQUENCE_OPTION }; ListBox LB_ORDER { + HelpID = "sw:ListBox:DLG_SEQUENCE_OPTION:LB_ORDER"; Border = TRUE ; Pos = MAP_APPFONT ( 65 , 114 ) ; Size = MAP_APPFONT ( 72 , 60 ) ; diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx index 413845f1eb..52280136a8 100644 --- a/sw/source/ui/frmdlg/frmdlg.cxx +++ b/sw/source/ui/frmdlg/frmdlg.cxx @@ -93,7 +93,8 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame* pViewFrame, aTmp += *pStr; aTmp += ')'; } - AddTabPage(TP_FRM_STD, SwFrmPage::Create, 0); + + AddTabPage(TP_FRM_STD, SwFrmPage::Create, 0); AddTabPage(TP_FRM_ADD, SwFrmAddPage::Create, 0); AddTabPage(TP_FRM_WRAP, SwWrapTabPage::Create, 0); AddTabPage(TP_FRM_URL, SwFrmURLPage::Create, 0); @@ -217,3 +218,4 @@ void SwFrmDlg::PageCreated( USHORT nId, SfxTabPage &rPage ) break; } } + diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 7939957c71..50e9754450 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -677,7 +677,10 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) : nOldV(text::VertOrientation::TOP), nOldVRel(text::RelOrientation::PRINT_AREA), pVMap( 0 ), - pHMap( 0 ) + pHMap( 0 ), + m_bAllowVertPositioning( true ), + m_bIsMathOLE( false ), + m_bIsMathBaselineAlignment( true ) { FreeResource(); SetExchangeSupport(); @@ -782,9 +785,17 @@ void SwFrmPage::Reset( const SfxItemSet &rSet ) SetMetric( aAtHorzPosED, aMetric ); SetMetric( aAtVertPosED, aMetric ); + const SfxPoolItem* pItem = NULL; const SwFmtAnchor& rAnchor = (const SwFmtAnchor&)rSet.Get(RES_ANCHOR); + if (SFX_ITEM_SET == rSet.GetItemState(FN_OLE_IS_MATH, FALSE, &pItem)) + m_bIsMathOLE = ((const SfxBoolItem*)pItem)->GetValue(); + if (SFX_ITEM_SET == rSet.GetItemState(FN_MATH_BASELINE_ALIGNMENT, FALSE, &pItem)) + m_bIsMathBaselineAlignment = ((const SfxBoolItem*)pItem)->GetValue(); + EnableVerticalPositioning( !(m_bIsMathOLE && m_bIsMathBaselineAlignment + && FLY_AS_CHAR == rAnchor.GetAnchorId()) ); + if (bFormat) { // Bei Formaten keine Ankerbearbeitung @@ -812,7 +823,6 @@ void SwFrmPage::Reset( const SfxItemSet &rSet ) if ( nDlgType == DLG_FRM_GRF || nDlgType == DLG_FRM_OLE ) { ASSERT(pSh , "shell not found"); - const SfxPoolItem* pItem; //OS: nur fuer die Variante Einfuegen/Grafik/Eigenschaften if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_GRF_REALSIZE, FALSE, &pItem)) aGrfSize = ((const SvxSizeItem*)pItem)->GetSize(); @@ -1080,7 +1090,7 @@ BOOL SwFrmPage::FillItemSet(SfxItemSet &rSet) aWidthED .GetValue() == aWidthED .GetMin() && aHeightED.GetValue() == aHeightED.GetMin()); - if ((bNew && !bFormat) || (bValueModified || bCheckChanged) && bLegalValue) + if ((bNew && !bFormat) || ((bValueModified || bCheckChanged) && bLegalValue)) { sal_Int64 nNewWidth = aWidthED.DenormalizePercent(aWidthED.GetRealValue(FUNIT_TWIP)); sal_Int64 nNewHeight = aHeightED.DenormalizePercent(aHeightED.GetRealValue(FUNIT_TWIP)); @@ -1280,8 +1290,8 @@ void SwFrmPage::InitPos(RndStdIds eId, if ( nY != LONG_MAX ) aAtVertPosED.SetValue( aAtVertPosED.Normalize(nY), FUNIT_TWIP ); } - aAtVertPosFT.Enable( bEnable ); - aAtVertPosED.Enable( bEnable ); + aAtVertPosFT.Enable( bEnable && m_bAllowVertPositioning ); + aAtVertPosED.Enable( bEnable && m_bAllowVertPositioning ); UpdateExample(); } @@ -1488,8 +1498,10 @@ ULONG SwFrmPage::FillRelLB( const FrmMap* _pMap, } } - _rLB.Enable(_rLB.GetEntryCount() != 0); - _rFT.Enable(_rLB.GetEntryCount() != 0); + const bool bEnable = _rLB.GetEntryCount() != 0 + && (&_rLB != &aVertRelationLB || m_bAllowVertPositioning); + _rLB.Enable( bEnable ); + _rFT.Enable( bEnable ); RelHdl(&_rLB); @@ -1850,6 +1862,10 @@ IMPL_LINK( SwFrmPage, AnchorTypeHdl, RadioButton *, EMPTYARG ) PosHdl(&aHorizontalDLB); PosHdl(&aVerticalDLB); } + + EnableVerticalPositioning( !(m_bIsMathOLE && m_bIsMathBaselineAlignment + && FLY_AS_CHAR == eId) ); + return 0; } @@ -1875,7 +1891,7 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB ) } else { - BOOL bEnable = text::VertOrientation::NONE == nAlign; + BOOL bEnable = text::VertOrientation::NONE == nAlign && m_bAllowVertPositioning; aAtVertPosED.Enable( bEnable ); aAtVertPosFT.Enable( bEnable ); } @@ -2304,6 +2320,19 @@ void SwFrmPage::SetFormatUsed(BOOL bFmt) } } + +void SwFrmPage::EnableVerticalPositioning( bool bEnable ) +{ + m_bAllowVertPositioning = bEnable; + aVerticalFT.Enable( bEnable ); + aVerticalDLB.Enable( bEnable ); + aAtVertPosFT.Enable( bEnable ); + aAtVertPosED.Enable( bEnable ); + aVertRelationFT.Enable( bEnable ); + aVertRelationLB.Enable( bEnable ); +} + + /*-------------------------------------------------------------------- Beschreibung: --------------------------------------------------------------------*/ @@ -3246,4 +3275,3 @@ IMPL_LINK(SwFrmAddPage, ChainModifyHdl, ListBox*, pBox) } return 0; } - diff --git a/sw/source/ui/frmdlg/frmpage.src b/sw/source/ui/frmdlg/frmpage.src index 5ce84d4552..f832061dc7 100644 --- a/sw/source/ui/frmdlg/frmpage.src +++ b/sw/source/ui/frmdlg/frmpage.src @@ -243,6 +243,7 @@ TabPage TP_FRM_STD }; MetricField ED_WIDTH { + HelpID = "sw:MetricField:TP_FRM_STD:ED_WIDTH"; Border = TRUE ; Pos = MAP_APPFONT ( SWFRMPG_COL_3 , SWFRMPG_ROW_1 ) ; Size = MAP_APPFONT ( (SWFRMPG_COL_4-SWFRMPG_COL_3) , RSC_CD_TEXTBOX_HEIGHT ) ; @@ -261,6 +262,7 @@ TabPage TP_FRM_STD }; CheckBox CB_REL_WIDTH { + HelpID = "sw:CheckBox:TP_FRM_STD:CB_REL_WIDTH"; Pos = MAP_APPFONT ( SWFRMPG_COL_2 , SWFRMPG_ROW_3 ) ; Size = MAP_APPFONT ( (SWFRMPG_COL_4-SWFRMPG_COL_2) , RSC_CD_CHECKBOX_HEIGHT ) ; TabStop = TRUE ; @@ -268,6 +270,7 @@ TabPage TP_FRM_STD }; CheckBox CB_AUTOWIDTH { + HelpID = "sw:CheckBox:TP_FRM_STD:CB_AUTOWIDTH"; Pos = MAP_APPFONT ( SWFRMPG_COL_2 , SWFRMPG_ROW_4 ) ; Size = MAP_APPFONT ( (SWFRMPG_COL_4-SWFRMPG_COL_2) , RSC_CD_CHECKBOX_HEIGHT ) ; TabStop = TRUE ; @@ -289,6 +292,7 @@ TabPage TP_FRM_STD }; MetricField ED_HEIGHT { + HelpID = "sw:MetricField:TP_FRM_STD:ED_HEIGHT"; Border = TRUE ; Pos = MAP_APPFONT ( SWFRMPG_COL_3 , SWFRMPG_ROW_5 ) ; Size = MAP_APPFONT ( (SWFRMPG_COL_4-SWFRMPG_COL_3) , RSC_CD_TEXTBOX_HEIGHT ) ; @@ -306,6 +310,7 @@ TabPage TP_FRM_STD }; CheckBox CB_REL_HEIGHT { + HelpID = "sw:CheckBox:TP_FRM_STD:CB_REL_HEIGHT"; Pos = MAP_APPFONT ( SWFRMPG_COL_2 , SWFRMPG_ROW_7 ) ; Size = MAP_APPFONT ( (SWFRMPG_COL_4-SWFRMPG_COL_2) , RSC_CD_CHECKBOX_HEIGHT ) ; TabStop = TRUE ; @@ -313,6 +318,7 @@ TabPage TP_FRM_STD }; CheckBox CB_AUTOHEIGHT { + HelpID = "sw:CheckBox:TP_FRM_STD:CB_AUTOHEIGHT"; Pos = MAP_APPFONT ( SWFRMPG_COL_2 , SWFRMPG_ROW_8 ) ; Size = MAP_APPFONT ( (SWFRMPG_COL_4-SWFRMPG_COL_2) , RSC_CD_CHECKBOX_HEIGHT ) ; TabStop = TRUE ; @@ -320,6 +326,7 @@ TabPage TP_FRM_STD }; CheckBox CB_FIXEDRATIO { + HelpID = "sw:CheckBox:TP_FRM_STD:CB_FIXEDRATIO"; Pos = MAP_APPFONT ( SWFRMPG_COL_1 , SWFRMPG_ROW_9 ) ; Size = MAP_APPFONT ( (SWFRMPG_COL_4-SWFRMPG_COL_1) , RSC_CD_CHECKBOX_HEIGHT ) ; TabStop = TRUE ; @@ -327,6 +334,7 @@ TabPage TP_FRM_STD }; PushButton BT_REALSIZE { + HelpID = "sw:PushButton:TP_FRM_STD:BT_REALSIZE"; Pos = MAP_APPFONT ( 35 , 86 ) ; Size = MAP_APPFONT ( 70 , 14 ) ; TabStop = TRUE ; @@ -347,30 +355,35 @@ TabPage TP_FRM_STD }; RadioButton RB_ANCHOR_PAGE { + HelpID = "sw:RadioButton:TP_FRM_STD:RB_ANCHOR_PAGE"; Pos = MAP_APPFONT ( 122 , 14 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "To ~page"; }; RadioButton RB_ANCHOR_PARA { + HelpID = "sw:RadioButton:TP_FRM_STD:RB_ANCHOR_PARA"; Pos = MAP_APPFONT ( 122 , 28 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "To paragrap~h"; }; RadioButton RB_ANCHOR_AT_CHAR { + HelpID = "sw:RadioButton:TP_FRM_STD:RB_ANCHOR_AT_CHAR"; Pos = MAP_APPFONT ( 122 , 42 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "To cha~racter"; }; RadioButton RB_ANCHOR_AS_CHAR { + HelpID = "sw:RadioButton:TP_FRM_STD:RB_ANCHOR_AS_CHAR"; Pos = MAP_APPFONT ( 122 , 56 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "~As character" ; }; RadioButton RB_ANCHOR_FRAME { + HelpID = "sw:RadioButton:TP_FRM_STD:RB_ANCHOR_FRAME"; Pos = MAP_APPFONT ( 122 , 70 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "To ~frame"; @@ -395,6 +408,7 @@ TabPage TP_FRM_STD }; ListBox DLB_HORIZONTAL { + HelpID = "sw:ListBox:TP_FRM_STD:DLB_HORIZONTAL"; Pos = MAP_APPFONT ( 49 , SWFRMPG_ROW_11 ) ; Size = MAP_APPFONT ( 50 , 60 ) ; TabStop = TRUE ; @@ -409,6 +423,7 @@ TabPage TP_FRM_STD }; MetricField ED_AT_HORZ_POS { + HelpID = "sw:MetricField:TP_FRM_STD:ED_AT_HORZ_POS"; Border = TRUE ; Pos = MAP_APPFONT ( 123 , SWFRMPG_ROW_11 ) ; Size = MAP_APPFONT ( 35 , RSC_CD_TEXTBOX_HEIGHT ) ; @@ -433,6 +448,7 @@ TabPage TP_FRM_STD }; ListBox LB_HORI_RELATION { + HelpID = "sw:ListBox:TP_FRM_STD:LB_HORI_RELATION"; Pos = MAP_APPFONT ( 183 , SWFRMPG_ROW_11 ) ; Size = MAP_APPFONT ( 65 , 60 ) ; TabStop = TRUE ; @@ -440,6 +456,7 @@ TabPage TP_FRM_STD }; CheckBox CB_MIRROR { + HelpID = "sw:CheckBox:TP_FRM_STD:CB_MIRROR"; Pos = MAP_APPFONT ( SWFRMPG_COL_2 , SWFRMPG_ROW_13 ) ; Size = MAP_APPFONT ( (260-SWFRMPG_COL_2-1) , RSC_CD_CHECKBOX_HEIGHT ) ; TabStop = TRUE ; @@ -454,6 +471,7 @@ TabPage TP_FRM_STD }; ListBox DLB_VERTICAL { + HelpID = "sw:ListBox:TP_FRM_STD:DLB_VERTICAL"; Pos = MAP_APPFONT ( 49 , SWFRMPG_ROW_14 ) ; Size = MAP_APPFONT ( 50 , 60 ) ; TabStop = TRUE ; @@ -468,6 +486,7 @@ TabPage TP_FRM_STD }; MetricField ED_AT_VERT_POS { + HelpID = "sw:MetricField:TP_FRM_STD:ED_AT_VERT_POS"; Border = TRUE ; Pos = MAP_APPFONT ( 123 , SWFRMPG_ROW_14 ) ; Size = MAP_APPFONT ( 35 , RSC_CD_TEXTBOX_HEIGHT ) ; @@ -492,6 +511,7 @@ TabPage TP_FRM_STD }; ListBox LB_VERT_RELATION { + HelpID = "sw:ListBox:TP_FRM_STD:LB_VERT_RELATION"; Pos = MAP_APPFONT ( 183 , SWFRMPG_ROW_14 ) ; Size = MAP_APPFONT ( 65 , 60 ) ; TabStop = TRUE ; @@ -499,6 +519,7 @@ TabPage TP_FRM_STD }; CheckBox CB_FOLLOWTEXTFLOW { + HelpID = "sw:CheckBox:TP_FRM_STD:CB_FOLLOWTEXTFLOW"; Pos = MAP_APPFONT ( SWFRMPG_COL_2 , SWFRMPG_ROW_16 ) ; Size = MAP_APPFONT ( (260-SWFRMPG_COL_2-1) , RSC_CD_CHECKBOX_HEIGHT ) ; TabStop = TRUE ; @@ -540,6 +561,7 @@ TabPage TP_GRF_EXT }; Edit ED_CONNECT { + HelpID = "sw:Edit:TP_GRF_EXT:ED_CONNECT"; Pos = MAP_APPFONT ( 13 , 109 ) ; Size = MAP_APPFONT ( 200 , 12 ) ; Text [ en-US ] = "[None]" ; @@ -549,6 +571,7 @@ TabPage TP_GRF_EXT }; PushButton PB_BROWSE { + HelpID = "sw:PushButton:TP_GRF_EXT:PB_BROWSE"; Disable = TRUE ; Pos = MAP_APPFONT ( 230 , 109 ) ; Size = MAP_APPFONT ( 12 , 12 ) ; @@ -558,6 +581,7 @@ TabPage TP_GRF_EXT }; CheckBox CB_VERT { + HelpID = "sw:CheckBox:TP_GRF_EXT:CB_VERT"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 48 , 10 ) ; TabStop = TRUE ; @@ -566,6 +590,7 @@ TabPage TP_GRF_EXT }; CheckBox CB_HOR { + HelpID = "sw:CheckBox:TP_GRF_EXT:CB_HOR"; Pos = MAP_APPFONT ( 12 , 28 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; TabStop = TRUE ; @@ -573,6 +598,7 @@ TabPage TP_GRF_EXT }; RadioButton RB_MIRROR_ALL_PAGES { + HelpID = "sw:RadioButton:TP_GRF_EXT:RB_MIRROR_ALL_PAGES"; Pos = MAP_APPFONT ( 18 , 42 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; TabStop = TRUE ; @@ -580,6 +606,7 @@ TabPage TP_GRF_EXT }; RadioButton RB_MIRROR_LEFT_PAGES { + HelpID = "sw:RadioButton:TP_GRF_EXT:RB_MIRROR_LEFT_PAGES"; Pos = MAP_APPFONT ( 18 , 56 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; TabStop = TRUE ; @@ -587,6 +614,7 @@ TabPage TP_GRF_EXT }; RadioButton RB_MIRROR_RIGHT_PAGES { + HelpID = "sw:RadioButton:TP_GRF_EXT:RB_MIRROR_RIGHT_PAGES"; Pos = MAP_APPFONT ( 18 , 70 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; TabStop = TRUE ; @@ -624,6 +652,7 @@ TabPage TP_FRM_URL }; Edit ED_URL { + HelpID = "sw:Edit:TP_FRM_URL:ED_URL"; Pos = MAP_APPFONT ( 45 , 14 ) ; Size = MAP_APPFONT ( 149 , 12 ) ; Left = TRUE ; @@ -638,6 +667,7 @@ TabPage TP_FRM_URL }; Edit ED_NAME { + HelpID = "sw:Edit:TP_FRM_URL:ED_NAME"; Pos = MAP_APPFONT ( 45 , 30 ) ; Size = MAP_APPFONT ( 149 , 12 ) ; Left = TRUE ; @@ -652,6 +682,7 @@ TabPage TP_FRM_URL }; ComboBox CB_FRAME { + HelpID = "sw:ComboBox:TP_FRM_URL:CB_FRAME"; Pos = MAP_APPFONT ( 45 , 46 ) ; Size = MAP_APPFONT ( 89 , 50 ) ; Left = TRUE ; @@ -660,6 +691,7 @@ TabPage TP_FRM_URL }; PushButton PB_SEARCH { + HelpID = "sw:PushButton:TP_FRM_URL:PB_SEARCH"; Pos = MAP_APPFONT ( 198 , 13 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -673,12 +705,14 @@ TabPage TP_FRM_URL }; CheckBox CB_SERVER { + HelpID = "sw:CheckBox:TP_FRM_URL:CB_SERVER"; Pos = MAP_APPFONT ( 12 , 75 ) ; Size = MAP_APPFONT ( 236 , 10 ) ; Text [ en-US ] = "~Server-side image map"; }; CheckBox CB_CLIENT { + HelpID = "sw:CheckBox:TP_FRM_URL:CB_CLIENT"; Pos = MAP_APPFONT ( 12 , 89 ) ; Size = MAP_APPFONT ( 236 , 10 ) ; Text [ en-US ] = "~Client-side image map"; @@ -705,6 +739,7 @@ TabPage TP_FRM_ADD }; Edit ED_NAME { + HelpID = "sw:Edit:TP_FRM_ADD:ED_NAME"; Border = TRUE ; Pos = MAP_APPFONT ( 91 , 14 ) ; Size = MAP_APPFONT ( 157 , 12 ) ; @@ -718,6 +753,7 @@ TabPage TP_FRM_ADD }; Edit ED_ALT_NAME { + HelpID = "sw:Edit:TP_FRM_ADD:ED_ALT_NAME"; Border = TRUE ; Pos = MAP_APPFONT ( 91 , 30 ) ; Size = MAP_APPFONT ( 157 , 12 ) ; @@ -731,6 +767,7 @@ TabPage TP_FRM_ADD }; ListBox LB_PREV { + HelpID = "sw:ListBox:TP_FRM_ADD:LB_PREV"; Border = TRUE ; Pos = MAP_APPFONT ( 91 , 46 ) ; Size = MAP_APPFONT ( 157 , 50 ) ; @@ -749,6 +786,7 @@ TabPage TP_FRM_ADD }; ListBox LB_NEXT { + HelpID = "sw:ListBox:TP_FRM_ADD:LB_NEXT"; Border = TRUE ; Pos = MAP_APPFONT ( 91 , 62 ) ; Size = MAP_APPFONT ( 157 , 50 ) ; @@ -767,6 +805,7 @@ TabPage TP_FRM_ADD }; CheckBox CB_PROTECT_CONTENT { + HelpID = "sw:CheckBox:TP_FRM_ADD:CB_PROTECT_CONTENT"; Pos = MAP_APPFONT ( 12 , 91 ) ; Size = MAP_APPFONT ( 80 , 10 ) ; TabStop = TRUE ; @@ -774,6 +813,7 @@ TabPage TP_FRM_ADD }; CheckBox CB_PROTECT_FRAME { + HelpID = "sw:CheckBox:TP_FRM_ADD:CB_PROTECT_FRAME"; Pos = MAP_APPFONT ( 12 , 105 ) ; Size = MAP_APPFONT ( 80 , 10 ) ; TabStop = TRUE ; @@ -781,6 +821,7 @@ TabPage TP_FRM_ADD }; CheckBox CB_PROTECT_SIZE { + HelpID = "sw:CheckBox:TP_FRM_ADD:CB_PROTECT_SIZE"; Pos = MAP_APPFONT ( 12 , 119 ) ; Size = MAP_APPFONT ( 80 , 10 ) ; TabStop = TRUE ; @@ -794,6 +835,7 @@ TabPage TP_FRM_ADD }; CheckBox CB_EDIT_IN_READONLY { + HelpID = "sw:CheckBox:TP_FRM_ADD:CB_EDIT_IN_READONLY"; Pos = MAP_APPFONT ( 12 , 146 ) ; Size = MAP_APPFONT ( 236 , 10 ) ; TabStop = TRUE ; @@ -801,6 +843,7 @@ TabPage TP_FRM_ADD }; CheckBox CB_PRINT_FRAME { + HelpID = "sw:CheckBox:TP_FRM_ADD:CB_PRINT_FRAME"; Pos = MAP_APPFONT ( 12 , 160 ) ; Size = MAP_APPFONT ( 236 , 10 ) ; TabStop = TRUE ; @@ -823,6 +866,7 @@ TabPage TP_FRM_ADD }; ListBox LB_TEXTFLOW { + HelpID = "sw:ListBox:TP_FRM_ADD:LB_TEXTFLOW"; Border = TRUE ; Pos = MAP_APPFONT ( 81 , 172 ) ; Size = MAP_APPFONT ( 167 , 50 ) ; diff --git a/sw/source/ui/frmdlg/wrap.src b/sw/source/ui/frmdlg/wrap.src index 6810f55e1a..1680f3d93b 100644 --- a/sw/source/ui/frmdlg/wrap.src +++ b/sw/source/ui/frmdlg/wrap.src @@ -44,6 +44,7 @@ TabPage TP_FRM_WRAP }; ImageRadioButton RB_NO_WRAP { + HelpID = "sw:ImageRadioButton:TP_FRM_WRAP:RB_NO_WRAP"; Pos = MAP_APPFONT ( 6 , 14 ) ; Size = MAP_APPFONT ( 40 , 37 ) ; WordBreak = TRUE; @@ -52,6 +53,7 @@ TabPage TP_FRM_WRAP }; ImageRadioButton RB_WRAP_LEFT { + HelpID = "sw:ImageRadioButton:TP_FRM_WRAP:RB_WRAP_LEFT"; Pos = MAP_APPFONT ( 65 , 14 ) ; Size = MAP_APPFONT ( 40 , 37 ) ; WordBreak = TRUE; @@ -60,6 +62,7 @@ TabPage TP_FRM_WRAP }; ImageRadioButton RB_WRAP_RIGHT { + HelpID = "sw:ImageRadioButton:TP_FRM_WRAP:RB_WRAP_RIGHT"; Pos = MAP_APPFONT ( 121 , 14 ) ; Size = MAP_APPFONT ( 40 , 37 ) ; WordBreak = TRUE; @@ -68,6 +71,7 @@ TabPage TP_FRM_WRAP }; ImageRadioButton RB_WRAP_PARALLEL { + HelpID = "sw:ImageRadioButton:TP_FRM_WRAP:RB_WRAP_PARALLEL"; Pos = MAP_APPFONT ( 177 , 14 ) ; Size = MAP_APPFONT ( 40 , 37 ) ; WordBreak = TRUE; @@ -76,6 +80,7 @@ TabPage TP_FRM_WRAP }; ImageRadioButton RB_WRAP_THROUGH { + HelpID = "sw:ImageRadioButton:TP_FRM_WRAP:RB_WRAP_THROUGH"; Pos = MAP_APPFONT ( 6 , 57 ) ; Size = MAP_APPFONT ( 40 , 37 ) ; WordBreak = TRUE; @@ -84,6 +89,7 @@ TabPage TP_FRM_WRAP }; ImageRadioButton RB_WRAP_IDEAL { + HelpID = "sw:ImageRadioButton:TP_FRM_WRAP:RB_WRAP_IDEAL"; Pos = MAP_APPFONT ( 65 , 57 ) ; Size = MAP_APPFONT ( 40 , 37 ) ; WordBreak = TRUE; @@ -93,18 +99,21 @@ TabPage TP_FRM_WRAP CheckBox CB_ANCHOR_ONLY { + HelpID = "sw:CheckBox:TP_FRM_WRAP:CB_ANCHOR_ONLY"; Pos = MAP_APPFONT ( 139 , 111 ) ; Size = MAP_APPFONT ( 109 , 10 ) ; Text [ en-US ] = "~First paragraph" ; }; CheckBox CB_TRANSPARENT { + HelpID = "sw:CheckBox:TP_FRM_WRAP:CB_TRANSPARENT"; Pos = MAP_APPFONT ( 139 , 125 ) ; Size = MAP_APPFONT ( 109 , 10 ) ; Text [ en-US ] = "In bac~kground" ; }; CheckBox CB_OUTLINE { + HelpID = "sw:CheckBox:TP_FRM_WRAP:CB_OUTLINE"; Pos = MAP_APPFONT ( 139 , 139 ) ; Size = MAP_APPFONT ( 109 , 10 ) ; Hide = TRUE ; @@ -112,6 +121,7 @@ TabPage TP_FRM_WRAP }; CheckBox CB_ONLYOUTSIDE { + HelpID = "sw:CheckBox:TP_FRM_WRAP:CB_ONLYOUTSIDE"; Pos = MAP_APPFONT ( 139 , 153 ) ; Size = MAP_APPFONT ( 109 , 10 ) ; Hide = TRUE ; @@ -138,6 +148,7 @@ TabPage TP_FRM_WRAP }; MetricField ED_LEFT_MARGIN { + HelpID = "sw:MetricField:TP_FRM_WRAP:ED_LEFT_MARGIN"; Border = TRUE ; Pos = MAP_APPFONT ( 81 , 111 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -160,6 +171,7 @@ TabPage TP_FRM_WRAP }; MetricField ED_RIGHT_MARGIN { + HelpID = "sw:MetricField:TP_FRM_WRAP:ED_RIGHT_MARGIN"; Border = TRUE ; Pos = MAP_APPFONT ( 81 , 127 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -182,6 +194,7 @@ TabPage TP_FRM_WRAP }; MetricField ED_TOP_MARGIN { + HelpID = "sw:MetricField:TP_FRM_WRAP:ED_TOP_MARGIN"; Border = TRUE ; Pos = MAP_APPFONT ( 81 , 143 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -204,6 +217,7 @@ TabPage TP_FRM_WRAP }; MetricField ED_BOTTOM_MARGIN { + HelpID = "sw:MetricField:TP_FRM_WRAP:ED_BOTTOM_MARGIN"; Border = TRUE ; Pos = MAP_APPFONT ( 81 , 159 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; diff --git a/sw/source/ui/inc/frmdlg.hxx b/sw/source/ui/inc/frmdlg.hxx index fa39f4b293..43be092b58 100644 --- a/sw/source/ui/inc/frmdlg.hxx +++ b/sw/source/ui/inc/frmdlg.hxx @@ -41,6 +41,7 @@ class SwFrmDlg : public SfxTabDialog BOOL m_bFormat; BOOL m_bNew; BOOL m_bHTMLMode; + bool m_bEnableVertPos; const SfxItemSet& m_rSet; USHORT m_nDlgType; SwWrtShell* m_pWrtShell; diff --git a/sw/source/ui/inc/frmpage.hxx b/sw/source/ui/inc/frmpage.hxx index a858c23199..1f097d1c29 100644 --- a/sw/source/ui/inc/frmpage.hxx +++ b/sw/source/ui/inc/frmpage.hxx @@ -28,27 +28,17 @@ #ifndef _FRMPAGE_HXX #define _FRMPAGE_HXX -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif #include <sfx2/tabdlg.hxx> #include <svx/swframeposstrings.hxx> #include <swtypes.hxx> #include <bmpwin.hxx> #include <svx/swframeexample.hxx> #include <prcntfld.hxx> -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif namespace sfx2{class FileDialogHelper;} @@ -142,6 +132,10 @@ class SwFrmPage: public SfxTabPage FrmMap* pVMap; FrmMap* pHMap; + bool m_bAllowVertPositioning; + bool m_bIsMathOLE; + bool m_bIsMathBaselineAlignment; + virtual void ActivatePage(const SfxItemSet& rSet); virtual int DeactivatePage(SfxItemSet *pSet); @@ -205,6 +199,7 @@ public: void SetFormatUsed(BOOL bFmt); void SetFrmType(USHORT nType) { nDlgType = nType; } inline BOOL IsInGraficMode( void ) { return nDlgType == DLG_FRM_GRF || nDlgType == DLG_FRM_OLE; } + void EnableVerticalPositioning( bool bEnable ); }; class SwGrfExtPage: public SfxTabPage diff --git a/sw/source/ui/inc/optpage.hxx b/sw/source/ui/inc/optpage.hxx index 60e15f866b..fa0af2e473 100644 --- a/sw/source/ui/inc/optpage.hxx +++ b/sw/source/ui/inc/optpage.hxx @@ -353,6 +353,12 @@ class SwShdwCrsrOptionsTabPage : public SfxTabPage FixedLine aCrsrOptFL; CheckBox aCrsrInProtCB; + FixedLine m_aLayoutOptionsFL; + CheckBox m_aMathBaselineAlignmentCB; + + SwWrtShell * m_pWrtShell; + + SwShdwCrsrOptionsTabPage( Window* pParent, const SfxItemSet& rSet ); ~SwShdwCrsrOptionsTabPage(); @@ -362,6 +368,9 @@ public: virtual BOOL FillItemSet( SfxItemSet& rSet ); virtual void Reset( const SfxItemSet& rSet ); + + void SetWrtShell( SwWrtShell * pSh ) { m_pWrtShell = pSh; } + virtual void PageCreated( SfxAllItemSet aSet ); }; /*----------------------------------------------------------------------- @@ -498,5 +507,3 @@ private: }; #endif //PRODUCT #endif - - diff --git a/sw/source/ui/inc/ribbar.hrc b/sw/source/ui/inc/ribbar.hrc index 892261512a..301acb1ddc 100644 --- a/sw/source/ui/inc/ribbar.hrc +++ b/sw/source/ui/inc/ribbar.hrc @@ -69,10 +69,7 @@ #define MN_CALC_POPUP (RC_RIBBAR_BEGIN + 22) #define MN_NUMNAMES_POPUP (RC_RIBBAR_BEGIN + 23) -#define RID_INSERT_CTRL (RC_RIBBAR_BEGIN + 24) -#define RID_INSERT_OBJ_CTRL (RC_RIBBAR_BEGIN + 25) #define RID_INSERT_FIELD_CTRL (RC_RIBBAR_BEGIN + 26) -#define RID_TBL_OPT_CTRL (RC_RIBBAR_BEGIN + 27) #define RID_BEZIER_WIN (RC_RIBBAR_BEGIN + 28) #define RID_SCROLL_NAVI_TBX (RC_RIBBAR_BEGIN + 29) #define RID_SCROLL_NAVIGATION_WIN (RC_RIBBAR_BEGIN + 30) diff --git a/sw/source/ui/inc/swmn_tmpl.hrc b/sw/source/ui/inc/swmn_tmpl.hrc index af1c013c1a..911309c8a5 100644 --- a/sw/source/ui/inc/swmn_tmpl.hrc +++ b/sw/source/ui/inc/swmn_tmpl.hrc @@ -57,7 +57,7 @@ MenuItem\ {\ Identifier = FN_FORMAT_PAGE_DLG ; \ - HelpID = FN_FORMAT_PAGE_DLG ; \ + HelpId = CMD_FN_FORMAT_PAGE_DLG ; \ Text [ en-US ] = "Pa~ge..." ; \ }; @@ -74,7 +74,6 @@ MenuItem\ {\ Identifier = MN_FORMAT_STYLE ; \ - HelpID = MN_FORMAT_STYLE ; \ Command = ".uno:StyleMenu" ; \ Text [ en-US ] = "St~yle" ; \ SubMenu = Menu\ @@ -113,13 +112,13 @@ MenuItem\ {\ Identifier = FN_SET_SUPER_SCRIPT ; \ - HelpID = FN_SET_SUPER_SCRIPT ; \ + HelpId = CMD_FN_SET_SUPER_SCRIPT ; \ Text [ en-US ] = "Superscript" ; \ };\ MenuItem\ {\ Identifier = FN_SET_SUB_SCRIPT ; \ - HelpID = FN_SET_SUB_SCRIPT ; \ + HelpId = CMD_FN_SET_SUB_SCRIPT ; \ Text [ en-US ] = "Subscript" ; \ };\ };\ @@ -128,7 +127,6 @@ MenuItem\ {\ Identifier = MN_FORMAT_ALGN ; \ - HelpID = MN_FORMAT_ALGN ; \ Command = ".uno:AlignTextMenu" ; \ Text [ en-US ] = "A~lignment" ; \ SubMenu = Menu\ @@ -153,7 +151,7 @@ MenuItem\ {\ Identifier = SID_ATTR_PARA_ADJUST_BLOCK ; \ - HelpID = SID_ATTR_PARA_ADJUST_BLOCK ; \ + HelpId = CMD_SID_ATTR_PARA_ADJUST_BLOCK ; \ RadioCheck = TRUE ; \ Text [ en-US ] = "Justified" ; \ };\ @@ -163,7 +161,6 @@ MenuItem\ {\ Identifier = MN_FORMAT_LINESPACE ; \ - HelpID = MN_FORMAT_LINESPACE ; \ Command = ".uno:LineSpacingMenu" ; \ Text [ en-US ] = "Line Spacing" ; \ _MenuItemFlags = MIB_RADIOCHECK ; \ @@ -208,21 +205,21 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml MenuItem \ { \ Identifier = FN_EDIT_FIELD ; \ - HelpID = FN_EDIT_FIELD ; \ + HelpId = CMD_FN_EDIT_FIELD ; \ Text [ en-US ] = "Fields..." ; \ }; #define _MN_EDIT_FOOTNOTE \ MenuItem \ { \ Identifier = FN_EDIT_FOOTNOTE ; \ - HelpID = FN_EDIT_FOOTNOTE ; \ + HelpId = CMD_FN_EDIT_FOOTNOTE ; \ Text [ en-US ] = "Footnote/Endnote~..." ; \ }; #define _MN_EDIT_IDX_ENTRY_DLG \ MenuItem \ { \ Identifier = FN_EDIT_IDX_ENTRY_DLG ; \ - HelpID = FN_EDIT_IDX_ENTRY_DLG ; \ + HelpId = CMD_FN_EDIT_IDX_ENTRY_DLG ; \ Text [ en-US ] = "Inde~x Entry..." ; \ }; @@ -230,13 +227,13 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml MenuItem \ { \ Identifier = FN_REDLINE_ACCEPT_DIRECT; \ - HelpID = FN_REDLINE_ACCEPT_DIRECT ; \ + HelpId = CMD_FN_REDLINE_ACCEPT_DIRECT ; \ Text [ en-US ] = "Accept Change" ; \ };\ MenuItem \ { \ Identifier = FN_REDLINE_REJECT_DIRECT ; \ - HelpID = FN_REDLINE_REJECT_DIRECT ; \ + HelpId = CMD_FN_REDLINE_REJECT_DIRECT ; \ Text [ en-US ] = "Reject Change" ; \ }; \ SEPARATOR ; @@ -244,7 +241,7 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml MenuItem \ { \ Identifier = FN_EDIT_AUTH_ENTRY_DLG ; \ - HelpID = FN_EDIT_AUTH_ENTRY_DLG ; \ + HelpId = CMD_FN_EDIT_AUTH_ENTRY_DLG ; \ Text [ en-US ] = "~Bibliography Entry..."; \ }; \ SEPARATOR ; @@ -257,19 +254,19 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml MenuItem \ { \ Identifier = FN_EDIT_HYPERLINK ; \ - HelpID = FN_EDIT_HYPERLINK ; \ + HelpId = CMD_FN_EDIT_HYPERLINK ; \ Text [ en-US ] = "Edit Hyperlink..."; \ }; \ MenuItem \ { \ Identifier = FN_COPY_HYPERLINK_LOCATION; \ - HelpID = FN_COPY_HYPERLINK_LOCATION; \ + HelpId = CMD_FN_COPY_HYPERLINK_LOCATION; \ Text [ en-US ] = "Copy Hyperlink ~Location"; \ }; \ MenuItem \ { \ Identifier = FN_REMOVE_HYPERLINK ; \ - HelpID = FN_REMOVE_HYPERLINK ; \ + HelpId = CMD_FN_REMOVE_HYPERLINK ; \ Text [ en-US ] = "Remo~ve Hyperlink"; \ }; @@ -283,7 +280,7 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml MenuItem\ {\ Identifier = FN_EDIT_HYPERLINK ; \ - HelpID = FN_EDIT_HYPERLINK ; \ + HelpId = CMD_FN_EDIT_HYPERLINK ; \ Text [ en-US ] = "~Edit Hyperlink" ; \ }; @@ -306,7 +303,7 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml MenuItem\ {\ Identifier = FN_FORMAT_RESET ; \ - HelpID = FN_FORMAT_RESET ; \ + HelpId = CMD_FN_FORMAT_RESET ; \ Text [ en-US ] = "~Default Formatting" ; \ }; @@ -315,25 +312,25 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml MenuItem \ { \ Identifier = FN_NUMBER_NEWSTART; \ - HelpId = FN_NUMBER_NEWSTART; \ + HelpId = CMD_FN_NUMBER_NEWSTART; \ Text[ en-US ] = "Restart Numbering"; \ }; \ MenuItem \ { \ Identifier = FN_NUM_CONTINUE; \ - HelpId = FN_NUM_CONTINUE; \ + HelpId = CMD_FN_NUM_CONTINUE; \ Text[ en-US ] = "Continue previous numbering"; \ }; \ MenuItem \ { \ Identifier = FN_NUM_BULLET_UP; \ - HelpId = FN_NUM_BULLET_UP; \ + HelpId = CMD_FN_NUM_BULLET_UP; \ Text[ en-US ] = "Up One Level"; \ }; \ MenuItem \ { \ Identifier = FN_NUM_BULLET_DOWN; \ - HelpId = FN_NUM_BULLET_DOWN; \ + HelpId = CMD_FN_NUM_BULLET_DOWN; \ Text[ en-US ] = "Down One Level"; \ }; @@ -356,19 +353,19 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml MenuItem \ { \ Identifier = FN_UPDATE_CUR_TOX ; \ - HelpID = FN_UPDATE_CUR_TOX ; \ + HelpId = CMD_FN_UPDATE_CUR_TOX ; \ Text [ en-US ] = "~Update Index/Table"; \ }; \ MenuItem \ { \ Identifier = FN_EDIT_CURRENT_TOX; \ - HelpID = FN_EDIT_CURRENT_TOX; \ + HelpId = CMD_FN_EDIT_CURRENT_TOX; \ Text [ en-US ] = "~Edit Index/Table"; \ }; \ MenuItem \ { \ Identifier = FN_REMOVE_CUR_TOX; \ - HelpID = FN_REMOVE_CUR_TOX; \ + HelpId = CMD_FN_REMOVE_CUR_TOX; \ Text [ en-US ] = "Delete Index/Table"; \ }; \ SEPARATOR ; diff --git a/sw/source/ui/inc/swuicnttab.hxx b/sw/source/ui/inc/swuicnttab.hxx index 5bb247187d..6038f4a2de 100644 --- a/sw/source/ui/inc/swuicnttab.hxx +++ b/sw/source/ui/inc/swuicnttab.hxx @@ -163,6 +163,8 @@ class SwTOXSelectTabPage : public SfxTabPage // PushButton aChapterDlgPB; //#outline level,removed by zhaojianwei CheckBox aAddStylesCB; PushButton aAddStylesPB; + Point aAddStylesPosDef; + Point aAddStylesPosUser; //user CheckBox aFromTablesCB; CheckBox aFromFramesCB; diff --git a/sw/source/ui/inc/unotxvw.hxx b/sw/source/ui/inc/unotxvw.hxx index 828016c6e3..e074e37dda 100644 --- a/sw/source/ui/inc/unotxvw.hxx +++ b/sw/source/ui/inc/unotxvw.hxx @@ -156,7 +156,7 @@ public: void Invalidate(); // temporary document used for PDF export of selections/multi-selections - SfxObjectShellRef BuildTmpSelectionDoc( SfxObjectShellRef& ); + SfxObjectShellRef BuildTmpSelectionDoc(); }; /* -----------------17.09.98 12:52------------------- diff --git a/sw/source/ui/inc/usrpref.hxx b/sw/source/ui/inc/usrpref.hxx index 9f3f3e4f39..21b3e64405 100644 --- a/sw/source/ui/inc/usrpref.hxx +++ b/sw/source/ui/inc/usrpref.hxx @@ -147,6 +147,8 @@ class SwMasterUsrPref : public SwViewOption sal_Int32 nDefTab; //default tab stop distance sal_Bool bIsSquaredPageMode; //default page mode for text grid + sal_Bool bIsAlignMathObjectsToBaseline; + SwContentViewConfig aContentConfig; SwLayoutViewConfig aLayoutConfig; SwGridConfig aGridConfig; @@ -271,6 +273,13 @@ public: aLayoutConfig.SetModified(); } + sal_Bool IsAlignMathObjectsToBaseline() const { return bIsAlignMathObjectsToBaseline; } + void SetAlignMathObjectsToBaseline( sal_Bool bVal, sal_Bool bNoModify = sal_False ) + { + bIsAlignMathObjectsToBaseline = bVal; + if(!bNoModify) + aLayoutConfig.SetModified(); + } }; #endif diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx index 85b33fda78..a5e5ff1918 100644 --- a/sw/source/ui/inc/view.hxx +++ b/sw/source/ui/inc/view.hxx @@ -83,7 +83,6 @@ class CommandEvent; class InsCaptionOpt; class SvGlobalName; class SvtAccessibilityOptions; -class SwPrtOptions; class SwTransferable; class SwMailMergeConfigItem; class SwTxtNode; // #i23726# diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx index 14b26c0391..f7f423a440 100644 --- a/sw/source/ui/inc/wrtsh.hxx +++ b/sw/source/ui/inc/wrtsh.hxx @@ -320,9 +320,6 @@ typedef BOOL (SwWrtShell:: *FNSimpleMove)(); void InsertTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0); BOOL UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0); - // new fields - BOOL UpdateField( sw::mark::IFieldmark &fieldBM); - // Numerierung und Bullets /** Turns on numbering or bullets. diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 5d9a390600..2da99a6f6c 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -828,7 +828,7 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(Window* pParent, rHB.Show(); SwIndexTreeLB& rTLB = aHeaderTree.GetTreeListBox(); - rTLB.SetWindowBits(WB_CLIPCHILDREN|WB_SORT); + rTLB.SetStyle(rTLB.GetStyle()|WB_CLIPCHILDREN|WB_SORT); //aStylesTLB.SetSelectHdl(LINK(this, SwAddStylesDlg_Impl, SelectHdl)); rTLB.GetModel()->SetSortMode(SortAscending); for(i = 0; i < MAXLEVEL; ++i) @@ -1523,7 +1523,19 @@ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox) //aAddStylesPB.SetPosPixel(aPos); //} //else if( nType & TO_ILLUSTRATION )//<-removed end. - if( nType & TO_ILLUSTRATION ) //add by zhaojianwei + // initialize button positions + + //#i111993# add styles button has two different positions + if( !aAddStylesPosDef.X() ) + { + aAddStylesPosDef = ( aAddStylesPB.GetPosPixel() ); + // move left! + Point aPos(aAddStylesPosDef); + aPos.X() -= 2 * aAddStylesPB.GetSizePixel().Width(); + aAddStylesPosUser = aPos; + } + + if( nType & TO_ILLUSTRATION ) //add by zhaojianwei aCaptionSequenceLB.SelectEntry( SwStyleNameMapper::GetUIName( RES_POOLCOLL_LABEL_ABB, aEmptyStr )); else if( nType & TO_TABLE ) @@ -1532,11 +1544,11 @@ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox) else if( nType & TO_USER ) { aAddStylesCB.SetText(sAddStyleUser); - // move left! - Point aPos(aAddStylesPB.GetPosPixel()); - // aPos.X() = aChapterDlgPB.GetPosPixel().X(); - aPos.X() -= 2 * aAddStylesPB.GetSizePixel().Width(); - aAddStylesPB.SetPosPixel(aPos); + aAddStylesPB.SetPosPixel(aAddStylesPosUser); + } + else if( nType & TO_CONTENT ) + { + aAddStylesPB.SetPosPixel(aAddStylesPosDef); } aCollectSameCB.Show( 0 != (nType & TO_INDEX) ); @@ -2124,7 +2136,7 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet FreeResource(); sLevelStr = aLevelFT.GetText(); - aLevelLB.SetWindowBits( WB_HSCROLL ); + aLevelLB.SetStyle( aLevelLB.GetStyle() | WB_HSCROLL ); aLevelLB.SetSpaceBetweenEntries(0); aLevelLB.SetSelectionMode( SINGLE_SELECTION ); aLevelLB.SetHighlightRange(); // select full width diff --git a/sw/source/ui/index/cnttab.src b/sw/source/ui/index/cnttab.src index 8220ed42ba..4532c50658 100644 --- a/sw/source/ui/index/cnttab.src +++ b/sw/source/ui/index/cnttab.src @@ -132,6 +132,7 @@ TabPage TP_TOX_SELECT }; Edit ED_TITLE { + HelpID = "sw:Edit:TP_TOX_SELECT:ED_TITLE"; Pos = MAP_APPFONT ( 45 , 14 ) ; Size = MAP_APPFONT ( 203 , 12 ) ; Border = TRUE; @@ -144,6 +145,7 @@ TabPage TP_TOX_SELECT }; ListBox LB_TYPE { + HelpID = "sw:ListBox:TP_TOX_SELECT:LB_TYPE"; Pos = MAP_APPFONT ( 45 , 30 ) ; Size = MAP_APPFONT ( 80 , 80 ) ; TabStop = TRUE ; @@ -161,6 +163,7 @@ TabPage TP_TOX_SELECT }; CheckBox CB_READONLY { + HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_READONLY"; Pos = MAP_APPFONT ( 51 , 46 ) ; Size = MAP_APPFONT ( 200 , 10 ) ; Check = TRUE; @@ -180,6 +183,7 @@ TabPage TP_TOX_SELECT }; ListBox LB_AREA { + HelpID = "sw:ListBox:TP_TOX_SELECT:LB_AREA"; Pos = MAP_APPFONT ( 45 , 70 ) ; Size = MAP_APPFONT ( 80 , 12 ) ; TabStop = TRUE ; @@ -198,6 +202,7 @@ TabPage TP_TOX_SELECT }; NumericField NF_LEVEL { + HelpID = "sw:NumericField:TP_TOX_SELECT:NF_LEVEL"; Pos = MAP_APPFONT ( 231 , 72 ) ; Size = MAP_APPFONT ( 20 , 12 ) ; Border = TRUE ; @@ -218,6 +223,7 @@ TabPage TP_TOX_SELECT }; CheckBox CB_FROMHEADINGS { + HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_FROMHEADINGS"; Pos = MAP_APPFONT ( 12 , 99 ) ; Size = MAP_APPFONT ( 95 , 10 ) ; Check = TRUE; @@ -234,6 +240,7 @@ TabPage TP_TOX_SELECT */ CheckBox CB_ADDSTYLES { + HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_ADDSTYLES"; Pos = MAP_APPFONT ( 12 , 115 ) ; Size = MAP_APPFONT ( 75 , 10 ) ; Text [ en-US ] = "~Additional Styles"; @@ -244,6 +251,7 @@ TabPage TP_TOX_SELECT }; PushButton PB_ADDSTYLES { + HelpID = "sw:PushButton:TP_TOX_SELECT:PB_ADDSTYLES"; Pos = MAP_APPFONT ( 115 , 114 ) ; Size = MAP_APPFONT ( 12 , 12 ) ; Text = "..." ; @@ -251,6 +259,7 @@ TabPage TP_TOX_SELECT }; CheckBox CB_TOXMARKS { + HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_TOXMARKS"; Pos = MAP_APPFONT ( 12 , 131 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; Text [ en-US ] = "Inde~x marks"; @@ -258,6 +267,7 @@ TabPage TP_TOX_SELECT RadioButton RB_FROMCAPTIONS { + HelpID = "sw:RadioButton:TP_TOX_SELECT:RB_FROMCAPTIONS"; Pos = MAP_APPFONT ( 12 , 98 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; Text [ en-US ] = "Captions"; @@ -270,6 +280,7 @@ TabPage TP_TOX_SELECT }; ListBox LB_CAPTIONSEQUENCE { + HelpID = "sw:ListBox:TP_TOX_SELECT:LB_CAPTIONSEQUENCE"; Pos = MAP_APPFONT ( 55 , 112 ) ; Size = MAP_APPFONT ( 70 , 40 ) ; DropDown = TRUE; @@ -283,6 +294,7 @@ TabPage TP_TOX_SELECT }; ListBox LB_DISPLAYTYPE { + HelpID = "sw:ListBox:TP_TOX_SELECT:LB_DISPLAYTYPE"; Pos = MAP_APPFONT ( 55 , 128 ) ; Size = MAP_APPFONT ( 70 , 40 ) ; DropDown = TRUE; @@ -296,54 +308,63 @@ TabPage TP_TOX_SELECT }; RadioButton RB_FROMOBJECTNAMES { + HelpID = "sw:RadioButton:TP_TOX_SELECT:RB_FROMOBJECTNAMES"; Pos = MAP_APPFONT ( 156 , 98 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; Text [ en-US ] = "Object names"; }; CheckBox CB_COLLECTSAME { + HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_COLLECTSAME"; Pos = MAP_APPFONT ( 12 , 98 ) ; Size = MAP_APPFONT ( 121 , 10 ) ; Text [ en-US ] = "Combine identical entries"; }; CheckBox CB_USEFF { + HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_USEFF"; Pos = MAP_APPFONT ( 18 , 111 ) ; Size = MAP_APPFONT ( 115 , 10 ) ; Text [ en-US ] = "Combine identical entries with p or ~pp"; }; CheckBox CB_USE_DASH { + HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_USE_DASH"; Pos = MAP_APPFONT ( 18 , 124 ) ; Size = MAP_APPFONT ( 115 , 10 ) ; Text [ en-US ] = "Combine with -"; }; CheckBox CB_CASESENSITIVE { + HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_CASESENSITIVE"; Pos = MAP_APPFONT ( 18 , 137 ) ; Size = MAP_APPFONT ( 115 , 10 ) ; Text [ en-US ] = "Case sensitive"; }; CheckBox CB_INITIALCAPS { + HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_INITIALCAPS"; Pos = MAP_APPFONT ( 136 , 98 ) ; Size = MAP_APPFONT ( 115 , 10 ) ; Text [ en-US ] = "AutoCapitalize entries"; }; CheckBox CB_KEYASENTRY { + HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_KEYASENTRY"; Pos = MAP_APPFONT ( 136, 111 ) ; Size = MAP_APPFONT ( 115 , 10 ) ; Text [ en-US ] = "Keys as separate entries"; }; CheckBox CB_FROMFILE { + HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_FROMFILE"; Pos = MAP_APPFONT ( 136 , 124 ) ; Size = MAP_APPFONT ( 115 , 10 ) ; Text [ en-US ] = "~Concordance file"; }; MenuButton MB_AUTOMARK { + HelpID = "sw:MenuButton:TP_TOX_SELECT:MB_AUTOMARK"; Pos = MAP_APPFONT ( 136 , 137 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -372,30 +393,35 @@ TabPage TP_TOX_SELECT }; CheckBox CB_FROMTABLES { + HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_FROMTABLES"; Pos = MAP_APPFONT ( 112 , 99 ) ; Size = MAP_APPFONT ( 68 , 10 ) ; Text [ en-US ] = "Tables"; }; CheckBox CB_FROMFRAMES { + HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_FROMFRAMES"; Pos = MAP_APPFONT ( 182 , 99 ) ; Size = MAP_APPFONT ( 68 , 10 ) ; Text [ en-US ] = "Te~xt frames"; }; CheckBox CB_FROMGRAPHICS { + HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_FROMGRAPHICS"; Pos = MAP_APPFONT ( 112 , 113 ) ; Size = MAP_APPFONT ( 68 , 10 ) ; Text [ en-US ] = "Graphics"; }; CheckBox CB_FROMOLE { + HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_FROMOLE"; Pos = MAP_APPFONT ( 182 , 113 ) ; Size = MAP_APPFONT ( 68 , 10 ) ; Text [ en-US ] = "OLE objects"; }; CheckBox CB_LEVELFROMCHAPTER { + HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_LEVELFROMCHAPTER"; Pos = MAP_APPFONT ( 118 , 127 ) ; Size = MAP_APPFONT ( 103 , 10 ) ; Text [ en-US ] = "Use level from source chapter"; @@ -443,6 +469,7 @@ TabPage TP_TOX_SELECT }; CheckBox CB_SEQUENCE { + HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_SEQUENCE"; Pos = MAP_APPFONT ( 12, 70) ; Size = MAP_APPFONT ( 100, 10 ) ; Text [ en-US ] = "~Number entries"; @@ -455,6 +482,7 @@ TabPage TP_TOX_SELECT }; ListBox LB_BRACKET { + HelpID = "sw:ListBox:TP_TOX_SELECT:LB_BRACKET"; Pos = MAP_APPFONT ( 75, 84) ; Size = MAP_APPFONT ( 40, 50 ) ; Border = TRUE; @@ -495,6 +523,7 @@ TabPage TP_TOX_SELECT }; ListBox LB_LANGUAGE { + HelpID = "sw:ListBox:TP_TOX_SELECT:LB_LANGUAGE"; Pos = MAP_APPFONT ( 47, 164) ; Size = MAP_APPFONT ( 80, 50 ) ; Border = TRUE; @@ -508,6 +537,7 @@ TabPage TP_TOX_SELECT }; ListBox LB_SORTALG { + HelpID = "sw:ListBox:TP_TOX_SELECT:LB_SORTALG"; Pos = MAP_APPFONT ( 201, 164) ; Size = MAP_APPFONT ( 50, 50 ) ; Border = TRUE; @@ -549,6 +579,7 @@ TabPage TP_TOX_ENTRY Size = MAP_APPFONT ( 136, 12 ) ; ImageButton WIN_LEFT_SCROLL { + HelpID = "sw:ImageButton:TP_TOX_ENTRY:WIN_LEFT_SCROLL"; Pos = MAP_APPFONT ( 0, 0 ) ; Size = MAP_APPFONT ( 10, 12 ) ; Symbol = IMAGEBUTTON_ARROW_LEFT; @@ -563,6 +594,7 @@ TabPage TP_TOX_ENTRY }; ImageButton WIN_RIGHT_SCROLL { + HelpID = "sw:ImageButton:TP_TOX_ENTRY:WIN_RIGHT_SCROLL"; Pos = MAP_APPFONT ( 126, 0 ) ; Size = MAP_APPFONT ( 10, 12 ) ; Symbol = IMAGEBUTTON_ARROW_RIGHT; @@ -649,48 +681,56 @@ TabPage TP_TOX_ENTRY }; PushButton PB_ALL_LEVELS { + HelpID = "sw:PushButton:TP_TOX_ENTRY:PB_ALL_LEVELS"; Pos = MAP_APPFONT ( 209 , 14 ) ; Size = MAP_APPFONT ( 40, 14 ) ; Text [ en-US ] = "~All"; }; PushButton PB_ENTRYNO { + HelpID = "sw:PushButton:TP_TOX_ENTRY:PB_ENTRYNO"; Pos = MAP_APPFONT ( 37 , 32 ) ; Size = MAP_APPFONT ( 40, 14 ) ; Text [ en-US ] = "Chapter no."; }; PushButton PB_ENTRY { + HelpID = "sw:PushButton:TP_TOX_ENTRY:PB_ENTRY"; Pos = MAP_APPFONT ( 80, 32 ) ; Size = MAP_APPFONT ( 40, 14 ) ; Text [ en-US ] = "Entry text"; }; PushButton PB_CHAPTERINFO { + HelpID = "sw:PushButton:TP_TOX_ENTRY:PB_CHAPTERINFO"; Pos = MAP_APPFONT ( 123 , 32 ) ; Size = MAP_APPFONT ( 40, 14) ; Text [ en-US ] = "~Chapter info"; }; PushButton PB_PAGENO { + HelpID = "sw:PushButton:TP_TOX_ENTRY:PB_PAGENO"; Pos = MAP_APPFONT ( 166 , 32 ) ; Size = MAP_APPFONT ( 40, 14 ) ; Text [ en-US ] = "Page no."; }; PushButton PB_TAB { + HelpID = "sw:PushButton:TP_TOX_ENTRY:PB_TAB"; Pos = MAP_APPFONT ( 209 ,32 ) ; Size = MAP_APPFONT ( 40, 14 ) ; Text [ en-US ] = "Tab stop"; }; PushButton PB_HYPERLINK { + HelpID = "sw:PushButton:TP_TOX_ENTRY:PB_HYPERLINK"; Pos = MAP_APPFONT ( 209 , 32 ) ; Size = MAP_APPFONT ( 40, 14 ) ; Text [ en-US ] = "H~yperlink"; }; ListBox LB_AUTHFIELD { + HelpID = "sw:ListBox:TP_TOX_ENTRY:LB_AUTHFIELD"; Pos = MAP_APPFONT ( 37 , 33 ) ; Size = MAP_APPFONT ( 59, 60 ) ; DropDown = TRUE; @@ -699,12 +739,14 @@ TabPage TP_TOX_ENTRY }; PushButton PB_AUTHINSERT { + HelpID = "sw:PushButton:TP_TOX_ENTRY:PB_AUTHINSERT"; Pos = MAP_APPFONT ( 99 , 32 ) ; Size = MAP_APPFONT ( 39, 14 ) ; Text [ en-US ] = "~Insert"; }; PushButton PB_AUTHREMOVE { + HelpID = "sw:PushButton:TP_TOX_ENTRY:PB_AUTHREMOVE"; Pos = MAP_APPFONT ( 142 , 32 ) ; Size = MAP_APPFONT ( 39, 14 ) ; Text [ en-US ] = "~Remove"; @@ -717,6 +759,7 @@ TabPage TP_TOX_ENTRY }; ListBox LB_CHARSTYLE { + HelpID = "sw:ListBox:TP_TOX_ENTRY:LB_CHARSTYLE"; Pos = MAP_APPFONT ( 100 , 53 ) ; Size = MAP_APPFONT ( 93, 60 ) ; TabStop = TRUE ; @@ -724,6 +767,7 @@ TabPage TP_TOX_ENTRY }; PushButton PB_EDITSTYLE { + HelpID = "sw:PushButton:TP_TOX_ENTRY:PB_EDITSTYLE"; Pos = MAP_APPFONT ( 199 , 52 ) ; Size = MAP_APPFONT ( 50, 14 ) ; Text [ en-US ] = "~Edit..."; @@ -736,6 +780,7 @@ TabPage TP_TOX_ENTRY }; ComboBox CB_FILLCHAR { + HelpID = "sw:ComboBox:TP_TOX_ENTRY:CB_FILLCHAR"; Pos = MAP_APPFONT ( 100 , 69 ) ; Size = MAP_APPFONT ( 40, 40 ) ; TabStop = TRUE ; @@ -749,6 +794,7 @@ TabPage TP_TOX_ENTRY }; ListBox LB_CHAPTERENTRY { + HelpID = "sw:ListBox:TP_TOX_ENTRY:LB_CHAPTERENTRY"; Pos = MAP_APPFONT ( 100 , 69 ) ; Size = MAP_APPFONT ( 93, 40 ) ; TabStop = TRUE ; @@ -769,6 +815,7 @@ TabPage TP_TOX_ENTRY }; ListBox LB_ENTRY_NO { + HelpID = "sw:ListBox:TP_TOX_ENTRY:LB_ENTRY_NO"; Pos = MAP_APPFONT ( 100 , 69 ) ; Size = MAP_APPFONT ( 93, 40 ) ; TabStop = TRUE ; @@ -788,6 +835,7 @@ TabPage TP_TOX_ENTRY }; NumericField NF_LEVEL_OL { + HelpID = "sw:NumericField:TP_TOX_ENTRY:NF_LEVEL_OL"; Pos = MAP_APPFONT ( 100 , 85 ) ; Size = MAP_APPFONT ( 20 , 12 ) ; Border = TRUE ; @@ -809,6 +857,7 @@ TabPage TP_TOX_ENTRY }; MetricField MF_TABPOS { + HelpID = "sw:MetricField:TP_TOX_ENTRY:MF_TABPOS"; Pos = MAP_APPFONT ( 100 , 85 ) ; Size = MAP_APPFONT ( 40, 12 ) ; Border = TRUE ; @@ -827,6 +876,7 @@ TabPage TP_TOX_ENTRY }; CheckBox CB_AUTORIGHT { + HelpID = "sw:CheckBox:TP_TOX_ENTRY:CB_AUTORIGHT"; Pos = MAP_APPFONT ( 143 , 86 ) ; Size = MAP_APPFONT ( 100, 10 ) ; Text [ en-US ] = "Align right"; @@ -839,6 +889,7 @@ TabPage TP_TOX_ENTRY }; CheckBox CB_RELTOSTYLE { + HelpID = "sw:CheckBox:TP_TOX_ENTRY:CB_RELTOSTYLE"; Pos = MAP_APPFONT ( 37 , 110 ) ; Size = MAP_APPFONT ( 200, 10 ) ; Text [ en-US ] = "Tab position relati~ve to Paragraph Style indent"; @@ -851,6 +902,7 @@ TabPage TP_TOX_ENTRY }; ListBox LB_MAIN_ENTRY_STYLE { + HelpID = "sw:ListBox:TP_TOX_ENTRY:LB_MAIN_ENTRY_STYLE"; Pos = MAP_APPFONT ( 157 , 110 ) ; Size = MAP_APPFONT ( 92, 80 ) ; TabStop = TRUE ; @@ -860,12 +912,14 @@ TabPage TP_TOX_ENTRY CheckBox CB_ALPHADELIM { + HelpID = "sw:CheckBox:TP_TOX_ENTRY:CB_ALPHADELIM"; Pos = MAP_APPFONT ( 37 , 126 ) ; Size = MAP_APPFONT ( 105, 10 ) ; Text [ en-US ] = "Alphabetical delimiter"; }; CheckBox CB_COMMASEPARATED { + HelpID = "sw:CheckBox:TP_TOX_ENTRY:CB_COMMASEPARATED"; Pos = MAP_APPFONT ( 37 , 140 ) ; Size = MAP_APPFONT ( 105, 10 ) ; Text [ en-US ] = "Key separated by commas"; @@ -878,12 +932,14 @@ TabPage TP_TOX_ENTRY }; RadioButton RB_DOCPOS { + HelpID = "sw:RadioButton:TP_TOX_ENTRY:RB_DOCPOS"; Pos = MAP_APPFONT ( 40 , 113) ; Size = MAP_APPFONT ( 94, 10 ) ; Text [ en-US ] = "Document ~position "; }; RadioButton RB_SORTCONTENT { + HelpID = "sw:RadioButton:TP_TOX_ENTRY:RB_SORTCONTENT"; Pos = MAP_APPFONT ( 136 , 113 ) ; Size = MAP_APPFONT ( 90, 10 ) ; Text [ en-US ] = "~Content"; @@ -902,6 +958,7 @@ TabPage TP_TOX_ENTRY }; ListBox LB_FIRSTKEY { + HelpID = "sw:ListBox:TP_TOX_ENTRY:LB_FIRSTKEY"; Pos = MAP_APPFONT ( 60 , 138 ) ; Size = MAP_APPFONT ( 159, 50 ) ; Border = TRUE; @@ -919,6 +976,7 @@ TabPage TP_TOX_ENTRY }; ImageRadioButton RB_SORTUP1 { + HelpID = "sw:ImageRadioButton:TP_TOX_ENTRY:RB_SORTUP1"; Pos = MAP_APPFONT ( 222 , 138 ) ; Size = MAP_APPFONT ( 12, 12 ) ; RadioButtonImage = @@ -932,6 +990,7 @@ TabPage TP_TOX_ENTRY }; ImageRadioButton RB_SORTDOWN1 { + HelpID = "sw:ImageRadioButton:TP_TOX_ENTRY:RB_SORTDOWN1"; Pos = MAP_APPFONT ( 237 , 138 ) ; Size = MAP_APPFONT ( 12, 12 ) ; RadioButtonImage = @@ -944,6 +1003,7 @@ TabPage TP_TOX_ENTRY }; ImageRadioButton RB_SORTUP2 { + HelpID = "sw:ImageRadioButton:TP_TOX_ENTRY:RB_SORTUP2"; Pos = MAP_APPFONT ( 222 , 153 ) ; Size = MAP_APPFONT ( 12, 12 ) ; RadioButtonImage = @@ -957,6 +1017,7 @@ TabPage TP_TOX_ENTRY }; ImageRadioButton RB_SORTDOWN2 { + HelpID = "sw:ImageRadioButton:TP_TOX_ENTRY:RB_SORTDOWN2"; Pos = MAP_APPFONT ( 237 , 153 ) ; Size = MAP_APPFONT ( 12, 12 ) ; RadioButtonImage = @@ -969,6 +1030,7 @@ TabPage TP_TOX_ENTRY }; ImageRadioButton RB_SORTUP3 { + HelpID = "sw:ImageRadioButton:TP_TOX_ENTRY:RB_SORTUP3"; Pos = MAP_APPFONT ( 222 , 168 ) ; Size = MAP_APPFONT ( 12, 12 ) ; RadioButtonImage = @@ -982,6 +1044,7 @@ TabPage TP_TOX_ENTRY }; ImageRadioButton RB_SORTDOWN3 { + HelpID = "sw:ImageRadioButton:TP_TOX_ENTRY:RB_SORTDOWN3"; Pos = MAP_APPFONT ( 237 ,168 ) ; Size = MAP_APPFONT ( 12, 12 ) ; RadioButtonImage = @@ -1000,6 +1063,7 @@ TabPage TP_TOX_ENTRY }; ListBox LB_SECONDKEY { + HelpID = "sw:ListBox:TP_TOX_ENTRY:LB_SECONDKEY"; Pos = MAP_APPFONT ( 60 , 153 ) ; Size = MAP_APPFONT ( 159, 50 ) ; Border = TRUE; @@ -1013,6 +1077,7 @@ TabPage TP_TOX_ENTRY }; ListBox LB_THIRDKEY { + HelpID = "sw:ListBox:TP_TOX_ENTRY:LB_THIRDKEY"; Pos = MAP_APPFONT ( 60 , 168 ) ; Size = MAP_APPFONT ( 159, 50 ) ; Border = TRUE; @@ -1052,6 +1117,7 @@ TabPage TP_TOX_STYLES }; ListBox LB_LEVEL { + HelpID = "sw:ListBox:TP_TOX_STYLES:LB_LEVEL"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 25 ) ; Size = MAP_APPFONT ( 102 , 131 ) ; @@ -1067,6 +1133,7 @@ TabPage TP_TOX_STYLES }; ListBox LB_PARALAY { + HelpID = "sw:ListBox:TP_TOX_STYLES:LB_PARALAY"; Border = TRUE ; Pos = MAP_APPFONT ( 142 , 25 ) ; Size = MAP_APPFONT ( 101 , 131 ) ; @@ -1076,6 +1143,7 @@ TabPage TP_TOX_STYLES }; PushButton BT_STD { + HelpID = "sw:PushButton:TP_TOX_STYLES:BT_STD"; Pos = MAP_APPFONT ( 64 , 162 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -1083,6 +1151,7 @@ TabPage TP_TOX_STYLES }; ImageButton BT_ASSIGN { + HelpID = "sw:ImageButton:TP_TOX_STYLES:BT_ASSIGN"; Pos = MAP_APPFONT ( 118 , 28 ) ; Size = MAP_APPFONT ( 20 , 12 ) ; TabStop = TRUE ; @@ -1097,6 +1166,7 @@ TabPage TP_TOX_STYLES }; PushButton BT_EDIT_STYLE { + HelpID = "sw:PushButton:TP_TOX_STYLES:BT_EDIT_STYLE"; Pos = MAP_APPFONT ( 193 , 162 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -1136,6 +1206,7 @@ ModalDialog DLG_ADD_IDX_STYLES }; ImageButton PB_LEFT { + HelpID = "sw:ImageButton:DLG_ADD_IDX_STYLES:PB_LEFT"; Pos = MAP_APPFONT ( 12 , 182 ) ; Size = MAP_APPFONT ( 50 , 12 ) ; TabStop = TRUE ; @@ -1150,6 +1221,7 @@ ModalDialog DLG_ADD_IDX_STYLES }; ImageButton PB_RIGHT { + HelpID = "sw:ImageButton:DLG_ADD_IDX_STYLES:PB_RIGHT"; Pos = MAP_APPFONT ( 65 , 182 ) ; Size = MAP_APPFONT ( 50 , 12 ) ; TabStop = TRUE ; diff --git a/sw/source/ui/index/idxmrk.src b/sw/source/ui/index/idxmrk.src index 6a4ce1934d..e0a1a4df9c 100644 --- a/sw/source/ui/index/idxmrk.src +++ b/sw/source/ui/index/idxmrk.src @@ -275,7 +275,7 @@ ModalDialog DLG_EDIT_IDXMARK Moveable = TRUE ; Closeable = TRUE; Sizeable = FALSE ; - HelpID = FN_EDIT_IDX_ENTRY_DLG; + HelpId = CMD_FN_EDIT_IDX_ENTRY_DLG; SVLook = TRUE ; #define IDX_WIN_WIDTH IDX_WIN_WIDTH_NORMAL Size = MAP_APPFONT ( IDX_WIN_WIDTH , 118 ) ; @@ -294,7 +294,7 @@ ModalDialog DLG_EDIT_IDXMARK_CJK Moveable = TRUE ; Closeable = TRUE; Sizeable = FALSE ; - HelpID = FN_EDIT_IDX_ENTRY_DLG; + HelpId = CMD_FN_EDIT_IDX_ENTRY_DLG; SVLook = TRUE ; #define IDX_WIN_WIDTH IDX_WIN_WIDTH_CJK Size = MAP_APPFONT ( IDX_WIN_WIDTH , 118 ) ; @@ -315,7 +315,7 @@ ModelessDialog DLG_INSIDXMARK Sizeable = FALSE ; Hide = TRUE ; // Zoomable = TRUE ; - HelpID = FN_INSERT_IDX_ENTRY_DLG; + HelpId = CMD_FN_INSERT_IDX_ENTRY_DLG; SVLook = TRUE ; #define IDX_WIN_WIDTH IDX_WIN_WIDTH_NORMAL Size = MAP_APPFONT ( IDX_WIN_WIDTH , 138) ; @@ -336,7 +336,7 @@ ModelessDialog DLG_INSIDXMARK_CJK Closeable = TRUE; Sizeable = FALSE ; // Zoomable = TRUE ; - HelpID = FN_INSERT_IDX_ENTRY_DLG; + HelpId = CMD_FN_INSERT_IDX_ENTRY_DLG; SVLook = TRUE ; #define IDX_WIN_WIDTH IDX_WIN_WIDTH_CJK Size = MAP_APPFONT ( IDX_WIN_WIDTH , 138) ; @@ -392,6 +392,7 @@ ModalDialog DLG_NEW_USER_IDX }; Edit ED_NAME { + HelpID = "sw:Edit:DLG_NEW_USER_IDX:ED_NAME"; Border = TRUE ; Pos = MAP_APPFONT ( 55 , 15 ) ; Size = MAP_APPFONT ( 78 , 12 ) ; @@ -523,7 +524,7 @@ ModalDialog DLG_EDIT_AUTHMARK Moveable = TRUE ; Closeable = TRUE ; Sizeable = FALSE ; - HelpID = FN_EDIT_AUTH_ENTRY_DLG; + HelpId = CMD_FN_EDIT_AUTH_ENTRY_DLG; SVLook = TRUE ; Size = MAP_APPFONT ( 218 , 118 ) ; #define RADIO_BUTTON_HEIGHT 0 @@ -536,7 +537,7 @@ ModelessDialog DLG_INSAUTHMARK Closeable = TRUE ; Sizeable = FALSE ; // Zoomable = TRUE ; - HelpID = FN_INSERT_AUTH_ENTRY_DLG; + HelpId = CMD_FN_INSERT_AUTH_ENTRY_DLG; SVLook = TRUE ; #define RADIO_BUTTON_HEIGHT 30 Size = MAP_APPFONT ( 218 , 118 + RADIO_BUTTON_HEIGHT) ; diff --git a/sw/source/ui/index/multmrk.src b/sw/source/ui/index/multmrk.src index 83db407d1a..d5d11ed530 100644 --- a/sw/source/ui/index/multmrk.src +++ b/sw/source/ui/index/multmrk.src @@ -31,7 +31,7 @@ #include "helpid.h" ModalDialog DLG_MULTMRK { - HelpID = FN_EDIT_IDX_ENTRY_DLG ; + HelpID = CMD_FN_EDIT_IDX_ENTRY_DLG ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 220 , 95 ) ; @@ -65,6 +65,7 @@ ModalDialog DLG_MULTMRK }; ListBox LB_TOX { + HelpID = "sw:ListBox:DLG_MULTMRK:LB_TOX"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 37 ) ; Size = MAP_APPFONT ( 100 , 49 ) ; diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index be034b3909..5253673c72 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -1204,8 +1204,9 @@ public: struct TextInfo { sal_uInt16 nToxField; - sal_uInt16 nHelpId; + const char* pHelpId; }; + static const TextInfo aTextInfoArr[] = { {AUTH_FIELD_IDENTIFIER, HID_AUTH_FIELD_IDENTIFIER }, @@ -1741,7 +1742,7 @@ SwCreateAuthEntryDlg_Impl::SwCreateAuthEntryDlg_Impl(Window* pParent, pTypeListBox->SetPosPixel(bLeft ? aTR1 : aTR2); pTypeListBox->Show(); pTypeListBox->SetSelectHdl(LINK(this, SwCreateAuthEntryDlg_Impl, EnableHdl)); - pTypeListBox->SetHelpId(aCurInfo.nHelpId); + pTypeListBox->SetHelpId(aCurInfo.pHelpId); } else if(AUTH_FIELD_IDENTIFIER == aCurInfo.nToxField && !m_bNewEntryMode) @@ -1769,7 +1770,7 @@ SwCreateAuthEntryDlg_Impl::SwCreateAuthEntryDlg_Impl(Window* pParent, pIdentifierBox->SetSizePixel(aTmp); pIdentifierBox->SetPosPixel(bLeft ? aTR1 : aTR2); pIdentifierBox->Show(); - pIdentifierBox->SetHelpId(aCurInfo.nHelpId); + pIdentifierBox->SetHelpId(aCurInfo.pHelpId); } else { @@ -1780,7 +1781,7 @@ SwCreateAuthEntryDlg_Impl::SwCreateAuthEntryDlg_Impl(Window* pParent, pEdits[nIndex]->SetPosPixel(bLeft ? aTR1 : aTR2); pEdits[nIndex]->SetText(pFields[aCurInfo.nToxField]); pEdits[nIndex]->Show(); - pEdits[nIndex]->SetHelpId(aCurInfo.nHelpId); + pEdits[nIndex]->SetHelpId(aCurInfo.pHelpId); if(AUTH_FIELD_IDENTIFIER == aCurInfo.nToxField) { pEdits[nIndex]->SetModifyHdl(LINK(this, SwCreateAuthEntryDlg_Impl, ShortNameHdl)); diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx index 98eaf8d466..98eaf8d466 100755..100644 --- a/sw/source/ui/lingu/olmenu.cxx +++ b/sw/source/ui/lingu/olmenu.cxx diff --git a/sw/source/ui/misc/bookmark.src b/sw/source/ui/misc/bookmark.src index 9ca4254eb6..39529dd67c 100644 --- a/sw/source/ui/misc/bookmark.src +++ b/sw/source/ui/misc/bookmark.src @@ -31,7 +31,7 @@ #include "helpid.h" ModalDialog DLG_INSERT_BOOKMARK { - HelpID = FN_INSERT_BOOKMARK ; + HelpID = CMD_FN_INSERT_BOOKMARK ; OUTPUTSIZE = TRUE ; Size = MAP_APPFONT ( 179 , 96 ) ; /* ### ACHTUNG: Neuer Text in Resource? Textmarke einfügen : Textmarke einf³gen */ @@ -54,6 +54,7 @@ ModalDialog DLG_INSERT_BOOKMARK }; ComboBox CB_BOOKMARK { + HelpID = "sw:ComboBox:DLG_INSERT_BOOKMARK:CB_BOOKMARK"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 99 , 76 ) ; TABSTOP = TRUE ; @@ -62,6 +63,7 @@ ModalDialog DLG_INSERT_BOOKMARK }; PushButton BT_DELETE { + HelpID = "sw:PushButton:DLG_INSERT_BOOKMARK:BT_DELETE"; Pos = MAP_APPFONT ( 123 , 40 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; /* ### ACHTUNG: Neuer Text in Resource? ~Löschen : ~L÷schen */ diff --git a/sw/source/ui/misc/docfnote.src b/sw/source/ui/misc/docfnote.src index bdb4d55eb2..bc983676d7 100644 --- a/sw/source/ui/misc/docfnote.src +++ b/sw/source/ui/misc/docfnote.src @@ -78,6 +78,7 @@ TabPage TP_FOOTNOTEOPTION }; ListBox LB_NUMVIEW { + HelpID = "sw:ListBox:TP_FOOTNOTEOPTION:LB_NUMVIEW"; Border = TRUE ; Pos = MAP_APPFONT ( 65 , 14 ) ; Size = MAP_APPFONT ( 59 , 72 ) ; @@ -94,6 +95,7 @@ TabPage TP_FOOTNOTEOPTION }; NumericField FLD_OFFSET { + HelpID = "sw:NumericField:TP_FOOTNOTEOPTION:FLD_OFFSET"; Pos = MAP_APPFONT ( 189 , 14 ) ; Size = MAP_APPFONT ( 30 , 12 ) ; Spin = TRUE ; @@ -112,6 +114,7 @@ TabPage TP_FOOTNOTEOPTION }; ListBox LB_NUMCOUNT { + HelpID = "sw:ListBox:TP_FOOTNOTEOPTION:LB_NUMCOUNT"; Border = TRUE ; Pos = MAP_APPFONT ( 65 , 29 ) ; Size = MAP_APPFONT ( 59 , 50 ) ; @@ -135,6 +138,7 @@ TabPage TP_FOOTNOTEOPTION }; Edit ED_PREFIX { + HelpID = "sw:Edit:TP_FOOTNOTEOPTION:ED_PREFIX"; Border = TRUE ; Pos = MAP_APPFONT ( 65 , 44 ) ; Size = MAP_APPFONT ( 59 , 12 ) ; @@ -151,6 +155,7 @@ TabPage TP_FOOTNOTEOPTION }; Edit ED_SUFFIX { + HelpID = "sw:Edit:TP_FOOTNOTEOPTION:ED_SUFFIX"; Border = TRUE ; Pos = MAP_APPFONT ( 189 , 44 ) ; Size = MAP_APPFONT ( 59 , 12 ) ; @@ -166,6 +171,7 @@ TabPage TP_FOOTNOTEOPTION }; RadioButton RB_POS_PAGE { + HelpID = "sw:RadioButton:TP_FOOTNOTEOPTION:RB_POS_PAGE"; Pos = MAP_APPFONT ( 65 , 62 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; Text [ en-US ] = "~End of page" ; @@ -174,6 +180,7 @@ TabPage TP_FOOTNOTEOPTION }; RadioButton RB_POS_CHAPTER { + HelpID = "sw:RadioButton:TP_FOOTNOTEOPTION:RB_POS_CHAPTER"; Pos = MAP_APPFONT ( 65 , 75 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; Text [ en-US ] = "En~d of document" ; @@ -193,6 +200,7 @@ TabPage TP_FOOTNOTEOPTION }; ListBox LB_PARA_TEMPL { + HelpID = "sw:ListBox:TP_FOOTNOTEOPTION:LB_PARA_TEMPL"; Border = TRUE ; Pos = MAP_APPFONT ( 48 , 100 ) ; Size = MAP_APPFONT ( 58 , 80 ) ; @@ -210,6 +218,7 @@ TabPage TP_FOOTNOTEOPTION }; ListBox LB_PAGE_TEMPL { + HelpID = "sw:ListBox:TP_FOOTNOTEOPTION:LB_PAGE_TEMPL"; Border = TRUE ; Pos = MAP_APPFONT ( 48 , 116) ; Size = MAP_APPFONT ( 58 , 80 ) ; @@ -232,6 +241,7 @@ TabPage TP_FOOTNOTEOPTION }; ListBox LB_ANCHR_CHARFMT { + HelpID = "sw:ListBox:TP_FOOTNOTEOPTION:LB_ANCHR_CHARFMT"; Border = TRUE ; Pos = MAP_APPFONT ( 186 , 100 ) ; Size = MAP_APPFONT ( 65 , 72 ) ; @@ -248,6 +258,7 @@ TabPage TP_FOOTNOTEOPTION }; ListBox LB_TEXT_CHARFMT { + HelpID = "sw:ListBox:TP_FOOTNOTEOPTION:LB_TEXT_CHARFMT"; Border = TRUE ; Pos = MAP_APPFONT ( 186 , 116 ) ; Size = MAP_APPFONT ( 65 , 72 ) ; @@ -270,6 +281,7 @@ TabPage TP_FOOTNOTEOPTION }; Edit ED_CONT { + HelpID = "sw:Edit:TP_FOOTNOTEOPTION:ED_CONT"; Border = TRUE ; Pos = MAP_APPFONT ( 88, 145 ) ; Size = MAP_APPFONT ( 160 , 12 ) ; @@ -286,6 +298,7 @@ TabPage TP_FOOTNOTEOPTION }; Edit ED_CONT_FROM { + HelpID = "sw:Edit:TP_FOOTNOTEOPTION:ED_CONT_FROM"; Border = TRUE ; Pos = MAP_APPFONT ( 88 , 161 ) ; Size = MAP_APPFONT ( 160 , 12 ) ; @@ -316,6 +329,7 @@ TabPage TP_ENDNOTEOPTION }; ListBox LB_NUMVIEW { + HelpID = "sw:ListBox:TP_ENDNOTEOPTION:LB_NUMVIEW"; Border = TRUE ; Pos = MAP_APPFONT ( 65 , 14 ) ; Size = MAP_APPFONT ( 59 , 72 ) ; @@ -343,6 +357,7 @@ TabPage TP_ENDNOTEOPTION }; NumericField FLD_OFFSET { + HelpID = "sw:NumericField:TP_ENDNOTEOPTION:FLD_OFFSET"; Pos = MAP_APPFONT ( 189 , 14 ) ; Size = MAP_APPFONT ( 30 , 12 ) ; Spin = TRUE ; @@ -361,6 +376,7 @@ TabPage TP_ENDNOTEOPTION }; ListBox LB_NUMCOUNT { + HelpID = "sw:ListBox:TP_ENDNOTEOPTION:LB_NUMCOUNT"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 62 , 72 ) ; @@ -376,6 +392,7 @@ TabPage TP_ENDNOTEOPTION }; Edit ED_PREFIX { + HelpID = "sw:Edit:TP_ENDNOTEOPTION:ED_PREFIX"; Pos = MAP_APPFONT ( 65 , 30 ) ; Size = MAP_APPFONT ( 59 , 12 ) ; Border = TRUE ; @@ -392,6 +409,7 @@ TabPage TP_ENDNOTEOPTION }; Edit ED_SUFFIX { + HelpID = "sw:Edit:TP_ENDNOTEOPTION:ED_SUFFIX"; Pos = MAP_APPFONT ( 189 , 30 ) ; Size = MAP_APPFONT ( 59 , 12 ) ; Border = TRUE ; @@ -407,6 +425,7 @@ TabPage TP_ENDNOTEOPTION }; RadioButton RB_POS_PAGE { + HelpID = "sw:RadioButton:TP_ENDNOTEOPTION:RB_POS_PAGE"; Pos = MAP_APPFONT ( 12 , 104 ) ; Size = MAP_APPFONT ( 60 , 10 ) ; Text [ en-US ] = "End ~of page" ; @@ -415,6 +434,7 @@ TabPage TP_ENDNOTEOPTION }; RadioButton RB_POS_CHAPTER { + HelpID = "sw:RadioButton:TP_ENDNOTEOPTION:RB_POS_CHAPTER"; Pos = MAP_APPFONT ( 12 , 118 ) ; Size = MAP_APPFONT ( 60 , 10 ) ; Text [ en-US ] = "End of ~document" ; @@ -434,6 +454,7 @@ TabPage TP_ENDNOTEOPTION }; ListBox LB_PARA_TEMPL { + HelpID = "sw:ListBox:TP_ENDNOTEOPTION:LB_PARA_TEMPL"; Border = TRUE ; Pos = MAP_APPFONT ( 51 , 56 ) ; Size = MAP_APPFONT ( 67 , 72 ) ; @@ -451,6 +472,7 @@ TabPage TP_ENDNOTEOPTION }; ListBox LB_PAGE_TEMPL { + HelpID = "sw:ListBox:TP_ENDNOTEOPTION:LB_PAGE_TEMPL"; Border = TRUE ; Pos = MAP_APPFONT ( 51 , 72 ) ; Size = MAP_APPFONT ( 67 , 72 ) ; @@ -472,6 +494,7 @@ TabPage TP_ENDNOTEOPTION }; ListBox LB_ANCHR_CHARFMT { + HelpID = "sw:ListBox:TP_ENDNOTEOPTION:LB_ANCHR_CHARFMT"; Border = TRUE ; Pos = MAP_APPFONT ( 186 , 56 ) ; Size = MAP_APPFONT ( 65 , 72 ) ; @@ -488,6 +511,7 @@ TabPage TP_ENDNOTEOPTION }; ListBox LB_TEXT_CHARFMT { + HelpID = "sw:ListBox:TP_ENDNOTEOPTION:LB_TEXT_CHARFMT"; Border = TRUE ; Pos = MAP_APPFONT ( 186 , 72 ) ; Size = MAP_APPFONT ( 65 , 72 ) ; @@ -511,6 +535,7 @@ TabPage TP_ENDNOTEOPTION }; Edit ED_CONT { + HelpID = "sw:Edit:TP_ENDNOTEOPTION:ED_CONT"; Border = TRUE ; Pos = MAP_APPFONT ( 137 , 101 ) ; Size = MAP_APPFONT ( 114 , 12 ) ; @@ -527,6 +552,7 @@ TabPage TP_ENDNOTEOPTION }; Edit ED_CONT_FROM { + HelpID = "sw:Edit:TP_ENDNOTEOPTION:ED_CONT_FROM"; Border = TRUE ; Pos = MAP_APPFONT ( 137 , 116 ) ; Size = MAP_APPFONT ( 114 , 12 ) ; diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index 5374ddd2e2..ddb966aad2 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -107,7 +107,7 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent, aGroupTLB.SetHelpId(HID_GLOS_GROUP_TREE); aGroupTLB.SetTabs( &nTabs[0], MAP_APPFONT ); - aGroupTLB.SetWindowBits(WB_HSCROLL|WB_CLIPCHILDREN|WB_SORT); + aGroupTLB.SetStyle(aGroupTLB.GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN|WB_SORT); aGroupTLB.SetSelectHdl(LINK(this, SwGlossaryGroupDlg, SelectHdl)); aGroupTLB.GetModel()->SetSortMode(SortAscending); aNewPB.SetClickHdl(LINK(this, SwGlossaryGroupDlg, NewHdl)); diff --git a/sw/source/ui/misc/glosbib.src b/sw/source/ui/misc/glosbib.src index 75a03eb85e..9bd9489977 100644 --- a/sw/source/ui/misc/glosbib.src +++ b/sw/source/ui/misc/glosbib.src @@ -38,6 +38,7 @@ ModalDialog DLG_BIB_BASE Text [ en-US ] = "Edit Categories" ; PushButton PB_NEW { + HelpID = "sw:PushButton:DLG_BIB_BASE:PB_NEW"; Disable = TRUE ; Pos = MAP_APPFONT ( 293 , 66 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; @@ -46,6 +47,7 @@ ModalDialog DLG_BIB_BASE }; PushButton PB_DELETE { + HelpID = "sw:PushButton:DLG_BIB_BASE:PB_DELETE"; Pos = MAP_APPFONT ( 293 , 83 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; /* ### ACHTUNG: Neuer Text in Resource? ~Löschen : ~L÷schen */ @@ -55,6 +57,7 @@ ModalDialog DLG_BIB_BASE }; PushButton PB_RENAME { + HelpID = "sw:PushButton:DLG_BIB_BASE:PB_RENAME"; Disable = TRUE ; Pos = MAP_APPFONT ( 293 , 100 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; @@ -88,6 +91,7 @@ ModalDialog DLG_BIB_BASE }; Edit ED_NAME { + HelpID = "sw:Edit:DLG_BIB_BASE:ED_NAME"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 159 , 12 ) ; TabStop = TRUE ; @@ -102,6 +106,7 @@ ModalDialog DLG_BIB_BASE }; ListBox LB_PATH { + HelpID = "sw:ListBox:DLG_BIB_BASE:LB_PATH"; Pos = MAP_APPFONT ( 174 , 14 ) ; Size = MAP_APPFONT ( 107 , 50 ) ; DropDown = TRUE ; diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index faec81b639..b5c137a4e5 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -294,7 +294,7 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame, aInsertBtn.Enable(sal_False); aNameED.GrabFocus(); aCategoryBox.SetHelpId(HID_MD_GLOS_CATEGORY); - aCategoryBox.SetWindowBits(WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL|WB_VSCROLL|WB_CLIPCHILDREN|WB_SORT); + aCategoryBox.SetStyle(aCategoryBox.GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL|WB_VSCROLL|WB_CLIPCHILDREN|WB_SORT); aCategoryBox.GetModel()->SetSortMode(SortAscending); aCategoryBox.SetHighlightRange(); // ueber volle Breite selektieren aCategoryBox.SetNodeDefaultImages( ); diff --git a/sw/source/ui/misc/glossary.src b/sw/source/ui/misc/glossary.src index 12d6ab9e81..5ad32faa2f 100644 --- a/sw/source/ui/misc/glossary.src +++ b/sw/source/ui/misc/glossary.src @@ -32,7 +32,7 @@ // #define DLG_GLOSSARY 256 ModalDialog DLG_GLOSSARY { - HelpID = FN_GLOSSARY_DLG ; + HelpID = CMD_FN_GLOSSARY_DLG ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 375 , 164 ) ; @@ -40,6 +40,7 @@ ModalDialog DLG_GLOSSARY Moveable = TRUE ; CheckBox CB_INSERT_TIP { + HelpID = "sw:CheckBox:DLG_GLOSSARY:CB_INSERT_TIP"; Pos = MAP_APPFONT ( 12 , 12 ) ; Size = MAP_APPFONT ( 200 , 12 ) ; TabStop = TRUE ; @@ -54,6 +55,7 @@ ModalDialog DLG_GLOSSARY }; Edit ED_NAME { + HelpID = "sw:Edit:DLG_GLOSSARY:ED_NAME"; Border = TRUE ; Pos = MAP_APPFONT ( 55 , 29 ) ; Size = MAP_APPFONT ( 85 , 12 ) ; @@ -70,6 +72,7 @@ ModalDialog DLG_GLOSSARY }; Edit ED_SHORTNAME { + HelpID = "sw:Edit:DLG_GLOSSARY:ED_SHORTNAME"; Disable = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 203 , 29 ) ; @@ -98,6 +101,7 @@ ModalDialog DLG_GLOSSARY }; CheckBox CB_FILE_REL { + HelpID = "sw:CheckBox:DLG_GLOSSARY:CB_FILE_REL"; Pos = MAP_APPFONT ( 14 , 145 ) ; Size = MAP_APPFONT ( 90 , 12 ) ; TabStop = TRUE ; @@ -105,6 +109,7 @@ ModalDialog DLG_GLOSSARY }; CheckBox CB_NET_REL { + HelpID = "sw:CheckBox:DLG_GLOSSARY:CB_NET_REL"; Pos = MAP_APPFONT ( 109 , 145 ) ; Size = MAP_APPFONT ( 90 , 12 ) ; Text [ en-US ] = "Inte~rnet" ; @@ -122,6 +127,7 @@ ModalDialog DLG_GLOSSARY }; CheckBox CB_SHOW_EXAMPLE { + HelpID = "sw:CheckBox:DLG_GLOSSARY:CB_SHOW_EXAMPLE"; Pos = MAP_APPFONT ( 231 , 145 ) ; Size = MAP_APPFONT ( 82 , 12 ) ; Text [ en-US ] = "Sho~w preview"; @@ -151,6 +157,7 @@ ModalDialog DLG_GLOSSARY }; MenuButton PB_EDIT { + HelpID = "sw:MenuButton:DLG_GLOSSARY:PB_EDIT"; Pos = MAP_APPFONT ( 319 , 60 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "AutoTe~xt" ; @@ -158,6 +165,7 @@ ModalDialog DLG_GLOSSARY }; PushButton PB_BIB { + HelpID = "sw:PushButton:DLG_GLOSSARY:PB_BIB"; Pos = MAP_APPFONT ( 319 , 77 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "C~ategories..." ; @@ -165,6 +173,7 @@ ModalDialog DLG_GLOSSARY }; PushButton PB_PATH { + HelpID = "sw:PushButton:DLG_GLOSSARY:PB_PATH"; Pos = MAP_APPFONT ( 319 , 94 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -308,6 +317,7 @@ ModalDialog DLG_RENAME_GLOS }; Edit ED_ON { + HelpID = "sw:Edit:DLG_RENAME_GLOS:ED_ON"; ReadOnly = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 44 , 12 ) ; @@ -322,6 +332,7 @@ ModalDialog DLG_RENAME_GLOS }; Edit ED_OS { + HelpID = "sw:Edit:DLG_RENAME_GLOS:ED_OS"; ReadOnly = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 200 , 12 ) ; @@ -336,6 +347,7 @@ ModalDialog DLG_RENAME_GLOS }; Edit ED_NN { + HelpID = "sw:Edit:DLG_RENAME_GLOS:ED_NN"; TabStop = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 44 , 27 ) ; @@ -350,6 +362,7 @@ ModalDialog DLG_RENAME_GLOS }; Edit ED_NS { + HelpID = "sw:Edit:DLG_RENAME_GLOS:ED_NS"; TabStop = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 200 , 27 ) ; diff --git a/sw/source/ui/misc/insfnote.src b/sw/source/ui/misc/insfnote.src index fda4b92b0d..c462e01188 100644 --- a/sw/source/ui/misc/insfnote.src +++ b/sw/source/ui/misc/insfnote.src @@ -31,6 +31,7 @@ // #define DLG_INS_FOOTNOTE 257 ModalDialog DLG_INS_FOOTNOTE { + HelpID = "sw:ModalDialog:DLG_INS_FOOTNOTE"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 160 , 100 ) ; @@ -39,6 +40,7 @@ ModalDialog DLG_INS_FOOTNOTE Moveable = TRUE ; Edit ED_NUMBER_CHAR { + HelpID = "sw:Edit:DLG_INS_FOOTNOTE:ED_NUMBER_CHAR"; Disable = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 69 , 27 ) ; @@ -71,6 +73,7 @@ ModalDialog DLG_INS_FOOTNOTE }; ImageButton BT_PREV { + HelpID = "sw:ImageButton:DLG_INS_FOOTNOTE:BT_PREV"; Pos = MAP_APPFONT ( 104 , 82 ) ; Size = MAP_APPFONT ( 24 , 14 ) ; TabStop = TRUE ; @@ -79,6 +82,7 @@ ModalDialog DLG_INS_FOOTNOTE }; ImageButton BT_NEXT { + HelpID = "sw:ImageButton:DLG_INS_FOOTNOTE:BT_NEXT"; Pos = MAP_APPFONT ( 130 , 82 ) ; Size = MAP_APPFONT ( 24 , 14 ) ; TabStop = TRUE ; @@ -87,6 +91,7 @@ ModalDialog DLG_INS_FOOTNOTE }; RadioButton RB_NUMBER_AUTO { + HelpID = "sw:RadioButton:DLG_INS_FOOTNOTE:RB_NUMBER_AUTO"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 79 , 10 ) ; Text [ en-US ] = "~Automatic" ; @@ -96,6 +101,7 @@ ModalDialog DLG_INS_FOOTNOTE }; RadioButton RB_NUMBER_CHAR { + HelpID = "sw:RadioButton:DLG_INS_FOOTNOTE:RB_NUMBER_CHAR"; Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 54 , 10 ) ; Text [ en-US ] = "~Character" ; @@ -108,12 +114,14 @@ ModalDialog DLG_INS_FOOTNOTE }; PushButton BT_NUMBER_CHAR { + HelpID = "sw:PushButton:DLG_INS_FOOTNOTE:BT_NUMBER_CHAR"; Pos = MAP_APPFONT ( 69 , 42 ) ; Size = MAP_APPFONT ( 12 , 12 ) ; Text = "..." ; }; RadioButton RB_TYPE_FTN { + HelpID = "sw:RadioButton:DLG_INS_FOOTNOTE:RB_TYPE_FTN"; Pos = MAP_APPFONT ( 12 , 70 ) ; Size = MAP_APPFONT ( 79 , 10 ) ; TabStop = TRUE ; @@ -123,6 +131,7 @@ ModalDialog DLG_INS_FOOTNOTE }; RadioButton RB_TYPE_ENDNOTE { + HelpID = "sw:RadioButton:DLG_INS_FOOTNOTE:RB_TYPE_ENDNOTE"; Pos = MAP_APPFONT ( 12 , 83 ) ; Size = MAP_APPFONT ( 79 , 10 ) ; Text [ en-US ] = "~Endnote" ; diff --git a/sw/source/ui/misc/linenum.src b/sw/source/ui/misc/linenum.src index 61cee918d7..feb17ca5bb 100644 --- a/sw/source/ui/misc/linenum.src +++ b/sw/source/ui/misc/linenum.src @@ -47,6 +47,7 @@ TabPage TP_LINENUMBERING Size = MAP_APPFONT ( 260 , 185 ) ; CheckBox CB_NUMBERING_ON { + HelpID = "sw:CheckBox:TP_LINENUMBERING:CB_NUMBERING_ON"; Pos = MAP_APPFONT ( 12 , 6 ) ; Size = MAP_APPFONT ( 242 , 8 ) ; TabStop = TRUE ; @@ -60,6 +61,7 @@ TabPage TP_LINENUMBERING }; ListBox LB_CHAR_STYLE { + HelpID = "sw:ListBox:TP_LINENUMBERING:LB_CHAR_STYLE"; Pos = MAP_APPFONT ( 100 , 30 ) ; Size = MAP_APPFONT ( 148 , 80 ) ; TabStop = TRUE ; @@ -74,6 +76,7 @@ TabPage TP_LINENUMBERING }; ListBox LB_FORMAT { + HelpID = "sw:ListBox:TP_LINENUMBERING:LB_FORMAT"; Pos = MAP_APPFONT ( 100 , 44 ) ; Size = MAP_APPFONT ( 148 , 80 ) ; TabStop = TRUE ; @@ -87,6 +90,7 @@ TabPage TP_LINENUMBERING }; ListBox LB_POS { + HelpID = "sw:ListBox:TP_LINENUMBERING:LB_POS"; Pos = MAP_APPFONT ( 100 , 60 ) ; Size = MAP_APPFONT ( 148 , 60 ) ; TabStop = TRUE ; @@ -107,6 +111,7 @@ TabPage TP_LINENUMBERING }; MetricField MF_OFFSET { + HelpID = "sw:MetricField:TP_LINENUMBERING:MF_OFFSET"; Pos = MAP_APPFONT ( 100 , 76 ) ; Size = MAP_APPFONT ( 45 , 12 ) ; Border = TRUE ; @@ -130,6 +135,7 @@ TabPage TP_LINENUMBERING }; NumericField NF_NUM_INVERVAL { + HelpID = "sw:NumericField:TP_LINENUMBERING:NF_NUM_INVERVAL"; Pos = MAP_APPFONT ( 100 , 92 ) ; Size = MAP_APPFONT ( 30 , 12 ) ; Border = TRUE ; @@ -163,6 +169,7 @@ TabPage TP_LINENUMBERING }; Edit ED_DIVISOR { + HelpID = "sw:Edit:TP_LINENUMBERING:ED_DIVISOR"; Pos = MAP_APPFONT ( 45 , 121 ) ; Size = MAP_APPFONT ( 76 , 12 ) ; Left = TRUE ; @@ -177,6 +184,7 @@ TabPage TP_LINENUMBERING }; NumericField NF_DIV_INTERVAL { + HelpID = "sw:NumericField:TP_LINENUMBERING:NF_DIV_INTERVAL"; Pos = MAP_APPFONT ( 45 , 137 ) ; Size = MAP_APPFONT ( 30 , 12 ) ; Border = TRUE ; @@ -205,6 +213,7 @@ TabPage TP_LINENUMBERING }; CheckBox CB_COUNT_EMPTYLINES { + HelpID = "sw:CheckBox:TP_LINENUMBERING:CB_COUNT_EMPTYLINES"; Pos = MAP_APPFONT ( 139 , 121 ) ; Size = MAP_APPFONT ( 110 , 10 ) ; TabStop = TRUE ; @@ -212,6 +221,7 @@ TabPage TP_LINENUMBERING }; CheckBox CB_COUNT_FRAMELINES { + HelpID = "sw:CheckBox:TP_LINENUMBERING:CB_COUNT_FRAMELINES"; Pos = MAP_APPFONT ( 139 , 135 ) ; Size = MAP_APPFONT ( 110 , 10 ) ; TabStop = TRUE ; @@ -219,6 +229,7 @@ TabPage TP_LINENUMBERING }; CheckBox CB_RESTART_PAGE { + HelpID = "sw:CheckBox:TP_LINENUMBERING:CB_RESTART_PAGE"; Pos = MAP_APPFONT ( 139 , 149 ); Size = MAP_APPFONT ( 110 , 10 ); TabStop = TRUE; diff --git a/sw/source/ui/misc/num.src b/sw/source/ui/misc/num.src index 0fbc45eb1c..9bf1cf54f9 100644 --- a/sw/source/ui/misc/num.src +++ b/sw/source/ui/misc/num.src @@ -53,6 +53,7 @@ TabPage TP_NUM_POSITION }; MultiListBox LB_LEVEL { + HelpID = "sw:MultiListBox:TP_NUM_POSITION:LB_LEVEL"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 26 , 163 ) ; TabStop = TRUE ; @@ -75,6 +76,7 @@ TabPage TP_NUM_POSITION }; MetricField MF_BORDERDIST { + HelpID = "sw:MetricField:TP_NUM_POSITION:MF_BORDERDIST"; Pos = MAP_APPFONT ( 198 , 25 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; Border = TRUE ; @@ -93,6 +95,7 @@ TabPage TP_NUM_POSITION }; CheckBox CB_RELATIVE { + HelpID = "sw:CheckBox:TP_NUM_POSITION:CB_RELATIVE"; Pos = MAP_APPFONT ( 198 , 41 ) ; Size = MAP_APPFONT ( 52 , 10 ) ; Text [ en-US ] = "Relati~ve" ; @@ -105,6 +108,7 @@ TabPage TP_NUM_POSITION }; MetricField MF_INDENT { + HelpID = "sw:MetricField:TP_NUM_POSITION:MF_INDENT"; Pos = MAP_APPFONT ( 198 , 57 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; Border = TRUE ; @@ -129,6 +133,7 @@ TabPage TP_NUM_POSITION }; MetricField MF_NUMDIST { + HelpID = "sw:MetricField:TP_NUM_POSITION:MF_NUMDIST"; Pos = MAP_APPFONT ( 198 , 73 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; Left = TRUE ; @@ -153,6 +158,7 @@ TabPage TP_NUM_POSITION }; ListBox LB_ALIGN { + HelpID = "sw:ListBox:TP_NUM_POSITION:LB_ALIGN"; Pos = MAP_APPFONT ( 198 , 89 ) ; Size = MAP_APPFONT ( 40 , 40 ) ; TabStop = TRUE ; @@ -172,6 +178,7 @@ TabPage TP_NUM_POSITION }; ListBox LB_LABEL_FOLLOWED_BY { + HelpID = "sw:ListBox:TP_NUM_POSITION:LB_LABEL_FOLLOWED_BY"; Pos = MAP_APPFONT ( 198 , 25 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; TabStop = TRUE ; @@ -192,6 +199,7 @@ TabPage TP_NUM_POSITION }; MetricField MF_LISTTAB { + HelpID = "sw:MetricField:TP_NUM_POSITION:MF_LISTTAB"; Pos = MAP_APPFONT ( 198 , 41 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; Border = TRUE ; @@ -215,6 +223,7 @@ TabPage TP_NUM_POSITION }; ListBox LB_ALIGN_2 { + HelpID = "sw:ListBox:TP_NUM_POSITION:LB_ALIGN_2"; Pos = MAP_APPFONT ( 198 , 57 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; TabStop = TRUE ; @@ -228,6 +237,7 @@ TabPage TP_NUM_POSITION }; MetricField MF_ALIGNED_AT { + HelpID = "sw:MetricField:TP_NUM_POSITION:MF_ALIGNED_AT"; Pos = MAP_APPFONT ( 198 , 73 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; Left = TRUE ; @@ -252,6 +262,7 @@ TabPage TP_NUM_POSITION }; MetricField MF_INDENT_AT { + HelpID = "sw:MetricField:TP_NUM_POSITION:MF_INDENT_AT"; Pos = MAP_APPFONT ( 198 , 89 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; Left = TRUE ; @@ -270,6 +281,7 @@ TabPage TP_NUM_POSITION }; PushButton PB_STANDARD { + HelpID = "sw:PushButton:TP_NUM_POSITION:PB_STANDARD"; Pos = MAP_APPFONT ( 198 , 165 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "Default" ; diff --git a/sw/source/ui/misc/outline.src b/sw/source/ui/misc/outline.src index 64dd97494a..f54025127d 100644 --- a/sw/source/ui/misc/outline.src +++ b/sw/source/ui/misc/outline.src @@ -65,6 +65,7 @@ ModalDialog DLG_NUM_NAMES }; ListBox LB_FORM { + HelpID = "sw:ListBox:DLG_NUM_NAMES:LB_FORM"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 29 ) ; Size = MAP_APPFONT ( 84 , 42 ) ; @@ -85,6 +86,7 @@ ModalDialog DLG_NUM_NAMES }; Edit ED_FORM { + HelpID = "sw:Edit:DLG_NUM_NAMES:ED_FORM"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 84 , 12 ) ; @@ -211,6 +213,7 @@ TabPage TP_OUTLINE_NUM Hide = TRUE; ListBox LB_LEVEL { + HelpID = "sw:ListBox:TP_OUTLINE_NUM:LB_LEVEL"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 23 , 129 ) ; TabStop = TRUE ; @@ -233,6 +236,7 @@ TabPage TP_OUTLINE_NUM }; ListBox LB_COLL { + HelpID = "sw:ListBox:TP_OUTLINE_NUM:LB_COLL"; Border = TRUE ; Pos = MAP_APPFONT ( 50 , 25 ) ; Size = MAP_APPFONT ( 120 , 75 ) ; @@ -251,6 +255,7 @@ TabPage TP_OUTLINE_NUM }; ListBox LB_NUMBER { + HelpID = "sw:ListBox:TP_OUTLINE_NUM:LB_NUMBER"; Pos = MAP_APPFONT ( 104 , 41 ) ; Size = MAP_APPFONT ( 66 , 65 ) ; TabStop = TRUE ; @@ -266,6 +271,7 @@ TabPage TP_OUTLINE_NUM }; ListBox LB_CHARFMT { + HelpID = "sw:ListBox:TP_OUTLINE_NUM:LB_CHARFMT"; TabStop = TRUE ; DropDown = TRUE ; Pos = MAP_APPFONT ( 104 , 57 ) ; @@ -279,6 +285,7 @@ TabPage TP_OUTLINE_NUM }; NumericField NF_ALL_LEVEL { + HelpID = "sw:NumericField:TP_OUTLINE_NUM:NF_ALL_LEVEL"; Border = TRUE ; Pos = MAP_APPFONT ( 104 , 73 ) ; Size = MAP_APPFONT ( 66 , 12 ) ; @@ -308,6 +315,7 @@ TabPage TP_OUTLINE_NUM }; Edit ED_PREFIX { + HelpID = "sw:Edit:TP_OUTLINE_NUM:ED_PREFIX"; Border = TRUE ; Pos = MAP_APPFONT ( 104 , 100 ) ; Size = MAP_APPFONT ( 66 , 12 ) ; @@ -324,6 +332,7 @@ TabPage TP_OUTLINE_NUM }; Edit ED_SUFFIX { + HelpID = "sw:Edit:TP_OUTLINE_NUM:ED_SUFFIX"; Border = TRUE ; Pos = MAP_APPFONT ( 104 , 115 ) ; Size = MAP_APPFONT ( 66 , 12 ) ; @@ -340,6 +349,7 @@ TabPage TP_OUTLINE_NUM }; NumericField ED_START { + HelpID = "sw:NumericField:TP_OUTLINE_NUM:ED_START"; Border = TRUE ; Pos = MAP_APPFONT ( 104 , 131 ) ; Size = MAP_APPFONT ( 66 , 12 ) ; diff --git a/sw/source/ui/misc/pgfnote.src b/sw/source/ui/misc/pgfnote.src index 18acc28267..eebc13ca5d 100644 --- a/sw/source/ui/misc/pgfnote.src +++ b/sw/source/ui/misc/pgfnote.src @@ -35,6 +35,7 @@ TabPage TP_FOOTNOTE_PAGE Hide = TRUE; RadioButton RB_MAXHEIGHT_PAGE { + HelpID = "sw:RadioButton:TP_FOOTNOTE_PAGE:RB_MAXHEIGHT_PAGE"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 132 , 10 ) ; Text [ en-US ] = "~Not larger than page area" ; @@ -43,12 +44,14 @@ TabPage TP_FOOTNOTE_PAGE }; RadioButton RB_MAXHEIGHT { + HelpID = "sw:RadioButton:TP_FOOTNOTE_PAGE:RB_MAXHEIGHT"; Pos = MAP_APPFONT ( 12 , 28 ) ; Size = MAP_APPFONT ( 132 , 10 ) ; Text [ en-US ] = "Maximum footnote ~height" ; }; MetricField ED_MAXHEIGHT { + HelpID = "sw:MetricField:TP_FOOTNOTE_PAGE:ED_MAXHEIGHT"; Border = TRUE ; Pos = MAP_APPFONT ( 148 , 26 ) ; Size = MAP_APPFONT ( 42 , 12 ) ; @@ -75,6 +78,7 @@ TabPage TP_FOOTNOTE_PAGE }; MetricField ED_DIST { + HelpID = "sw:MetricField:TP_FOOTNOTE_PAGE:ED_DIST"; Border = TRUE ; Pos = MAP_APPFONT ( 148 , 42 ) ; Size = MAP_APPFONT ( 42 , 12 ) ; @@ -105,6 +109,7 @@ TabPage TP_FOOTNOTE_PAGE }; ListBox DLB_LINEPOS { + HelpID = "sw:ListBox:TP_FOOTNOTE_PAGE:DLB_LINEPOS"; Pos = MAP_APPFONT ( 148 , 71 ) ; Size = MAP_APPFONT ( 57 , 40 ) ; TabStop = TRUE ; @@ -128,6 +133,7 @@ TabPage TP_FOOTNOTE_PAGE }; ListBox DLB_LINETYPE { + HelpID = "sw:ListBox:TP_FOOTNOTE_PAGE:DLB_LINETYPE"; Pos = MAP_APPFONT ( 148 , 87 ) ; Size = MAP_APPFONT ( 57 , 50 ) ; TabStop = TRUE ; @@ -145,6 +151,7 @@ TabPage TP_FOOTNOTE_PAGE }; MetricField ED_LINEWIDTH { + HelpID = "sw:MetricField:TP_FOOTNOTE_PAGE:ED_LINEWIDTH"; Border = TRUE ; Pos = MAP_APPFONT ( 148 , 103 ) ; Size = MAP_APPFONT ( 42 , 12 ) ; @@ -168,6 +175,7 @@ TabPage TP_FOOTNOTE_PAGE }; MetricField ED_LINEDIST { + HelpID = "sw:MetricField:TP_FOOTNOTE_PAGE:ED_LINEDIST"; Border = TRUE ; Pos = MAP_APPFONT ( 148 , 119 ) ; Size = MAP_APPFONT ( 42 , 12 ) ; diff --git a/sw/source/ui/misc/pggrid.src b/sw/source/ui/misc/pggrid.src index 76bd70201d..a39ca828f9 100644 --- a/sw/source/ui/misc/pggrid.src +++ b/sw/source/ui/misc/pggrid.src @@ -41,24 +41,28 @@ TabPage TP_TEXTGRID_PAGE }; RadioButton RB_NOGRID { + HelpID = "sw:RadioButton:TP_TEXTGRID_PAGE:RB_NOGRID"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; Text [ en-US ] = "No grid" ; }; RadioButton RB_LINESGRID { + HelpID = "sw:RadioButton:TP_TEXTGRID_PAGE:RB_LINESGRID"; Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; Text [ en-US ] = "Grid (lines only)" ; }; RadioButton RB_CHARSGRID { + HelpID = "sw:RadioButton:TP_TEXTGRID_PAGE:RB_CHARSGRID"; Pos = MAP_APPFONT ( 12 , 40 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; Text [ en-US ] = "Grid (lines and characters)" ; }; CheckBox CB_SNAPTOCHARS { + HelpID = "sw:CheckBox:TP_TEXTGRID_PAGE:CB_SNAPTOCHARS"; Pos = MAP_APPFONT ( 14 , 53 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; Text [ en-US ] = "~Snap to characters" ; @@ -83,6 +87,7 @@ TabPage TP_TEXTGRID_PAGE }; NumericField NF_LINESPERPAGE { + HelpID = "sw:NumericField:TP_TEXTGRID_PAGE:NF_LINESPERPAGE"; Pos = MAP_APPFONT ( 74 , 80 ) ; Size = MAP_APPFONT ( 25 , 12 ) ; Border = TRUE ; @@ -105,6 +110,7 @@ TabPage TP_TEXTGRID_PAGE }; MetricField MF_TEXTSIZE { + HelpID = "sw:MetricField:TP_TEXTGRID_PAGE:MF_TEXTSIZE"; Pos = MAP_APPFONT ( 216 , 80 ) ; Size = MAP_APPFONT ( 35 , 12 ) ; Border = TRUE ; @@ -128,6 +134,7 @@ TabPage TP_TEXTGRID_PAGE }; NumericField NF_CHARSPERLINE { + HelpID = "sw:NumericField:TP_TEXTGRID_PAGE:NF_CHARSPERLINE"; Pos = MAP_APPFONT ( 74 , 96 ) ; Size = MAP_APPFONT ( 25 , 12 ) ; Border = TRUE ; @@ -151,6 +158,7 @@ TabPage TP_TEXTGRID_PAGE }; MetricField MF_CHARWIDTH { + HelpID = "sw:MetricField:TP_TEXTGRID_PAGE:MF_CHARWIDTH"; Pos = MAP_APPFONT ( 216 , 96 ) ; Size = MAP_APPFONT ( 35 , 12 ) ; Border = TRUE ; @@ -174,6 +182,7 @@ TabPage TP_TEXTGRID_PAGE }; MetricField MF_RUBYSIZE { + HelpID = "sw:MetricField:TP_TEXTGRID_PAGE:MF_RUBYSIZE"; Pos = MAP_APPFONT ( 216 , 96 ) ; Size = MAP_APPFONT ( 35 , 12 ) ; Border = TRUE ; @@ -191,6 +200,7 @@ TabPage TP_TEXTGRID_PAGE }; CheckBox CB_RUBYBELOW { + HelpID = "sw:CheckBox:TP_TEXTGRID_PAGE:CB_RUBYBELOW"; Pos = MAP_APPFONT ( 14 , 112 ) ; Size = MAP_APPFONT ( 237 , 10 ) ; Text [ en-US ] = "Ruby text below/left from base text" ; @@ -203,12 +213,14 @@ TabPage TP_TEXTGRID_PAGE }; CheckBox CB_DISPLAY { + HelpID = "sw:CheckBox:TP_TEXTGRID_PAGE:CB_DISPLAY"; Pos = MAP_APPFONT ( 12 , 139 ) ; Size = MAP_APPFONT ( 118 , 10 ) ; Text [ en-US ] = "Display grid" ; }; CheckBox CB_PRINT { + HelpID = "sw:CheckBox:TP_TEXTGRID_PAGE:CB_PRINT"; Pos = MAP_APPFONT ( 18 , 154 ) ; Size = MAP_APPFONT ( 112 , 10 ) ; Text [ en-US ] = "Print grid" ; @@ -221,6 +233,7 @@ TabPage TP_TEXTGRID_PAGE }; ListBox LB_COLOR { + HelpID = "sw:ListBox:TP_TEXTGRID_PAGE:LB_COLOR"; Pos = MAP_APPFONT ( 191 , 137 ) ; Size = MAP_APPFONT ( 60 , 50 ) ; TabStop = TRUE; diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx index e2b7e6a151..2947edfcee 100644 --- a/sw/source/ui/misc/redlndlg.cxx +++ b/sw/source/ui/misc/redlndlg.cxx @@ -273,7 +273,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(Dialog *pParent, BOOL bAutoFmt) : pActLB->SelectEntryPos(0); - pTable->SetWindowBits(WB_HASLINES|WB_CLIPCHILDREN|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); + pTable->SetStyle(pTable->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); pTable->SetNodeDefaultImages(); pTable->SetSelectionMode(MULTIPLE_SELECTION); pTable->SetHighlightRange(1); diff --git a/sw/source/ui/misc/srtdlg.src b/sw/source/ui/misc/srtdlg.src index 8a1eb3a3ee..ddacdac459 100644 --- a/sw/source/ui/misc/srtdlg.src +++ b/sw/source/ui/misc/srtdlg.src @@ -32,7 +32,7 @@ ModalDialog DLG_SORTING { - HelpID = FN_SORTING_DLG ; + HelpID = CMD_FN_SORTING_DLG ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 268 , 193 ) ; @@ -80,6 +80,7 @@ ModalDialog DLG_SORTING }; CheckBox CB_KEY1 { + HelpID = "sw:CheckBox:DLG_SORTING:CB_KEY1"; Pos = MAP_APPFONT ( 12 , 25 ) ; Size = MAP_APPFONT ( 49 , 8 ) ; /* ### ACHTUNG: Neuer Text in Resource? Schlüssel ~1 : Schl³ssel ~1 */ @@ -88,6 +89,7 @@ ModalDialog DLG_SORTING }; NumericField ED_KEY1 { + HelpID = "sw:NumericField:DLG_SORTING:ED_KEY1"; Border = TRUE ; Pos = MAP_APPFONT ( 66 , 23 ) ; Size = MAP_APPFONT ( 25 , 12 ) ; @@ -109,6 +111,7 @@ ModalDialog DLG_SORTING }; ListBox DLB_KEY1 { + HelpID = "sw:ListBox:DLG_SORTING:DLB_KEY1"; Pos = MAP_APPFONT ( 96 , 23 ) ; Size = MAP_APPFONT ( 55 , 45 ) ; TabStop = TRUE ; @@ -118,6 +121,7 @@ ModalDialog DLG_SORTING }; RadioButton RB_UP { + HelpID = "sw:RadioButton:DLG_SORTING:RB_UP"; Pos = MAP_APPFONT ( 155 , 23 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Text [ en-US ] = "~Ascending" ; @@ -126,6 +130,7 @@ ModalDialog DLG_SORTING }; RadioButton RB_DN { + HelpID = "sw:RadioButton:DLG_SORTING:RB_DN"; Pos = MAP_APPFONT ( 155 , 35 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Text [ en-US ] = "~Descending" ; @@ -133,6 +138,7 @@ ModalDialog DLG_SORTING }; CheckBox CB_KEY2 { + HelpID = "sw:CheckBox:DLG_SORTING:CB_KEY2"; Pos = MAP_APPFONT ( 12 , 52 ) ; Size = MAP_APPFONT ( 49 , 8 ) ; /* ### ACHTUNG: Neuer Text in Resource? Schlüssel ~2 : Schl³ssel ~2 */ @@ -140,6 +146,7 @@ ModalDialog DLG_SORTING }; NumericField ED_KEY2 { + HelpID = "sw:NumericField:DLG_SORTING:ED_KEY2"; Border = TRUE ; Pos = MAP_APPFONT ( 66 , 50 ) ; Size = MAP_APPFONT ( 25 , 12 ) ; @@ -156,6 +163,7 @@ ModalDialog DLG_SORTING }; ListBox DLB_KEY2 { + HelpID = "sw:ListBox:DLG_SORTING:DLB_KEY2"; Pos = MAP_APPFONT ( 96 , 50 ) ; Size = MAP_APPFONT ( 55 , 45 ) ; TabStop = TRUE ; @@ -165,6 +173,7 @@ ModalDialog DLG_SORTING }; RadioButton RB_UP2 { + HelpID = "sw:RadioButton:DLG_SORTING:RB_UP2"; Pos = MAP_APPFONT ( 155 , 50 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Text [ en-US ] = "Ascending" ; @@ -173,6 +182,7 @@ ModalDialog DLG_SORTING }; RadioButton RB_DN2 { + HelpID = "sw:RadioButton:DLG_SORTING:RB_DN2"; Pos = MAP_APPFONT ( 155 , 62 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Text [ en-US ] = "Descending" ; @@ -180,6 +190,7 @@ ModalDialog DLG_SORTING }; CheckBox CB_KEY3 { + HelpID = "sw:CheckBox:DLG_SORTING:CB_KEY3"; Pos = MAP_APPFONT ( 12 , 81 ) ; Size = MAP_APPFONT ( 49 , 8 ) ; /* ### ACHTUNG: Neuer Text in Resource? Schlüssel ~3 : Schl³ssel ~3 */ @@ -187,6 +198,7 @@ ModalDialog DLG_SORTING }; NumericField ED_KEY3 { + HelpID = "sw:NumericField:DLG_SORTING:ED_KEY3"; Border = TRUE ; Pos = MAP_APPFONT ( 66 , 79 ) ; Size = MAP_APPFONT ( 25 , 12 ) ; @@ -203,6 +215,7 @@ ModalDialog DLG_SORTING }; ListBox DLB_KEY3 { + HelpID = "sw:ListBox:DLG_SORTING:DLB_KEY3"; Pos = MAP_APPFONT ( 96 , 79 ) ; Size = MAP_APPFONT ( 55 , 45 ) ; TabStop = TRUE ; @@ -212,6 +225,7 @@ ModalDialog DLG_SORTING }; RadioButton RB_UP3 { + HelpID = "sw:RadioButton:DLG_SORTING:RB_UP3"; Pos = MAP_APPFONT ( 155 , 79 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Text [ en-US ] = "Ascending" ; @@ -220,6 +234,7 @@ ModalDialog DLG_SORTING }; RadioButton RB_DN3 { + HelpID = "sw:RadioButton:DLG_SORTING:RB_DN3"; Pos = MAP_APPFONT ( 155 , 91 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Text [ en-US ] = "Descending" ; @@ -233,6 +248,7 @@ ModalDialog DLG_SORTING }; RadioButton RB_COL { + HelpID = "sw:RadioButton:DLG_SORTING:RB_COL"; Pos = MAP_APPFONT ( 12 , 120 ) ; Size = MAP_APPFONT ( 38 , 10 ) ; Text [ en-US ] = "Col~umns" ; @@ -240,6 +256,7 @@ ModalDialog DLG_SORTING }; RadioButton RB_ROW { + HelpID = "sw:RadioButton:DLG_SORTING:RB_ROW"; Pos = MAP_APPFONT ( 12 , 133 ) ; Size = MAP_APPFONT ( 34 , 10 ) ; Text [ en-US ] = "~Rows" ; @@ -254,6 +271,7 @@ ModalDialog DLG_SORTING }; RadioButton RB_TAB { + HelpID = "sw:RadioButton:DLG_SORTING:RB_TAB"; Pos = MAP_APPFONT ( 113 , 120 ) ; Size = MAP_APPFONT ( 44 , 9 ) ; Text [ en-US ] = "~Tabs" ; @@ -262,6 +280,7 @@ ModalDialog DLG_SORTING }; RadioButton RB_TABCH { + HelpID = "sw:RadioButton:DLG_SORTING:RB_TABCH"; Pos = MAP_APPFONT ( 113 , 133 ) ; Size = MAP_APPFONT ( 38 , 10 ) ; Text [ en-US ] = "~Character" ; @@ -269,6 +288,7 @@ ModalDialog DLG_SORTING }; Edit ED_TABCH { + HelpID = "sw:Edit:DLG_SORTING:ED_TABCH"; Border = TRUE ; Pos = MAP_APPFONT ( 180 , 133 ) ; Size = MAP_APPFONT ( 12 , 12 ) ; @@ -291,6 +311,7 @@ ModalDialog DLG_SORTING }; PushButton PB_DELIM { + HelpID = "sw:PushButton:DLG_SORTING:PB_DELIM"; Pos = MAP_APPFONT ( 195 , 133 ) ; Size = MAP_APPFONT ( 12 , 12 ) ; TabStop = TRUE ; @@ -304,6 +325,7 @@ ModalDialog DLG_SORTING }; ListBox LB_LANG { + HelpID = "sw:ListBox:DLG_SORTING:LB_LANG"; Pos = MAP_APPFONT ( 12 , 158 ) ; Size = MAP_APPFONT ( 83 , 61 ) ; TabStop = TRUE ; @@ -318,6 +340,7 @@ ModalDialog DLG_SORTING }; CheckBox CB_CASE { + HelpID = "sw:CheckBox:DLG_SORTING:CB_CASE"; Pos = MAP_APPFONT ( 113 , 159 ) ; Size = MAP_APPFONT ( 147 , 10 ) ; TabStop = TRUE ; diff --git a/sw/source/ui/ribbar/inputwin.src b/sw/source/ui/ribbar/inputwin.src index e8f8fa58f5..24ae9a48bc 100644 --- a/sw/source/ui/ribbar/inputwin.src +++ b/sw/source/ui/ribbar/inputwin.src @@ -44,7 +44,7 @@ ToolBox RID_TBX_FORMULA ToolBoxItem { Identifier = FN_FORMULA_CALC ; - HelpID = FN_FORMULA_CALC ; + HelpId = HID_TBX_FORMULA_CALC ; DropDown = TRUE ; Text [ en-US ] = "Formula" ; /* ### ACHTUNG: Neuer Text in Resource? Formel auswählen : Formel auswõhlen */ @@ -52,14 +52,14 @@ ToolBox RID_TBX_FORMULA ToolBoxItem { Identifier = FN_FORMULA_CANCEL ; - HelpID = FN_FORMULA_CANCEL ; + HelpId = HID_TBX_FORMULA_CANCEL ; Text [ en-US ] = "Cancel" ; /* ### ACHTUNG: Neuer Text in Resource? Formel nicht übenehmen : Formel nicht ³benehmen */ }; ToolBoxItem { Identifier = FN_FORMULA_APPLY ; - HelpID = FN_FORMULA_APPLY ; + HelpId = HID_TBX_FORMULA_APPLY ; /* ### ACHTUNG: Neuer Text in Resource? Übernehmen : šbernehmen */ Text [ en-US ] = "Apply" ; /* ### ACHTUNG: Neuer Text in Resource? Formel einfügen : Formel einf³gen */ @@ -287,21 +287,21 @@ String STR_TBL_FORMULA ToolBoxItem\ {\ Identifier = FN_FORMULA_CALC ; \ - HelpID = FN_FORMULA_CALC ; \ + HelpID = HID_TBX_FORMULA_CALC ; \ Text [ en-US ] = "Formula" ; \ /* ### ACHTUNG: Neuer Text in Resource? Formel auswählen : Formel auswõhlen */\ };\ ToolBoxItem\ {\ Identifier = FN_FORMULA_CANCEL ; \ - HelpID = FN_FORMULA_CANCEL ; \ + HelpId = HID_TBX_FORMULA_CANCEL ; \ Text [ en-US ] = "Cancel" ; \ /* ### ACHTUNG: Neuer Text in Resource? Formel nicht übenehmen : Formel nicht ³benehmen */\ };\ ToolBoxItem\ {\ Identifier = FN_FORMULA_APPLY ; \ - HelpID = FN_FORMULA_APPLY ; \ + HelpID = HID_TBX_FORMULA_APPLY ; \ /* ### ACHTUNG: Neuer Text in Resource? Übernehmen : šbernehmen */\ Text [ en-US ] = "Apply" ; \ /* ### ACHTUNG: Neuer Text in Resource? Formel einfügen : Formel einf³gen */\ diff --git a/sw/source/ui/ribbar/makefile.mk b/sw/source/ui/ribbar/makefile.mk index 2405d4b16d..2adb59eec1 100644 --- a/sw/source/ui/ribbar/makefile.mk +++ b/sw/source/ui/ribbar/makefile.mk @@ -42,7 +42,6 @@ SRS1NAME=$(TARGET) SRC1FILES = \ tbxanchr.src \ inputwin.src \ - tblctrl.src \ workctrl.src EXCEPTIONSFILES = \ diff --git a/sw/source/ui/ribbar/tblctrl.src b/sw/source/ui/ribbar/tblctrl.src deleted file mode 100644 index afc5949983..0000000000 --- a/sw/source/ui/ribbar/tblctrl.src +++ /dev/null @@ -1,94 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "tblctrl.hrc" -#include "helpid.h" -#include "cmdid.h" -FloatingWindow RID_TBL_OPT_CTRL -{ - Moveable = TRUE ; - Closeable = TRUE ; - Hide = TRUE ; - SVLook = TRUE ; - HelpID = HID_TBL_OPT_CTRL ; - ToolBox TBX_OPTIMIZE_TABLE - { - MenuStrings = TRUE ; - SVLook = TRUE ; - HelpID = 1 ; - ItemList = - { - ToolBoxItem - { - Identifier = FN_TABLE_BALANCE_CELLS ; - HelpID = FN_TABLE_BALANCE_CELLS ; - }; - ToolBoxItem - { - Identifier = FN_TABLE_BALANCE_ROWS ; - HelpID = FN_TABLE_BALANCE_ROWS ; - }; - ToolBoxItem - { - Identifier = FN_TABLE_OPTIMAL_HEIGHT ; - HelpID = FN_TABLE_OPTIMAL_HEIGHT ; - }; - ToolBoxItem - { - Identifier = FN_TABLE_ADJUST_CELLS ; - HelpID = FN_TABLE_ADJUST_CELLS ; - }; - }; - }; - Text [ en-US ] = "Optimize" ; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx index bb69819b8d..313265e853 100644 --- a/sw/source/ui/ribbar/workctrl.cxx +++ b/sw/source/ui/ribbar/workctrl.cxx @@ -454,7 +454,7 @@ static USHORT __READONLY_DATA aNavigationInsertIds[ NAVI_ENTRIES ] = NID_TABLE_FORMULA_ERROR, NID_NEXT }; -static USHORT __READONLY_DATA aNavigationHelpIds[ NAVI_ENTRIES ] = +static const char* __READONLY_DATA aNavigationHelpIds[ NAVI_ENTRIES ] = { // -- first line HID_NID_TBL, diff --git a/sw/source/ui/ribbar/workctrl.src b/sw/source/ui/ribbar/workctrl.src index c50da95313..3cb93cb585 100644 --- a/sw/source/ui/ribbar/workctrl.src +++ b/sw/source/ui/ribbar/workctrl.src @@ -32,138 +32,9 @@ #include <svx/globlmn.hrc> #endif #include "workctrl.hrc" -#include "workctrl.hrc" #include "helpid.h" #include "cmdid.h" -FloatingWindow RID_INSERT_CTRL -{ - Moveable = TRUE ; - Closeable = TRUE ; - Hide = TRUE ; - SVLook = TRUE ; - HelpID = HID_INSERT_CTRL ; - /* ### ACHTUNG: Neuer Text in Resource? Einfügen : Einf³gen */ - ToolBox TBX_INSERT - { - MenuStrings = TRUE ; - SVLook = TRUE ; - HelpID = 1 ; - ItemList = - { - ToolBoxItem - { - Identifier = FN_INSERT_FRAME_INTERACT_NOCOL ; - HelpID = FN_INSERT_FRAME_INTERACT_NOCOL ; - }; - ToolBoxItem - { - Identifier = FN_INSERT_FRAME_INTERACT ; - HelpID = FN_INSERT_FRAME_INTERACT ; - DropDown = TRUE ; - }; - ToolBoxItem - { - Identifier = SID_INSERT_GRAPHIC ; - HelpID = SID_INSERT_GRAPHIC ; - }; - ToolBoxItem - { - Identifier = FN_INSERT_TABLE ; - HelpID = FN_INSERT_TABLE ; - DropDown = TRUE ; - }; - ToolBoxItem - { - Identifier = SID_INSERTDOC ; - HelpID = SID_INSERTDOC ; - }; - ToolBoxItem - { - Identifier = FN_INSERT_FOOTNOTE ; - HelpID = FN_INSERT_FOOTNOTE ; - }; - ToolBoxItem - { - Identifier = FN_INSERT_ENDNOTE ; - HelpID = FN_INSERT_ENDNOTE ; - }; - ToolBoxItem - { - Identifier = FN_INSERT_SYMBOL ; - HelpID = FN_INSERT_SYMBOL ; - }; - ToolBoxItem - { - Identifier = FN_INSERT_REGION ; - HelpID = FN_INSERT_REGION; - DropDown = TRUE ; - }; - ToolBoxItem - { - Identifier = FN_INSERT_IDX_ENTRY_DLG ; - HelpID = FN_INSERT_IDX_ENTRY_DLG ; - }; - ToolBoxItem - { - Identifier = FN_INSERT_BOOKMARK ; - HelpID = FN_INSERT_BOOKMARK ; - RadioCheck = TRUE ; - }; - }; - }; - Text [ en-US ] = "Insert" ; -}; -FloatingWindow RID_INSERT_OBJ_CTRL -{ - Moveable = TRUE ; - Closeable = TRUE ; - Hide = TRUE ; - SVLook = TRUE ; - HelpID = HID_INSERT_OBJ_CTRL ; - /* ### ACHTUNG: Neuer Text in Resource? Objekt einfügen : Objekt einf³gen */ - ToolBox TBX_OBJ_INSERT - { - MenuStrings = TRUE ; - SVLook = TRUE ; - HelpID = 1 ; - ItemList = - { - ToolBoxItem - { - Identifier = SID_INSERT_DIAGRAM ; - HelpID = SID_INSERT_DIAGRAM ; - }; - ToolBoxItem - { - Identifier = FN_INSERT_SMA ; - HelpID = FN_INSERT_SMA ; - }; - ToolBoxItem - { - Identifier = SID_INSERT_FLOATINGFRAME ; - HelpID = SID_INSERT_FLOATINGFRAME ; - }; - ToolBoxItem - { - Identifier = SID_INSERT_OBJECT ; - HelpID = SID_INSERT_OBJECT ; - }; - ToolBoxItem - { - Identifier = SID_INSERT_PLUGIN ; - HelpID = SID_INSERT_PLUGIN ; - }; -#ifdef SOLAR_JAVA - ToolBoxItem - { - Identifier = SID_INSERT_APPLET ; - HelpID = SID_INSERT_APPLET ; - }; -#endif - }; - }; - Text [ en-US ] = "Insert Object" ; -}; + Menu RID_INSERT_FIELD_CTRL { ItemList = @@ -171,45 +42,45 @@ Menu RID_INSERT_FIELD_CTRL MenuItem { Identifier = FN_INSERT_FLD_DATE ; - HelpID = FN_INSERT_FLD_DATE ; + HelpId = CMD_FN_INSERT_FLD_DATE ; Text [ en-US ] = "Date" ; }; MenuItem { Identifier = FN_INSERT_FLD_TIME ; - HelpID = FN_INSERT_FLD_TIME ; + HelpId = CMD_FN_INSERT_FLD_TIME ; Text [ en-US ] = "Time" ; }; //#ifndef MN_SW_WEB MenuItem { Identifier = FN_INSERT_FLD_PGNUMBER ; - HelpID = FN_INSERT_FLD_PGNUMBER ; + HelpId = CMD_FN_INSERT_FLD_PGNUMBER ; Text [ en-US ] = "Page Number" ; }; MenuItem { Identifier = FN_INSERT_FLD_PGCOUNT ; - HelpID = FN_INSERT_FLD_PGCOUNT ; + HelpId = CMD_FN_INSERT_FLD_PGCOUNT ; Text [ en-US ] = "Page Count" ; }; MenuItem { Identifier = FN_INSERT_FLD_TOPIC ; - HelpID = FN_INSERT_FLD_TOPIC ; + HelpId = CMD_FN_INSERT_FLD_TOPIC ; Text [ en-US ] = "Subject" ; }; MenuItem { Identifier = FN_INSERT_FLD_TITLE ; - HelpID = FN_INSERT_FLD_TITLE ; + HelpId = CMD_FN_INSERT_FLD_TITLE ; Text [ en-US ] = "Title" ; }; //#endif MenuItem { Identifier = FN_INSERT_FLD_AUTHOR ; - HelpID = FN_INSERT_FLD_AUTHOR ; + HelpId = CMD_FN_INSERT_FLD_AUTHOR ; Text [ en-US ] = "Author" ; }; MenuItem @@ -219,7 +90,7 @@ Menu RID_INSERT_FIELD_CTRL MenuItem { Identifier = FN_INSERT_FIELD ; - HelpID = FN_INSERT_FIELD ; + HelpId = CMD_FN_INSERT_FIELD ; Text [ en-US ] = "Other..." ; }; }; diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx index 3486fd06a8..bd465c6dd1 100755 --- a/sw/source/ui/shells/annotsh.cxx +++ b/sw/source/ui/shells/annotsh.cxx @@ -1010,7 +1010,6 @@ void SwAnnotationShell::NoteExec(SfxRequest &rReq) case FN_REPLY: case FN_POSTIT: case FN_DELETE_COMMENT: - case FN_DELETE_NOTE: if ( pPostItMgr->HasActiveSidebarWin() ) pPostItMgr->GetActiveSidebarWin()->ExecuteCommand(nSlot); break; @@ -1058,24 +1057,15 @@ void SwAnnotationShell::GetNoteState(SfxItemSet &rSet) switch( nSlotId ) { case FN_POSTIT: - case FN_DELETE_NOTE: case FN_DELETE_NOTE_AUTHOR: case FN_DELETE_ALL_NOTES: case FN_HIDE_NOTE: case FN_HIDE_NOTE_AUTHOR: case FN_HIDE_ALL_NOTES: - { - if ( !pPostItMgr || - !pPostItMgr->HasActiveAnnotationWin() ) - { - rSet.DisableItem(nWhich); - } - break; - } case FN_DELETE_COMMENT: { if ( !pPostItMgr || - !pPostItMgr->HasActiveSidebarWin() /*HasActiveRedCommentWin()*/ ) + !pPostItMgr->HasActiveAnnotationWin() ) { rSet.DisableItem(nWhich); } @@ -1108,7 +1098,7 @@ void SwAnnotationShell::GetNoteState(SfxItemSet &rSet) if (pPostItMgr->HasActiveSidebarWin()) { if ( (pPostItMgr->GetActiveSidebarWin()->IsProtected()) && - ( (nSlotId==FN_DELETE_NOTE) || (nSlotId==FN_REPLY) ) ) + ( (nSlotId==FN_DELETE_COMMENT) || (nSlotId==FN_REPLY) ) ) rSet.DisableItem( nWhich ); } nWhich = aIter.NextWhich(); diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index 025403cc08..ee845c932b 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -1080,6 +1080,14 @@ void SwBaseShell::Execute(SfxRequest &rReq) rSh.SetFlyFrmAttr(aSet); } + // if new anchor is 'as char' and it is a Math object and the usual + // pre-conditions are met then align the formula to the baseline of the text + const uno::Reference < embed::XEmbeddedObject > xObj( rSh.GetOleRef() ); + const bool bDoMathBaselineAlignment = xObj.is() && SotExchange::IsMath( xObj->getClassID() ) + && FLY_AS_CHAR == eSet && rSh.GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ); + if (bDoMathBaselineAlignment) + rSh.AlignFormulaToBaseline( xObj ); + USHORT nHtmlMode = ::GetHtmlMode(GetView().GetDocShell()); if( nHtmlMode ) { diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx index b2dfee2fa4..66043b2eb5 100644 --- a/sw/source/ui/shells/frmsh.cxx +++ b/sw/source/ui/shells/frmsh.cxx @@ -52,7 +52,7 @@ #include <vcl/msgbox.hxx> // <-- - +#include <doc.hxx> #include <fmturl.hxx> #include <fmtclds.hxx> #include <fmtcnct.hxx> @@ -78,6 +78,7 @@ #include <helpid.h> #include <cmdid.h> +#include <cfgitems.hxx> #include <globals.hrc> #include <popup.hrc> #include <shells.hrc> @@ -408,14 +409,13 @@ void SwFrameShell::Execute(SfxRequest &rReq) SID_HTML_MODE, SID_HTML_MODE, FN_SET_FRM_ALT_NAME, FN_SET_FRM_ALT_NAME, FN_PARAM_CHAIN_PREVIOUS, FN_PARAM_CHAIN_NEXT, + FN_OLE_IS_MATH, FN_OLE_IS_MATH, + FN_MATH_BASELINE_ALIGNMENT, FN_MATH_BASELINE_ALIGNMENT, 0); const SwViewOption* pVOpt = rSh.GetViewOptions(); if(nSel & nsSelectionType::SEL_OLE) - { - aSet.Put(SfxBoolItem(FN_KEEP_ASPECT_RATIO, - pVOpt->IsKeepRatio())); - } + aSet.Put( SfxBoolItem(FN_KEEP_ASPECT_RATIO, pVOpt->IsKeepRatio()) ); aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell()))); aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName())); if( nSel & nsSelectionType::SEL_OLE ) @@ -446,6 +446,12 @@ void SwFrameShell::Execute(SfxRequest &rReq) if (rSize.GetHeightPercent() && rSize.GetHeightPercent() != 0xff) rSize.SetHeight(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Height()); + // disable vertical positioning for Math Objects anchored 'as char' if baseline alignment is activated + aSet.Put( SfxBoolItem( FN_MATH_BASELINE_ALIGNMENT, + rSh.GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) ) ); + const uno::Reference < embed::XEmbeddedObject > xObj( rSh.GetOleRef() ); + aSet.Put( SfxBoolItem( FN_OLE_IS_MATH, xObj.is() && SotExchange::IsMath( xObj->getClassID() ) ) ); + UINT16 nDefPage = 0; if(pArgs && pArgs->GetItemState(FN_FORMAT_FRAME_DLG, FALSE, &pItem) == SFX_ITEM_SET) nDefPage = ((SfxUInt16Item *)pItem)->GetValue(); @@ -1146,3 +1152,4 @@ void SwFrameShell::StateInsert(SfxItemSet &rSet) if ((nSel & nsSelectionType::SEL_GRF) || (nSel & nsSelectionType::SEL_OLE)) rSet.DisableItem(FN_INSERT_FRAME); } + diff --git a/sw/source/ui/shells/shells.src b/sw/source/ui/shells/shells.src index 42b3b0029a..76b4580800 100644 --- a/sw/source/ui/shells/shells.src +++ b/sw/source/ui/shells/shells.src @@ -156,880 +156,46 @@ String RID_TEXT_TOOLBOX Text [ en-US ] = "Text Object Bar" ; Text [ x-comment ] = " "; }; -ToolBox RID_TEXT_TOOLBOX -{ - HelpID = HID_TEXT_TOOLBOX ; - Border = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - HideWhenDeactivate = TRUE ; - LineSpacing = TRUE ; - Customize = TRUE ; - MenuStrings = TRUE ; - Hide = TRUE ; - ItemList = - { - MN_TEMPLATE - MN_FONT - MN_TEXT1(TRUE) - MN_TEXT1_BLOCK - MN_TEXT_LTR_RTL - MN_TEXT_LINESPACE - MN_TEXT2 - MN_TEXT_BACKGROUND - MN_TEXT_DIALOGS(TRUE) - }; - Scroll = TRUE ; -}; String RID_TABLE_TOOLBOX { Text [ en-US ] = "Table Object Bar" ; Text [ x-comment ] = " "; }; -ToolBox RID_TABLE_TOOLBOX -{ - HelpID = HID_TABLE_TOOLBOX ; - Border = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - LineSpacing = TRUE ; - HideWhenDeactivate = TRUE ; - Customize = TRUE ; - MenuStrings = TRUE ; - Hide = TRUE ; - Scroll = TRUE ; - ItemList = - { - MN_TEMPLATE - MN_FONT - ToolBoxItem - { - Identifier = FN_TABLE_AUTOSUM ; - HelpID = FN_TABLE_AUTOSUM ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_TABLE_MODE_FIX ; - HelpID = FN_TABLE_MODE_FIX ; - }; - ToolBoxItem - { - Identifier = FN_TABLE_MODE_FIX_PROP ; - HelpID = FN_TABLE_MODE_FIX_PROP ; - }; - ToolBoxItem - { - Identifier = FN_TABLE_MODE_VARIABLE ; - HelpID = FN_TABLE_MODE_VARIABLE ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_TABLE_MERGE_CELLS ; - HelpID = FN_TABLE_MERGE_CELLS ; - }; - ToolBoxItem - { - Identifier = FN_TABLE_SPLIT_CELLS ; - HelpID = FN_TABLE_SPLIT_CELLS ; - }; - ToolBoxItem - { - DropDown = TRUE ; - Identifier = FN_OPTIMIZE_TABLE ; - HelpID = FN_OPTIMIZE_TABLE ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_TABLE_INSERT_ROW ; - HelpID = FN_TABLE_INSERT_ROW ; - }; - ToolBoxItem - { - Identifier = FN_TABLE_INSERT_COL ; - HelpID = FN_TABLE_INSERT_COL ; - }; - ToolBoxItem - { - Identifier = FN_TABLE_DELETE_ROW ; - HelpID = FN_TABLE_DELETE_ROW ; - }; - ToolBoxItem - { - Identifier = FN_TABLE_DELETE_COL ; - HelpID = FN_TABLE_DELETE_COL ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_TABLE_SELECT_ALL; - HelpID = FN_TABLE_SELECT_ALL; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = FN_TABLE_SELECT_COL; - HelpID = FN_TABLE_SELECT_COL; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = FN_TABLE_SELECT_ROW; - HelpID = FN_TABLE_SELECT_ROW; - Hide = TRUE; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_TABLE_VERT_NONE; - HelpID = FN_TABLE_VERT_NONE; - RadioCheck = TRUE; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = FN_TABLE_VERT_CENTER; - HelpID = FN_TABLE_VERT_CENTER; - RadioCheck = TRUE; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = FN_TABLE_VERT_BOTTOM; - HelpID = FN_TABLE_VERT_BOTTOM; - RadioCheck = TRUE; - Hide = TRUE; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - ITEM_TOOLBAR_ATTR_BORDER - }; - ToolBoxItem - { - ITEM_TOOLBAR_FRAME_LINESTYLE - }; - ToolBoxItem - { - ITEM_TOOLBAR_FRAME_LINECOLOR - Hide = TRUE; - }; - ToolBoxItem - { - ITEM_TOOLBAR_BACKGROUND_COLOR - }; - }; -}; String RID_FRAME_TOOLBOX { Text [ en-US ] = "Frame Object Bar" ; Text [ x-comment ] = " "; }; -ToolBox RID_FRAME_TOOLBOX -{ - HelpID = HID_FRAME_TOOLBOX ; - Border = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - LineSpacing = TRUE ; - MenuStrings = TRUE ; - HideWhenDeactivate = TRUE ; - Customize = TRUE ; - Hide = TRUE ; - ItemList = - { - MN_TEMPLATE - MN_FRAME_WRAP - MN_FRAME1 - MN_FRAME2 - MN_FRAME3 - MN_LINESTYLE - MN_BACKGROUND_COLOR - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - MN_ATTRIBUTES_FRAME - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - MN_LAYER - ToolBoxItem - { - Identifier = FN_TOOL_ANKER ; - HelpID = FN_TOOL_ANKER ; - DropDown = TRUE ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_FRAME_CHAIN ; - HelpID = FN_FRAME_CHAIN ; - }; - ToolBoxItem - { - Identifier = FN_FRAME_UNCHAIN ; - HelpID = FN_FRAME_UNCHAIN ; - }; - }; - Scroll = TRUE ; -}; String RID_GRAFIK_TOOLBOX { Text [ en-US ] = "Graphics Object Bar" ; Text [ x-comment ] = " "; }; -ToolBox RID_GRAFIK_TOOLBOX -{ - HelpID = HID_GRAFIK_TOOLBOX ; - Border = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - LineSpacing = TRUE ; - HideWhenDeactivate = TRUE ; - MenuStrings = TRUE ; - Customize = TRUE ; - Hide = TRUE ; - ItemList = - { - ToolBoxItem - { - Identifier = SID_GRFFILTER; - HelpID = SID_GRFFILTER; - DropDown = TRUE ; - }; - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - ToolBoxItem - { - Identifier = SID_ATTR_GRAF_MODE; - HelpID = SID_ATTR_GRAF_MODE; - }; - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - - ToolBoxItem - { - Identifier = SID_ATTR_GRAF_RED; - HelpID = SID_ATTR_GRAF_RED; - }; - ToolBoxItem - { - Identifier = SID_ATTR_GRAF_GREEN; - HelpID = SID_ATTR_GRAF_GREEN; - }; - ToolBoxItem - { - Identifier = SID_ATTR_GRAF_BLUE; - HelpID = SID_ATTR_GRAF_BLUE; - }; - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - - ToolBoxItem - { - Identifier = SID_ATTR_GRAF_LUMINANCE; - HelpID = SID_ATTR_GRAF_LUMINANCE; - }; - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - - ToolBoxItem - { - Identifier = SID_ATTR_GRAF_CONTRAST; - HelpID = SID_ATTR_GRAF_CONTRAST; - }; - ToolBoxItem - { - Identifier = SID_ATTR_GRAF_GAMMA; - HelpID = SID_ATTR_GRAF_GAMMA; - }; - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - ToolBoxItem - { - Identifier = SID_ATTR_GRAF_TRANSPARENCE; - HelpID = SID_ATTR_GRAF_TRANSPARENCE; - }; - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - ToolBoxItem - { - Identifier = FN_FLIP_VERT_GRAFIC ; - HelpID = FN_FLIP_VERT_GRAFIC ; - }; - ToolBoxItem - { - Identifier = FN_FLIP_HORZ_GRAFIC ; - HelpID = FN_FLIP_HORZ_GRAFIC ; - }; - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - MN_ATTRIBUTES_GRAFIK - }; - Scroll = TRUE ; -}; String RID_OLE_TOOLBOX { Text [ en-US ] = "Object" ; Text [ x-comment ] = " "; }; -ToolBox RID_OLE_TOOLBOX -{ - HelpID = HID_OLE_TOOLBOX ; - Border = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - LineSpacing = TRUE ; - HideWhenDeactivate = TRUE ; - Customize = TRUE ; - MenuStrings = TRUE ; - Hide = TRUE ; - Scroll = TRUE ; - ItemList = - { - MN_TEMPLATE - MN_FRAME_WRAP - MN_CONTOUR - MN_FRAME1 - MN_FRAME2 - MN_FRAME3 - MN_LINESTYLE - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - MN_ATTRIBUTES_OLE - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - MN_LAYER - ToolBoxItem - { - Identifier = FN_TOOL_ANKER ; - HelpID = FN_TOOL_ANKER ; - DropDown = TRUE ; - }; - }; -}; String RID_DRAW_TOOLBOX { Text [ en-US ] = "Draw Object Bar" ; Text [ x-comment ] = " "; }; -ToolBox RID_DRAW_TOOLBOX -{ - HelpID = HID_DRAW_TOOLBOX ; - Border = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - LineSpacing = TRUE ; - HideWhenDeactivate = TRUE ; - Customize = TRUE ; - MenuStrings = TRUE ; - Hide = TRUE ; - ItemList = - { - ToolBoxItem - { - Identifier = SID_BEZIER_EDIT ; - HelpID = SID_BEZIER_EDIT ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_ATTRIBUTES_LINE ; - HelpID = SID_ATTRIBUTES_LINE ; - }; - ToolBoxItem - { - ITEM_TOOLBAR_ATTR_LINEEND_STYLE - }; - ToolBoxItem - { - ITEM_TOOLBAR_ATTR_LINE_STYLE - }; - ToolBoxItem - { - ITEM_TOOLBAR_ATTR_LINE_WIDTH - }; - ToolBoxItem - { - ITEM_TOOLBAR_ATTR_LINE_COLOR - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_ATTRIBUTES_AREA ; - HelpID = SID_ATTRIBUTES_AREA ; - }; - ToolBoxItem - { - ITEM_TOOLBAR_ATTR_FILL_STYLE - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - ITEM_TOOLBAR_OBJECT_ROTATE - }; - ToolBoxItem - { - Identifier = FN_TOOL_ANKER ; - HelpID = FN_TOOL_ANKER ; - DropDown = TRUE ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_FRAME_NOWRAP ; - HelpID = FN_FRAME_NOWRAP ; - RadioCheck = TRUE ; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = FN_FRAME_WRAP ; - HelpID = FN_FRAME_WRAP ; - RadioCheck = TRUE ; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = FN_FRAME_WRAP_IDEAL ; - HelpID = FN_FRAME_WRAP_IDEAL ; - RadioCheck = TRUE ; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = FN_FRAME_WRAP_LEFT ; - HelpID = FN_FRAME_WRAP_LEFT ; - RadioCheck = TRUE ; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = FN_FRAME_WRAP_RIGHT ; - HelpID = FN_FRAME_WRAP_RIGHT ; - RadioCheck = TRUE ; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = FN_FRAME_WRAPTHRU ; - HelpID = FN_FRAME_WRAPTHRU ; - RadioCheck = TRUE ; - Hide = TRUE; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_FRAME_WRAP_CONTOUR ; - HelpID = FN_FRAME_WRAP_CONTOUR ; - Hide = TRUE ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_OBJECT_HEAVEN ; - HelpID = SID_OBJECT_HEAVEN ; - }; - ToolBoxItem - { - Identifier = SID_OBJECT_HELL ; - HelpID = SID_OBJECT_HELL ; - }; - MN_LAYER - MN_GRID( HIDE=TRUE ) - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_OBJECT_ALIGN ; - HelpID = SID_OBJECT_ALIGN ; - DropDown = TRUE ; - }; - }; - Scroll = TRUE ; -}; String RID_BEZIER_TOOLBOX { Text [ en-US ] = "Bézier Object Bar" ; Text [ x-comment ] = " "; }; -ToolBox RID_BEZIER_TOOLBOX -{ - HelpID = HID_BEZIER_TOOLBOX ; - Border = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - LineSpacing = TRUE ; - HideWhenDeactivate = TRUE ; - Customize = TRUE ; - MenuStrings = TRUE ; - Hide = TRUE ; - ItemList = - { - ToolBoxItem - { - Identifier = SID_BEZIER_EDIT ; - HelpID = SID_BEZIER_EDIT ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_BEZIER_MOVE ; - HelpID = SID_BEZIER_MOVE ; - RadioCheck = TRUE ; - }; - ToolBoxItem - { - Identifier = SID_BEZIER_INSERT ; - HelpID = SID_BEZIER_INSERT ; - RadioCheck = TRUE ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_BEZIER_DELETE ; - HelpID = SID_BEZIER_DELETE ; - }; - ToolBoxItem - { - Identifier = SID_BEZIER_CUTLINE ; - HelpID = SID_BEZIER_CUTLINE ; - }; - ToolBoxItem - { - Identifier = SID_BEZIER_CONVERT ; - HelpID = SID_BEZIER_CONVERT ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_BEZIER_EDGE ; - HelpID = SID_BEZIER_EDGE ; - RadioCheck = TRUE ; - }; - ToolBoxItem - { - Identifier = SID_BEZIER_SMOOTH ; - HelpID = SID_BEZIER_SMOOTH ; - RadioCheck = TRUE ; - }; - ToolBoxItem - { - Identifier = SID_BEZIER_SYMMTR ; - HelpID = SID_BEZIER_SYMMTR ; - RadioCheck = TRUE ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_BEZIER_CLOSE ; - HelpID = SID_BEZIER_CLOSE ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_BEZIER_ELIMINATE_POINTS ; - HelpID = SID_BEZIER_ELIMINATE_POINTS ; - }; - }; - Scroll = TRUE ; -}; String RID_DRAW_TEXT_TOOLBOX { Text [ en-US ] = "Text Object Bar/Graphics" ; Text [ x-comment ] = " "; }; -ToolBox RID_DRAW_TEXT_TOOLBOX -{ - HelpID = HID_DRAW_TEXT_TOOLBOX ; - Border = TRUE ; - Customize = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - LineSpacing = TRUE ; - HideWhenDeactivate = TRUE ; - MenuStrings = TRUE ; - Hide = TRUE ; - ItemList = - { - MN_FONT - MN_TEXT1(FALSE) - MN_TEXT1_BLOCK - MN_TEXT_LINESPACE - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - ITEM_TOOLBAR_ATTR_CHAR_COLOR - Hide = TRUE; - }; - MN_TEXT_LTR_RTL - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_TEXTDIRECTION_LEFT_TO_RIGHT ; - HelpID = SID_TEXTDIRECTION_LEFT_TO_RIGHT ; - }; - ToolBoxItem - { - Identifier = SID_TEXTDIRECTION_TOP_TO_BOTTOM ; - HelpID = SID_TEXTDIRECTION_TOP_TO_BOTTOM ; - }; - - MN_TEXT_DIALOGS(FALSE) - }; - ItemList[ ar ] = - { - MN_FONT - MN_TEXT1_RTL(FALSE) - MN_TEXT1_BLOCK - MN_TEXT_LINESPACE - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - ITEM_TOOLBAR_ATTR_CHAR_COLOR - Hide = TRUE; - }; - MN_TEXT_RTL_LTR - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_TEXTDIRECTION_LEFT_TO_RIGHT ; - HelpID = SID_TEXTDIRECTION_LEFT_TO_RIGHT ; - }; - ToolBoxItem - { - Identifier = SID_TEXTDIRECTION_TOP_TO_BOTTOM ; - HelpID = SID_TEXTDIRECTION_TOP_TO_BOTTOM ; - }; - - MN_TEXT_DIALOGS(FALSE) - }; - ItemList[ he ] = - { - MN_FONT - MN_TEXT1_RTL(FALSE) - MN_TEXT1_BLOCK - MN_TEXT_LINESPACE - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - ITEM_TOOLBAR_ATTR_CHAR_COLOR - Hide = TRUE; - }; - MN_TEXT_RTL_LTR - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_TEXTDIRECTION_LEFT_TO_RIGHT ; - HelpID = SID_TEXTDIRECTION_LEFT_TO_RIGHT ; - }; - ToolBoxItem - { - Identifier = SID_TEXTDIRECTION_TOP_TO_BOTTOM ; - HelpID = SID_TEXTDIRECTION_TOP_TO_BOTTOM ; - }; - - MN_TEXT_DIALOGS(FALSE) - }; - Scroll = TRUE ; -}; String RID_NUM_TOOLBOX { Text [ en-US ] = "Numbering Object Bar" ; Text [ x-comment ] = " "; }; -ToolBox RID_NUM_TOOLBOX -{ - HelpID = HID_NUM_TOOLBOX ; - Border = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - LineSpacing = TRUE ; - HideWhenDeactivate = TRUE ; - Customize = TRUE ; - MenuStrings = TRUE ; - Hide = TRUE ; - ItemList = - { - MN_TEMPLATE - MN_FONT - ToolBoxItem - { - Identifier = FN_NUM_BULLET_OFF ; - HelpID = FN_NUM_BULLET_OFF ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_NUM_BULLET_UP ; - HelpID = FN_NUM_BULLET_UP ; - }; - ToolBoxItem - { - Identifier = FN_NUM_BULLET_DOWN ; - HelpID = FN_NUM_BULLET_DOWN ; - }; - ToolBoxItem - { - Identifier = FN_NUM_BULLET_OUTLINE_UP ; - HelpID = FN_NUM_BULLET_OUTLINE_UP ; - }; - ToolBoxItem - { - Identifier = FN_NUM_BULLET_OUTLINE_DOWN ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_NUM_BULLET_NONUM ; - HelpID = FN_NUM_BULLET_NONUM ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_NUM_BULLET_MOVEUP ; - HelpID = FN_NUM_BULLET_MOVEUP ; - }; - ToolBoxItem - { - Identifier = FN_NUM_BULLET_MOVEDOWN ; - HelpID = FN_NUM_BULLET_MOVEDOWN ; - }; - ToolBoxItem - { - Identifier = FN_NUM_BULLET_OUTLINE_MOVEUP ; - HelpID = FN_NUM_BULLET_OUTLINE_MOVEUP ; - }; - ToolBoxItem - { - Identifier = FN_NUM_BULLET_OUTLINE_MOVEDOWN ; - HelpID = FN_NUM_BULLET_OUTLINE_MOVEDOWN ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_NUMBER_NEWSTART ; - HelpID = FN_NUMBER_NEWSTART ; - }; - ToolBoxItem - { - Identifier = FN_NUMBER_BULLETS ; - HelpID = FN_NUMBER_BULLETS ; - }; - }; - Scroll = TRUE ; -}; String STR_SHELLNAME_TEXT { Text [ en-US ] = "Text" ; diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx index 3e17c83893..486737089d 100644 --- a/sw/source/ui/shells/tabsh.cxx +++ b/sw/source/ui/shells/tabsh.cxx @@ -961,10 +961,11 @@ void SwTableShell::Execute(SfxRequest &rReq) case FN_TABLE_INSERT_COL_DLG: case FN_TABLE_INSERT_ROW_DLG: { + const SfxSlot* pSlot = GetStaticInterface()->GetSlot(nSlot); if ( FN_TABLE_INSERT_ROW_DLG != nSlot || !rSh.IsInRepeatedHeadline()) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ::std::auto_ptr<SvxAbstractInsRowColDlg> pDlg( pFact ? pFact->CreateSvxInsRowColDlg( GetView().GetWindow(), nSlot == FN_TABLE_INSERT_COL_DLG, nSlot) : 0); + ::std::auto_ptr<SvxAbstractInsRowColDlg> pDlg( pFact ? pFact->CreateSvxInsRowColDlg( GetView().GetWindow(), nSlot == FN_TABLE_INSERT_COL_DLG, pSlot->GetCommand() ) : 0); if( pDlg.get() && (pDlg->Execute() == 1) ) { diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx index 7bef6d5265..1c1efba2cd 100644 --- a/sw/source/ui/shells/textfld.cxx +++ b/sw/source/ui/shells/textfld.cxx @@ -313,7 +313,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) rReq.Ignore(); } break; - case FN_DELETE_NOTE: + case FN_DELETE_COMMENT: if ( GetView().GetPostItMgr() && GetView().GetPostItMgr()->HasActiveSidebarWin() ) { @@ -622,7 +622,7 @@ void SwTextShell::StateField( SfxItemSet &rSet ) { switch (nWhich) { - case FN_DELETE_NOTE: + case FN_DELETE_COMMENT: case FN_DELETE_NOTE_AUTHOR: case FN_DELETE_ALL_NOTES: case FN_HIDE_NOTE: @@ -634,7 +634,7 @@ void SwTextShell::StateField( SfxItemSet &rSet ) rSet.InvalidateItem( nWhich ); else if ( !pPostItMgr->HasActiveSidebarWin() ) { - rSet.InvalidateItem( FN_DELETE_NOTE ); + rSet.InvalidateItem( FN_DELETE_COMMENT ); rSet.InvalidateItem( FN_HIDE_NOTE ); } } diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx index e437de58d4..0326473a08 100644 --- a/sw/source/ui/shells/textsh.cxx +++ b/sw/source/ui/shells/textsh.cxx @@ -282,7 +282,6 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) break; case SID_INSERT_OBJECT: case SID_INSERT_PLUGIN: - case SID_INSERT_APPLET: { SFX_REQUEST_ARG( rReq, pNameItem, SfxGlobalNameItem, SID_INSERT_OBJECT, sal_False ); SvGlobalName *pName = NULL; @@ -293,18 +292,13 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) pName = &aName; } - SFX_REQUEST_ARG( rReq, pClassItem, SfxStringItem, FN_PARAM_1, sal_False ); SFX_REQUEST_ARG( rReq, pClassLocationItem, SfxStringItem, FN_PARAM_2, sal_False ); SFX_REQUEST_ARG( rReq, pCommandsItem, SfxStringItem, FN_PARAM_3, sal_False ); //TODO/LATER: recording currently not working, need code for Commandlist svt::EmbeddedObjectRef xObj; - if((SID_INSERT_APPLET == nSlot || SID_INSERT_PLUGIN) - && (pClassItem || pClassLocationItem || pCommandsItem)) + if( nSlot == SID_INSERT_PLUGIN && ( pClassLocationItem || pCommandsItem ) ) { - String sClass; String sClassLocation; - if(pClassItem) - sClass = pClassItem->GetValue(); if(pClassLocationItem) sClassLocation = pClassLocationItem->GetValue(); @@ -315,36 +309,6 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) aCommandList.AppendCommands( pCommandsItem->GetValue(), &nTemp ); } - if(SID_INSERT_APPLET == nSlot) - { - SwApplet_Impl aApplImpl( rSh.GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); - String sBaseURL; - SfxMedium* pMedium = GetView().GetDocShell()->GetMedium(); - if(pMedium) - sBaseURL = pMedium->GetURLObject().GetMainURL(INetURLObject::NO_DECODE); - - aApplImpl.CreateApplet(sClass, aEmptyStr, FALSE, sClassLocation, sBaseURL ); - aApplImpl.FinishApplet(); - xObj.Assign( aApplImpl.GetApplet(), embed::Aspects::MSOLE_CONTENT ); - if( aCommandList.Count() ) - { - uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY ); - if ( xSet.is() ) - { - uno::Sequence < beans::PropertyValue > aSeq; - aCommandList.FillSequence( aSeq ); - try - { - xSet->setPropertyValue( ::rtl::OUString::createFromAscii("AppletCommands"), uno::makeAny( aSeq ) ); - } - catch ( uno::Exception& ) - { - } - } - } - } - else { comphelper::EmbeddedObjectContainer aCnt; ::rtl::OUString sName; @@ -851,13 +815,8 @@ void SwTextShell::StateInsert( SfxItemSet &rSet ) case SID_INSERT_FLOATINGFRAME: case SID_INSERT_OBJECT: case SID_INSERT_PLUGIN: - case SID_INSERT_APPLET: { - if( -#ifndef SOLAR_JAVA - nWhich == SID_INSERT_APPLET || -#endif - eCreateMode == SFX_CREATE_MODE_EMBEDDED || bCrsrInHidden ) + if( eCreateMode == SFX_CREATE_MODE_EMBEDDED || bCrsrInHidden ) { rSet.DisableItem( nWhich ); } diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index 8a02ce6395..8640319d7f 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -127,7 +127,7 @@ #include <view.hxx> #include <ndtxt.hxx> #include <pam.hxx> - +#include <sfx2/objface.hxx> #include <langhelper.hxx> using namespace ::com::sun::star; @@ -461,7 +461,7 @@ void SwTextShell::Execute(SfxRequest &rReq) AbstractInsFootNoteDlg* pDlg = pFact->CreateInsFootNoteDlg( DLG_INS_FOOTNOTE, GetView().GetWindow(), rWrtSh, FALSE ); DBG_ASSERT(pDlg, "Dialogdiet fail!"); - pDlg->SetHelpId(nSlot); + pDlg->SetHelpId(GetStaticInterface()->GetSlot(nSlot)->GetCommand()); if ( pDlg->Execute() == RET_OK ) { USHORT nId = pDlg->IsEndNote() ? FN_INSERT_ENDNOTE : FN_INSERT_FOOTNOTE; diff --git a/sw/source/ui/table/chartins.src b/sw/source/ui/table/chartins.src index 6c30097791..92e20c682b 100644 --- a/sw/source/ui/table/chartins.src +++ b/sw/source/ui/table/chartins.src @@ -50,12 +50,14 @@ ModelessDialog DLG_INSERT_CHART }; Edit ED_RANGE { + HelpID = "sw:Edit:DLG_INSERT_CHART:ED_RANGE"; Border = TRUE ; Pos = MAP_APPFONT ( 56 , 14 ) ; Size = MAP_APPFONT ( 229 , 12 ) ; }; CheckBox CB_FIRST_ROW { + HelpID = "sw:CheckBox:DLG_INSERT_CHART:CB_FIRST_ROW"; Pos = MAP_APPFONT ( 12 , 32 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; TabStop = TRUE ; @@ -64,6 +66,7 @@ ModelessDialog DLG_INSERT_CHART }; CheckBox CB_FIRST_COL { + HelpID = "sw:CheckBox:DLG_INSERT_CHART:CB_FIRST_COL"; Pos = MAP_APPFONT ( 12 , 46 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; TabStop = TRUE ; @@ -96,6 +99,7 @@ ModelessDialog DLG_INSERT_CHART }; PushButton BT_PREV { + HelpID = "sw:PushButton:DLG_INSERT_CHART:BT_PREV"; Pos = MAP_APPFONT ( 130 , 151 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; // ### ACHTUNG: Neuer Text in Resource? << ~Zurück : << Zurück @@ -106,6 +110,7 @@ ModelessDialog DLG_INSERT_CHART }; PushButton BT_NEXT { + HelpID = "sw:PushButton:DLG_INSERT_CHART:BT_NEXT"; Pos = MAP_APPFONT ( 185 , 151 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Disable = TRUE ; @@ -114,6 +119,7 @@ ModelessDialog DLG_INSERT_CHART }; PushButton BT_FINISH { + HelpID = "sw:PushButton:DLG_INSERT_CHART:BT_FINISH"; Pos = MAP_APPFONT ( 240 , 151 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; diff --git a/sw/source/ui/table/colwd.src b/sw/source/ui/table/colwd.src index cd34b41bd5..1df5fe2cfc 100644 --- a/sw/source/ui/table/colwd.src +++ b/sw/source/ui/table/colwd.src @@ -32,7 +32,7 @@ // #define DLG_COL_WIDTH 256 ModalDialog DLG_COL_WIDTH { - HelpID = FN_TABLE_SET_COL_WIDTH ; + HelpID = CMD_FN_TABLE_SET_COL_WIDTH ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 159 , 60 ) ; @@ -66,6 +66,7 @@ ModalDialog DLG_COL_WIDTH }; MetricField ED_WIDTH { + HelpID = "sw:MetricField:DLG_COL_WIDTH:ED_WIDTH"; Border = TRUE ; Pos = MAP_APPFONT ( 51 , 30 ) ; Size = MAP_APPFONT ( 38 , 12 ) ; @@ -97,6 +98,7 @@ ModalDialog DLG_COL_WIDTH }; NumericField ED_COL { + HelpID = "sw:NumericField:DLG_COL_WIDTH:ED_COL"; Border = TRUE ; Pos = MAP_APPFONT ( 51 , 14 ) ; Size = MAP_APPFONT ( 38 , 12 ) ; diff --git a/sw/source/ui/table/convert.src b/sw/source/ui/table/convert.src index 50baa2bb9a..13e9b9e860 100644 --- a/sw/source/ui/table/convert.src +++ b/sw/source/ui/table/convert.src @@ -31,7 +31,7 @@ #include "helpid.h" ModalDialog DLG_CONV_TEXT_TABLE { - HelpID = FN_CONVERT_TEXT_TABLE ; + HelpID = CMD_FN_CONVERT_TEXT_TABLE ; OUTPUTSIZE = TRUE ; Size = MAP_APPFONT ( 203 , 169 ) ; Text [ en-US ] = "Convert Table to Text" ; @@ -39,6 +39,7 @@ ModalDialog DLG_CONV_TEXT_TABLE SVLOOK = TRUE ; RadioButton CB_TAB { + HelpID = "sw:RadioButton:DLG_CONV_TEXT_TABLE:CB_TAB"; Pos = MAP_APPFONT ( 12 , 17 ) ; Size = MAP_APPFONT ( 60 , 10 ) ; Text [ en-US ] = "~Tabs" ; @@ -48,6 +49,7 @@ ModalDialog DLG_CONV_TEXT_TABLE }; RadioButton CB_SEMI { + HelpID = "sw:RadioButton:DLG_CONV_TEXT_TABLE:CB_SEMI"; Pos = MAP_APPFONT ( 75 , 17 ) ; Size = MAP_APPFONT ( 60 , 10 ) ; Text [ en-US ] = "~Semicolons" ; @@ -55,6 +57,7 @@ ModalDialog DLG_CONV_TEXT_TABLE }; RadioButton CB_PARA { + HelpID = "sw:RadioButton:DLG_CONV_TEXT_TABLE:CB_PARA"; Pos = MAP_APPFONT ( 12 , 33 ) ; Size = MAP_APPFONT ( 60 , 10 ) ; Text [ en-US ] = "~Paragraph" ; @@ -62,12 +65,14 @@ ModalDialog DLG_CONV_TEXT_TABLE }; RadioButton RB_OTHER { + HelpID = "sw:RadioButton:DLG_CONV_TEXT_TABLE:RB_OTHER"; Pos = MAP_APPFONT ( 75 , 33 ) ; Size = MAP_APPFONT ( 45 , 10 ) ; Text [ en-US ] = "~Other: " ; }; Edit ED_OTHER { + HelpID = "sw:Edit:DLG_CONV_TEXT_TABLE:ED_OTHER"; Border = TRUE ; Left = TRUE ; Pos = MAP_APPFONT ( 123 , 32 ) ; @@ -77,6 +82,7 @@ ModalDialog DLG_CONV_TEXT_TABLE }; CheckBox CB_KEEPCOLUMN { + HelpID = "sw:CheckBox:DLG_CONV_TEXT_TABLE:CB_KEEPCOLUMN"; Pos = MAP_APPFONT ( 12 , 49 ) ; Size = MAP_APPFONT ( 128 , 10 ) ; Check = TRUE; @@ -92,6 +98,7 @@ ModalDialog DLG_CONV_TEXT_TABLE }; CheckBox CB_HEADER { + HelpID = "sw:CheckBox:DLG_CONV_TEXT_TABLE:CB_HEADER"; Pos = MAP_APPFONT ( 12 , 84 ) ; Size = MAP_APPFONT ( 123 , 10 ) ; TabStop = TRUE ; @@ -99,6 +106,7 @@ ModalDialog DLG_CONV_TEXT_TABLE }; CheckBox CB_REPEAT_HEADER { + HelpID = "sw:CheckBox:DLG_CONV_TEXT_TABLE:CB_REPEAT_HEADER"; Pos = MAP_APPFONT ( 22 , 97 ) ; Size = MAP_APPFONT ( 113 , 10 ) ; Text [ en-US ] = "Repeat heading"; @@ -112,6 +120,7 @@ ModalDialog DLG_CONV_TEXT_TABLE }; NumericField NF_REPEAT_HEADER { + HelpID = "sw:NumericField:DLG_CONV_TEXT_TABLE:NF_REPEAT_HEADER"; Border = TRUE ; Pos = MAP_APPFONT ( 191 , 112 ) ; Size = MAP_APPFONT ( 28 , 12 ) ; @@ -130,6 +139,7 @@ ModalDialog DLG_CONV_TEXT_TABLE }; CheckBox CB_DONT_SPLIT { + HelpID = "sw:CheckBox:DLG_CONV_TEXT_TABLE:CB_DONT_SPLIT"; Pos = MAP_APPFONT ( 12 , 126 ) ; Size = MAP_APPFONT ( 123 , 10 ) ; TabStop = TRUE ; @@ -137,6 +147,7 @@ ModalDialog DLG_CONV_TEXT_TABLE }; CheckBox CB_BORDER { + HelpID = "sw:CheckBox:DLG_CONV_TEXT_TABLE:CB_BORDER"; Pos = MAP_APPFONT ( 12 , 139 ) ; Size = MAP_APPFONT ( 123 , 10 ) ; TabStop = TRUE ; @@ -173,6 +184,7 @@ ModalDialog DLG_CONV_TEXT_TABLE }; PushButton BT_AUTOFORMAT { + HelpID = "sw:PushButton:DLG_CONV_TEXT_TABLE:BT_AUTOFORMAT"; Pos = MAP_APPFONT ( 12 , 152 ) ; Size = MAP_APPFONT ( 86 , 14 ) ; TabStop = TRUE ; diff --git a/sw/source/ui/table/instable.src b/sw/source/ui/table/instable.src index 3930bb36ab..e5a636d3b8 100644 --- a/sw/source/ui/table/instable.src +++ b/sw/source/ui/table/instable.src @@ -32,7 +32,7 @@ // #define DLG_INSERT_TABLE 256 ModalDialog DLG_INSERT_TABLE { - HelpID = FN_INSERT_TABLE ; + HelpID = CMD_FN_INSERT_TABLE ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 280 , 166 ) ; @@ -40,6 +40,7 @@ ModalDialog DLG_INSERT_TABLE Moveable = TRUE ; Edit ED_NAME { + HelpID = "sw:Edit:DLG_INSERT_TABLE:ED_NAME"; Border = TRUE ; Pos = MAP_APPFONT ( 53 , 6 ) ; Size = MAP_APPFONT ( 158, 12 ) ; @@ -60,6 +61,7 @@ ModalDialog DLG_INSERT_TABLE }; NumericField ED_COL { + HelpID = "sw:NumericField:DLG_INSERT_TABLE:ED_COL"; Border = TRUE ; Pos = MAP_APPFONT ( 53 , 32 ) ; Size = MAP_APPFONT ( 28 , 12 ) ; @@ -82,6 +84,7 @@ ModalDialog DLG_INSERT_TABLE }; NumericField ED_ROW { + HelpID = "sw:NumericField:DLG_INSERT_TABLE:ED_ROW"; Border = TRUE ; Pos = MAP_APPFONT ( 53 , 48 ) ; Size = MAP_APPFONT ( 28 , 12 ) ; @@ -103,6 +106,7 @@ ModalDialog DLG_INSERT_TABLE }; CheckBox CB_HEADER { + HelpID = "sw:CheckBox:DLG_INSERT_TABLE:CB_HEADER"; Pos = MAP_APPFONT ( 12 , 74 ) ; Size = MAP_APPFONT (113 , 10 ) ; TabStop = TRUE ; @@ -110,6 +114,7 @@ ModalDialog DLG_INSERT_TABLE }; CheckBox CB_REPEAT_HEADER { + HelpID = "sw:CheckBox:DLG_INSERT_TABLE:CB_REPEAT_HEADER"; Pos = MAP_APPFONT ( 21 , 88 ) ; Size = MAP_APPFONT ( 104 , 10 ) ; TabStop = TRUE ; @@ -123,6 +128,7 @@ ModalDialog DLG_INSERT_TABLE }; NumericField NF_REPEAT_HEADER { + HelpID = "sw:NumericField:DLG_INSERT_TABLE:NF_REPEAT_HEADER"; Border = TRUE ; Pos = MAP_APPFONT ( 130 , 104 ) ; Size = MAP_APPFONT ( 28 , 12 ) ; @@ -141,6 +147,7 @@ ModalDialog DLG_INSERT_TABLE }; CheckBox CB_DONT_SPLIT { + HelpID = "sw:CheckBox:DLG_INSERT_TABLE:CB_DONT_SPLIT"; Pos = MAP_APPFONT ( 12 , 118 ) ; Size = MAP_APPFONT ( 113 , 10 ) ; Text [ en-US ] = "Don't split table"; @@ -148,6 +155,7 @@ ModalDialog DLG_INSERT_TABLE }; CheckBox CB_BORDER { + HelpID = "sw:CheckBox:DLG_INSERT_TABLE:CB_BORDER"; Pos = MAP_APPFONT ( 12 , 132 ) ; Size = MAP_APPFONT ( 113 , 10 ) ; TabStop = TRUE ; @@ -155,6 +163,7 @@ ModalDialog DLG_INSERT_TABLE }; PushButton BT_AUTOFORMAT { + HelpID = "sw:PushButton:DLG_INSERT_TABLE:BT_AUTOFORMAT"; Pos = MAP_APPFONT ( 12 , 146 ) ; Size = MAP_APPFONT ( 86 , 14 ) ; TabStop = TRUE ; diff --git a/sw/source/ui/table/mergetbl.src b/sw/source/ui/table/mergetbl.src index 97ef9cb2cd..de6fa33159 100644 --- a/sw/source/ui/table/mergetbl.src +++ b/sw/source/ui/table/mergetbl.src @@ -31,7 +31,7 @@ #include "helpid.h" ModalDialog DLG_MERGE_TABLE { - HelpID = FN_TABLE_MERGE_TABLE ; + HelpID = CMD_FN_TABLE_MERGE_TABLE ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 207 , 57 ) ; @@ -63,6 +63,7 @@ ModalDialog DLG_MERGE_TABLE }; RadioButton RB_MERGE_PREV { + HelpID = "sw:RadioButton:DLG_MERGE_TABLE:RB_MERGE_PREV"; Pos = MAP_APPFONT ( 12 , 15 ) ; Size = MAP_APPFONT ( 130 , 10 ) ; Check = TRUE ; @@ -71,6 +72,7 @@ ModalDialog DLG_MERGE_TABLE }; RadioButton RB_MERGE_NEXT { + HelpID = "sw:RadioButton:DLG_MERGE_TABLE:RB_MERGE_NEXT"; Pos = MAP_APPFONT ( 12 , 30 ) ; Size = MAP_APPFONT ( 130 , 10 ) ; Text [ en-US ] = "Join with ~next table"; diff --git a/sw/source/ui/table/rowht.src b/sw/source/ui/table/rowht.src index ea3ac27474..6d537f415a 100644 --- a/sw/source/ui/table/rowht.src +++ b/sw/source/ui/table/rowht.src @@ -31,7 +31,7 @@ #include "helpid.h" ModalDialog DLG_ROW_HEIGHT { - HelpID = FN_TABLE_SET_ROW_HEIGHT ; + HelpID = CMD_FN_TABLE_SET_ROW_HEIGHT ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 157 , 60 ) ; @@ -59,6 +59,7 @@ ModalDialog DLG_ROW_HEIGHT }; MetricField ED_HEIGHT { + HelpID = "sw:MetricField:DLG_ROW_HEIGHT:ED_HEIGHT"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 16 ) ; Size = MAP_APPFONT ( 38 , 12 ) ; @@ -76,6 +77,7 @@ ModalDialog DLG_ROW_HEIGHT }; CheckBox CB_AUTOHEIGHT { + HelpID = "sw:CheckBox:DLG_ROW_HEIGHT:CB_AUTOHEIGHT"; Pos = MAP_APPFONT ( 12 , 34 ) ; Size = MAP_APPFONT ( 80 , 10 ) ; /* ### ACHTUNG: Neuer Text in Resource? ~dynamisch anpassen : auto. H~öhe */ diff --git a/sw/source/ui/table/splittbl.src b/sw/source/ui/table/splittbl.src index e58d64ab96..d785f9ea06 100644 --- a/sw/source/ui/table/splittbl.src +++ b/sw/source/ui/table/splittbl.src @@ -31,7 +31,7 @@ #include "helpid.h" ModalDialog DLG_SPLIT_TABLE { - HelpID = FN_TABLE_SPLIT_TABLE ; + HelpID = CMD_FN_TABLE_SPLIT_TABLE ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 207 , 76 ) ; @@ -63,6 +63,7 @@ ModalDialog DLG_SPLIT_TABLE }; RadioButton RB_CNTNT { + HelpID = "sw:RadioButton:DLG_SPLIT_TABLE:RB_CNTNT"; Pos = MAP_APPFONT ( 12 , 15 ) ; Size = MAP_APPFONT ( 130 , 10 ) ; Check = TRUE ; @@ -71,18 +72,21 @@ ModalDialog DLG_SPLIT_TABLE }; RadioButton RB_BOX_PARA { + HelpID = "sw:RadioButton:DLG_SPLIT_TABLE:RB_BOX_PARA"; Pos = MAP_APPFONT ( 12 , 30 ) ; Size = MAP_APPFONT ( 130 , 10 ) ; Text [ en-US ] = "C~ustom heading (apply Style)" ; }; RadioButton RB_BOX_NOPARA { + HelpID = "sw:RadioButton:DLG_SPLIT_TABLE:RB_BOX_NOPARA"; Pos = MAP_APPFONT ( 12 , 45 ) ; Size = MAP_APPFONT ( 130 , 10 ) ; Text [ en-US ] = "Cu~stom heading" ; }; RadioButton RB_BORDER { + HelpID = "sw:RadioButton:DLG_SPLIT_TABLE:RB_BORDER"; Pos = MAP_APPFONT ( 12 , 60 ) ; Size = MAP_APPFONT ( 130 , 10 ) ; Text [ en-US ] = "~No heading" ; diff --git a/sw/source/ui/table/tabledlg.src b/sw/source/ui/table/tabledlg.src index 0dd3607c2d..b3d52ec516 100644 --- a/sw/source/ui/table/tabledlg.src +++ b/sw/source/ui/table/tabledlg.src @@ -98,6 +98,7 @@ TabPage TP_FORMAT_TABLE }; Edit ED_NAME { + HelpID = "sw:Edit:TP_FORMAT_TABLE:ED_NAME"; Border = TRUE ; Pos = MAP_APPFONT ( 75 , 14 ) ; Size = MAP_APPFONT ( 112 , 12 ) ; @@ -111,6 +112,7 @@ TabPage TP_FORMAT_TABLE }; MetricField ED_WIDTH { + HelpID = "sw:MetricField:TP_FORMAT_TABLE:ED_WIDTH"; Border = TRUE ; Pos = MAP_APPFONT ( 75 , 30 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -129,6 +131,7 @@ TabPage TP_FORMAT_TABLE }; CheckBox CB_REL_WIDTH { + HelpID = "sw:CheckBox:TP_FORMAT_TABLE:CB_REL_WIDTH"; Pos = MAP_APPFONT ( 118 , 32 ) ; Size = MAP_APPFONT ( 69 , 10 ) ; TabStop = TRUE ; @@ -142,6 +145,7 @@ TabPage TP_FORMAT_TABLE }; RadioButton RB_FULL { + HelpID = "sw:RadioButton:TP_FORMAT_TABLE:RB_FULL"; Pos = MAP_APPFONT ( 202 , 14 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; TabStop = TRUE ; @@ -149,6 +153,7 @@ TabPage TP_FORMAT_TABLE }; RadioButton RB_LEFT { + HelpID = "sw:RadioButton:TP_FORMAT_TABLE:RB_LEFT"; Pos = MAP_APPFONT ( 202 , 28 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Text [ en-US ] = "~Left" ; @@ -156,6 +161,7 @@ TabPage TP_FORMAT_TABLE }; RadioButton RB_FROM_LEFT { + HelpID = "sw:RadioButton:TP_FORMAT_TABLE:RB_FROM_LEFT"; Pos = MAP_APPFONT ( 202 , 42 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; TabStop = TRUE ; @@ -163,6 +169,7 @@ TabPage TP_FORMAT_TABLE }; RadioButton RB_RIGHT { + HelpID = "sw:RadioButton:TP_FORMAT_TABLE:RB_RIGHT"; Pos = MAP_APPFONT ( 202 , 56 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Text [ en-US ] = "R~ight" ; @@ -170,6 +177,7 @@ TabPage TP_FORMAT_TABLE }; RadioButton RB_CENTER { + HelpID = "sw:RadioButton:TP_FORMAT_TABLE:RB_CENTER"; Pos = MAP_APPFONT ( 202 , 70 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Text [ en-US ] = "~Center" ; @@ -177,6 +185,7 @@ TabPage TP_FORMAT_TABLE }; RadioButton RB_FREE { + HelpID = "sw:RadioButton:TP_FORMAT_TABLE:RB_FREE"; Pos = MAP_APPFONT ( 202 , 84 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; TabStop = TRUE ; @@ -202,6 +211,7 @@ TabPage TP_FORMAT_TABLE }; MetricField ED_LEFT_DIST { + HelpID = "sw:MetricField:TP_FORMAT_TABLE:ED_LEFT_DIST"; Pos = MAP_APPFONT ( 147 , 59 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; Border = TRUE ; @@ -226,6 +236,7 @@ TabPage TP_FORMAT_TABLE MetricField ED_RIGHT_DIST { + HelpID = "sw:MetricField:TP_FORMAT_TABLE:ED_RIGHT_DIST"; Pos = MAP_APPFONT ( 147 , 75 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; Border = TRUE ; @@ -249,6 +260,7 @@ TabPage TP_FORMAT_TABLE }; MetricField ED_TOP_DIST { + HelpID = "sw:MetricField:TP_FORMAT_TABLE:ED_TOP_DIST"; Pos = MAP_APPFONT ( 147 , 91 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; Border = TRUE ; @@ -272,6 +284,7 @@ TabPage TP_FORMAT_TABLE }; MetricField ED_BOTTOM_DIST { + HelpID = "sw:MetricField:TP_FORMAT_TABLE:ED_BOTTOM_DIST"; Border = TRUE ; Pos = MAP_APPFONT ( 147 , 107 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -303,6 +316,7 @@ TabPage TP_FORMAT_TABLE }; ListBox LB_TEXTDIRECTION { + HelpID = "sw:ListBox:TP_FORMAT_TABLE:LB_TEXTDIRECTION"; Border = TRUE ; Pos = MAP_APPFONT ( 75 , 136 ) ; Size = MAP_APPFONT ( 176 , 50 ) ; @@ -329,6 +343,7 @@ TabPage TP_TABLE_COLUMN Hide = TRUE; CheckBox CB_MOD_TBL { + HelpID = "sw:CheckBox:TP_TABLE_COLUMN:CB_MOD_TBL"; Pos = MAP_APPFONT ( 6 , 6 ) ; Size = MAP_APPFONT ( 180 , 10 ) ; TabStop = TRUE ; @@ -336,6 +351,7 @@ TabPage TP_TABLE_COLUMN }; CheckBox CB_PROP { + HelpID = "sw:CheckBox:TP_TABLE_COLUMN:CB_PROP"; Pos = MAP_APPFONT ( 6 , 20 ) ; Size = MAP_APPFONT ( 180 , 10 ) ; TabStop = TRUE ; @@ -349,6 +365,7 @@ TabPage TP_TABLE_COLUMN }; MetricField ED_SPACE { + HelpID = "sw:MetricField:TP_TABLE_COLUMN:ED_SPACE"; ReadOnly = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 95 , 34 ) ; @@ -365,6 +382,7 @@ TabPage TP_TABLE_COLUMN }; ImageButton COL_BTN_DOWN { + HelpID = "sw:ImageButton:TP_TABLE_COLUMN:COL_BTN_DOWN"; Disable = TRUE ; Pos = MAP_APPFONT ( 12 , 65 ) ; Size = MAP_APPFONT ( 10 , 10 ) ; @@ -373,6 +391,7 @@ TabPage TP_TABLE_COLUMN }; ImageButton COL_BTN_UP { + HelpID = "sw:ImageButton:TP_TABLE_COLUMN:COL_BTN_UP"; Disable = TRUE ; Pos = MAP_APPFONT ( 234 , 65 ) ; Size = MAP_APPFONT ( 10 , 10 ) ; @@ -391,6 +410,7 @@ TabPage TP_TABLE_COLUMN }; MetricField COL_MF_1 { + HelpID = "sw:MetricField:TP_TABLE_COLUMN:COL_MF_1"; Disable = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 13 , 81 ) ; @@ -418,6 +438,7 @@ TabPage TP_TABLE_COLUMN }; MetricField COL_MF_2 { + HelpID = "sw:MetricField:TP_TABLE_COLUMN:COL_MF_2"; Disable = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 52 , 81 ) ; @@ -445,6 +466,7 @@ TabPage TP_TABLE_COLUMN }; MetricField COL_MF_3 { + HelpID = "sw:MetricField:TP_TABLE_COLUMN:COL_MF_3"; Disable = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 91 , 81 ) ; @@ -472,6 +494,7 @@ TabPage TP_TABLE_COLUMN }; MetricField COL_MF_4 { + HelpID = "sw:MetricField:TP_TABLE_COLUMN:COL_MF_4"; Disable = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 130 , 81 ) ; @@ -499,6 +522,7 @@ TabPage TP_TABLE_COLUMN }; MetricField COL_MF_5 { + HelpID = "sw:MetricField:TP_TABLE_COLUMN:COL_MF_5"; Disable = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 169 , 81 ) ; @@ -526,6 +550,7 @@ TabPage TP_TABLE_COLUMN }; MetricField COL_MF_6 { + HelpID = "sw:MetricField:TP_TABLE_COLUMN:COL_MF_6"; Disable = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 208 , 81 ) ; @@ -568,6 +593,7 @@ TabPage TP_TABLE_TEXTFLOW }; CheckBox CB_PAGEBREAK { + HelpID = "sw:CheckBox:TP_TABLE_TEXTFLOW:CB_PAGEBREAK"; // Disable = TRUE; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 90 , 8 ) ; @@ -577,6 +603,7 @@ TabPage TP_TABLE_TEXTFLOW }; RadioButton RB_BREAKPAGE { + HelpID = "sw:RadioButton:TP_TABLE_TEXTFLOW:RB_BREAKPAGE"; Pos = MAP_APPFONT ( 105 , 14 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; Text [ en-US ] = "~Page" ; @@ -585,6 +612,7 @@ TabPage TP_TABLE_TEXTFLOW }; RadioButton RB_BREAKCOLUMN { + HelpID = "sw:RadioButton:TP_TABLE_TEXTFLOW:RB_BREAKCOLUMN"; // Disable = TRUE; Pos = MAP_APPFONT ( 178 , 14 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; @@ -593,6 +621,7 @@ TabPage TP_TABLE_TEXTFLOW }; RadioButton RB_PAGEBREAKBEFORE { + HelpID = "sw:RadioButton:TP_TABLE_TEXTFLOW:RB_PAGEBREAKBEFORE"; // Disable = TRUE; Pos = MAP_APPFONT ( 105 , 28 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; @@ -602,6 +631,7 @@ TabPage TP_TABLE_TEXTFLOW }; RadioButton RB_PAGEBREAKAFTER { + HelpID = "sw:RadioButton:TP_TABLE_TEXTFLOW:RB_PAGEBREAKAFTER"; // Disable = TRUE; Pos = MAP_APPFONT ( 178 , 28 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; @@ -609,6 +639,7 @@ TabPage TP_TABLE_TEXTFLOW }; CheckBox CB_PAGECOLL { + HelpID = "sw:CheckBox:TP_TABLE_TEXTFLOW:CB_PAGECOLL"; // Disable = TRUE; Pos = MAP_APPFONT ( 12 , 44 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; @@ -618,6 +649,7 @@ TabPage TP_TABLE_TEXTFLOW }; ListBox LB_PAGECOLL { + HelpID = "sw:ListBox:TP_TABLE_TEXTFLOW:LB_PAGECOLL"; Pos = MAP_APPFONT ( 105 , 42 ) ; Size = MAP_APPFONT ( 61 , 50 ) ; TabStop = TRUE ; @@ -631,6 +663,7 @@ TabPage TP_TABLE_TEXTFLOW }; NumericField NF_PAGENUM { + HelpID = "sw:NumericField:TP_TABLE_TEXTFLOW:NF_PAGENUM"; Border = TRUE ; Pos = MAP_APPFONT ( 222 , 42 ) ; Size = MAP_APPFONT ( 26 , 12 ) ; @@ -646,6 +679,7 @@ TabPage TP_TABLE_TEXTFLOW }; CheckBox CB_SPLIT { + HelpID = "sw:CheckBox:TP_TABLE_TEXTFLOW:CB_SPLIT"; Pos = MAP_APPFONT ( 12 , 58 ) ; Size = MAP_APPFONT ( 236 , 10 ) ; TabStop = TRUE ; @@ -653,6 +687,7 @@ TabPage TP_TABLE_TEXTFLOW }; TriStateBox CB_SPLIT_ROW { + HelpID = "sw:TriStateBox:TP_TABLE_TEXTFLOW:CB_SPLIT_ROW"; Pos = MAP_APPFONT ( 21 , 71 ) ; Size = MAP_APPFONT ( 227 , 10 ) ; TabStop = TRUE ; @@ -660,6 +695,7 @@ TabPage TP_TABLE_TEXTFLOW }; CheckBox CB_KEEP { + HelpID = "sw:CheckBox:TP_TABLE_TEXTFLOW:CB_KEEP"; Pos = MAP_APPFONT ( 12 , 85 ) ; Size = MAP_APPFONT ( 236 , 10 ) ; Text [ en-US ] = "~Keep with next paragraph" ; @@ -667,6 +703,7 @@ TabPage TP_TABLE_TEXTFLOW }; CheckBox CB_HEADLINE { + HelpID = "sw:CheckBox:TP_TABLE_TEXTFLOW:CB_HEADLINE"; Pos = MAP_APPFONT ( 12 , 99 ) ; Size = MAP_APPFONT ( 236 , 10 ) ; TabStop = TRUE ; @@ -680,6 +717,7 @@ TabPage TP_TABLE_TEXTFLOW }; NumericField NF_REPEAT_HEADER { + HelpID = "sw:NumericField:TP_TABLE_TEXTFLOW:NF_REPEAT_HEADER"; Border = TRUE ; Pos = MAP_APPFONT ( 131 , 113 ) ; Size = MAP_APPFONT ( 28 , 12 ) ; @@ -704,6 +742,7 @@ TabPage TP_TABLE_TEXTFLOW }; ListBox LB_TEXTDIRECTION { + HelpID = "sw:ListBox:TP_TABLE_TEXTFLOW:LB_TEXTDIRECTION"; Pos = MAP_APPFONT ( 85 , 130 ) ; Size = MAP_APPFONT ( 163 , 50 ) ; DropDown = TRUE; @@ -730,6 +769,7 @@ TabPage TP_TABLE_TEXTFLOW }; ListBox LB_VERTORIENT { + HelpID = "sw:ListBox:TP_TABLE_TEXTFLOW:LB_VERTORIENT"; Pos = MAP_APPFONT ( 85 , 162 ) ; Size = MAP_APPFONT ( 61 , 50 ) ; DropDown = TRUE; diff --git a/sw/source/ui/table/tautofmt.src b/sw/source/ui/table/tautofmt.src index ab314e0932..ec6eaad812 100644 --- a/sw/source/ui/table/tautofmt.src +++ b/sw/source/ui/table/tautofmt.src @@ -43,6 +43,7 @@ ModalDialog DLG_AUTOFMT_TABLE }; ListBox LB_FORMAT { + HelpID = "sw:ListBox:DLG_AUTOFMT_TABLE:LB_FORMAT"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 65 , 100 ) ; @@ -56,6 +57,7 @@ ModalDialog DLG_AUTOFMT_TABLE }; CheckBox BTN_NUMFORMAT { + HelpID = "sw:CheckBox:DLG_AUTOFMT_TABLE:BTN_NUMFORMAT"; Hide = TRUE ; Pos = MAP_APPFONT ( 12 , 131 ) ; Size = MAP_APPFONT ( 60 , 10 ) ; @@ -64,6 +66,7 @@ ModalDialog DLG_AUTOFMT_TABLE }; CheckBox BTN_BORDER { + HelpID = "sw:CheckBox:DLG_AUTOFMT_TABLE:BTN_BORDER"; Hide = TRUE ; Pos = MAP_APPFONT ( 12 , 147 ) ; Size = MAP_APPFONT ( 60 , 10 ) ; @@ -72,6 +75,7 @@ ModalDialog DLG_AUTOFMT_TABLE }; CheckBox BTN_FONT { + HelpID = "sw:CheckBox:DLG_AUTOFMT_TABLE:BTN_FONT"; Hide = TRUE ; Pos = MAP_APPFONT ( 85 , 131 ) ; Size = MAP_APPFONT ( 60 , 10 ) ; @@ -80,6 +84,7 @@ ModalDialog DLG_AUTOFMT_TABLE }; CheckBox BTN_PATTERN { + HelpID = "sw:CheckBox:DLG_AUTOFMT_TABLE:BTN_PATTERN"; Hide = TRUE ; Pos = MAP_APPFONT ( 85 , 147 ) ; Size = MAP_APPFONT ( 60 , 10 ) ; @@ -88,6 +93,7 @@ ModalDialog DLG_AUTOFMT_TABLE }; CheckBox BTN_ALIGNMENT { + HelpID = "sw:CheckBox:DLG_AUTOFMT_TABLE:BTN_ALIGNMENT"; Hide = TRUE ; Pos = MAP_APPFONT ( 150 , 131 ) ; Size = MAP_APPFONT ( 60 , 10 ) ; @@ -116,6 +122,7 @@ ModalDialog DLG_AUTOFMT_TABLE }; MoreButton BTN_MORE { + HelpID = "sw:MoreButton:DLG_AUTOFMT_TABLE:BTN_MORE"; Pos = MAP_APPFONT ( 255 , 101 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~More" ; @@ -125,6 +132,7 @@ ModalDialog DLG_AUTOFMT_TABLE }; PushButton BTN_ADD { + HelpID = "sw:PushButton:DLG_AUTOFMT_TABLE:BTN_ADD"; Pos = MAP_APPFONT ( 255 , 64 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Add" ; @@ -132,6 +140,7 @@ ModalDialog DLG_AUTOFMT_TABLE }; PushButton BTN_REMOVE { + HelpID = "sw:PushButton:DLG_AUTOFMT_TABLE:BTN_REMOVE"; Pos = MAP_APPFONT ( 255 , 81 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Delete" ; @@ -139,6 +148,7 @@ ModalDialog DLG_AUTOFMT_TABLE }; PushButton BTN_RENAME { + HelpID = "sw:PushButton:DLG_AUTOFMT_TABLE:BTN_RENAME"; Pos = MAP_APPFONT ( 255 , 123 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -219,6 +229,7 @@ ModalDialog DLG_SWDLG_STRINPUT HelpID = HID_SWDLG_STRINPUT ; Edit ED_INPUT { + HelpID = "sw:Edit:DLG_SWDLG_STRINPUT:ED_INPUT"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 24 ) ; Size = MAP_APPFONT ( 104 , 12 ) ; diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index a633abb3e9..f798aafcb1 100755..100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -28,8 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - #include <sfx2/objface.hxx> #include <vcl/timer.hxx> #include <vcl/field.hxx> @@ -54,10 +52,7 @@ #include <svx/svdview.hxx> #include <svx/dlgutil.hxx> #include <svx/zoomslideritem.hxx> -#ifndef _SVX_SVXIDS_HRC //autogen #include <svx/svxids.hrc> -#endif - #include <swwait.hxx> #include <globdoc.hxx> @@ -73,27 +68,16 @@ #include <view.hxx> #include <textsh.hxx> #include <scroll.hxx> -#include <swprtopt.hxx> +#include <prtopt.hxx> #include <docstat.hxx> #include <usrpref.hxx> #include <viewfunc.hxx> - -#ifndef _HELPID_H #include <helpid.h> -#endif -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif -#ifndef _POPUP_HRC #include <popup.hrc> -#endif -#ifndef _PVIEW_HRC #include <pview.hrc> -#endif #define SwPagePreView #include <sfx2/msg.hxx> @@ -105,6 +89,7 @@ #include <svx/dialogs.hrc> #include <vos/mutex.hxx> + using namespace ::com::sun::star; @@ -1292,8 +1277,7 @@ void SwPagePreView::Init(const SwViewOption * pPrefs) GetViewShell()->ApplyAccessiblityOptions(SW_MOD()->GetAccessibilityOptions()); // OD 09.01.2003 #i6467# - adjust view shell option to the same as for print - SwPrtOptions aPrintOptions( GetViewFrame()->GetObjectShell()->GetTitle(0) ); - aPrintOptions.MakeOptions( false ); + SwPrintData const aPrintOptions = *SW_MOD()->GetPrtOptions(false); GetViewShell()->AdjustOptionsForPagePreview( aPrintOptions ); IDocumentSettingAccess* pIDSA = pESh->getIDocumentSettingAccess(); @@ -1451,9 +1435,9 @@ int SwPagePreView::_CreateScrollbar( BOOL bHori ) { pPageUpBtn = new ImageButton(pMDI, SW_RES( BTN_PAGEUP ) ); - pPageUpBtn->SetHelpId(FN_PAGEUP); + pPageUpBtn->SetHelpId(GetStaticInterface()->GetSlot(FN_PAGEUP)->GetCommand()); pPageDownBtn = new ImageButton(pMDI, SW_RES( BTN_PAGEDOWN ) ); - pPageDownBtn->SetHelpId(FN_PAGEDOWN); + pPageDownBtn->SetHelpId(GetStaticInterface()->GetSlot(FN_PAGEDOWN)->GetCommand()); Link aLk( LINK( this, SwPagePreView, BtnPage ) ); pPageUpBtn->SetClickHdl( aLk ); pPageDownBtn->SetClickHdl( aLk ); diff --git a/sw/source/ui/uiview/pview.src b/sw/source/ui/uiview/pview.src index 4b97c83c43..99b325b3ce 100755..100644 --- a/sw/source/ui/uiview/pview.src +++ b/sw/source/ui/uiview/pview.src @@ -54,6 +54,7 @@ ModalDialog DLG_PAGEPREVIEW_ZOOM }; NumericField ED_COL { + HelpID = "sw:NumericField:DLG_PAGEPREVIEW_ZOOM:ED_COL"; Border = TRUE ; Size = MAP_APPFONT ( 28 , 12 ) ; Pos = MAP_APPFONT ( 48 , 34 ) ; @@ -69,6 +70,7 @@ ModalDialog DLG_PAGEPREVIEW_ZOOM }; NumericField ED_ROW { + HelpID = "sw:NumericField:DLG_PAGEPREVIEW_ZOOM:ED_ROW"; Border = TRUE ; Pos = MAP_APPFONT ( 48 , 13 ) ; Size = MAP_APPFONT ( 28 , 12 ) ; @@ -106,92 +108,4 @@ String RID_PVIEW_TOOLBOX { Text [ en-US ] = "Page Preview" ; }; -ToolBox RID_PVIEW_TOOLBOX -{ - Border = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - LineSpacing = TRUE ; - HideWhenDeactivate = TRUE ; - Customize = TRUE ; - HelpID = HID_PVIEW_TOOLBOX ; - ItemList = - { - ToolBoxItem - { - Identifier = FN_PAGEUP ; - HelpID = FN_PAGEUP ; - }; - ToolBoxItem - { - Identifier = FN_PAGEDOWN ; - HelpID = FN_PAGEDOWN ; - }; - ToolBoxItem - { - Identifier = FN_START_OF_DOCUMENT ; - HelpID = FN_START_OF_DOCUMENT ; - }; - ToolBoxItem - { - Identifier = FN_END_OF_DOCUMENT ; - HelpID = FN_END_OF_DOCUMENT ; - }; - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - ToolBoxItem - { - Identifier = FN_SHOW_TWO_PAGES ; - HelpID = FN_SHOW_TWO_PAGES ; - }; - ToolBoxItem - { - Identifier = FN_SHOW_MULTIPLE_PAGES ; - HelpID = FN_SHOW_MULTIPLE_PAGES ; - DropDown = TRUE; - }; - ToolBoxItem - { - Identifier = FN_SHOW_BOOKVIEW ; - HelpID = FN_SHOW_BOOKVIEW ; - }; - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - ToolBoxItem - { - Identifier = SID_ZOOM_OUT; - HelpID = SID_ZOOM_OUT ; - }; - ToolBoxItem - { - Identifier = SID_ZOOM_IN; - HelpID = SID_ZOOM_IN ; - }; - ToolBoxItem - { - Identifier = FN_PREVIEW_ZOOM; - HelpID = HID_PREVIEW_ZOOM ; - }; - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - ToolBoxItem - { - Identifier = SID_WIN_FULLSCREEN ; - HelpID = SID_WIN_FULLSCREEN ; - }; - ToolBoxItem - { - Identifier = FN_PRINT_PAGEPREVIEW ; - HelpID = FN_PRINT_PAGEPREVIEW ; - }; - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - ToolBoxItem - { - Identifier = FN_CLOSE_PAGEPREVIEW; - HelpID = SID_PRINTPREVIEW; - }; - }; - Scroll = TRUE ; -}; diff --git a/sw/source/ui/uiview/swcli.cxx b/sw/source/ui/uiview/swcli.cxx index 996ab9b235..f3e8b6f2c5 100644 --- a/sw/source/ui/uiview/swcli.cxx +++ b/sw/source/ui/uiview/swcli.cxx @@ -27,16 +27,17 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#include <com/sun/star/embed/NoVisualAreaSizeException.hpp> +#include <com/sun/star/embed/NoVisualAreaSizeException.hpp> #include <wrtsh.hxx> +#include <doc.hxx> #include <swtypes.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <edtwin.hxx> #include <swcli.hxx> +#include <cmdid.h> +#include <cfgitems.hxx> #include <toolkit/helper/vclunohelper.hxx> @@ -169,3 +170,18 @@ void SwOleClient::MakeVisible() const SwWrtShell &rSh = ((SwView*)GetViewShell())->GetWrtShell(); rSh.MakeObjVisible( GetObject() ); } + +// --> #i972# +void SwOleClient::FormatChanged() +{ + const uno::Reference < embed::XEmbeddedObject >& xObj( GetObject() ); + SwView * pView = dynamic_cast< SwView * >( GetViewShell() ); + if ( pView && xObj.is() && SotExchange::IsMath( xObj->getClassID() ) ) + { + SwWrtShell & rWrtSh = pView->GetWrtShell(); + if (rWrtSh.GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT )) + rWrtSh.AlignFormulaToBaseline( xObj ); + } +} +// <-- + diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 8d750d9234..1722c0ac13 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -94,7 +94,6 @@ #include <frmui.hrc> #include <cfgitems.hxx> #include <prtopt.hxx> -#include <swprtopt.hxx> #include <linguistic/lngprops.hxx> #include <editeng/unolingu.hxx> //#include <sfx2/app.hxx> @@ -1912,8 +1911,7 @@ SfxObjectShellRef & SwView::GetOrCreateTmpSelectionDoc() if (!rxTmpDoc.Is()) { SwXTextView *pImpl = GetViewImpl()->GetUNOObject_Impl(); - rxTmpDoc = pImpl->BuildTmpSelectionDoc( - GetViewImpl()->GetEmbeddedObjRef() ); + rxTmpDoc = pImpl->BuildTmpSelectionDoc(); } return rxTmpDoc; } @@ -1927,17 +1925,12 @@ void SwView::AddTransferable(SwTransferable& rTransferable) /* --------------------------------------------------*/ -void SwPrtOptions::MakeOptions( BOOL bWeb ) -{ - *this = *SW_MOD()->GetPrtOptions(bWeb); - - nCopyCount = 1; - bCollate = FALSE; - bPrintSelection = FALSE; - bJobStartet = FALSE; +namespace sw { - aMulti.SetTotalRange( Range( 0, RANGE_MAX ) ); - aMulti.SelectAll(); - aMulti.Select( 0, FALSE ); +void InitPrintOptionsFromApplication(SwPrintData & o_rData, bool const bWeb) +{ + o_rData = *SW_MOD()->GetPrtOptions(bWeb); } +} // namespace sw + diff --git a/sw/source/ui/uiview/view.src b/sw/source/ui/uiview/view.src index 233664b509..e006ee71ae 100644 --- a/sw/source/ui/uiview/view.src +++ b/sw/source/ui/uiview/view.src @@ -196,160 +196,6 @@ String MN_SRCVIEW_POPUPMENU Text [ en-US ] = "HTML source" ; }; -ToolBox RID_TOOLS_TOOLBOX -{ - HelpID = HID_TOOLS_TOOLBOX ; - Border = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - LineSpacing = TRUE ; - HideWhenDeactivate = TRUE ; - Customize = TRUE ; - MenuStrings = TRUE ; - Scroll = TRUE ; - Align = BOXALIGN_LEFT ; - Hide = TRUE ; - ItemList = - { - ToolBoxItem - { - Identifier = FN_INSERT_CTRL ; - HelpID = HID_INSERT_CTRL ; - DropDown = TRUE ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_INSERT_FIELD_CTRL ; - HelpID = HID_INSERT_FIELD_CTRL ; - DropDown = TRUE ; - }; - ToolBoxItem - { - Identifier = FN_INSERT_OBJ_CTRL ; - HelpID = HID_INSERT_OBJ_CTRL ; - DropDown = TRUE ; - }; - ToolBoxItem - { - ITEM_TOOLBAR_INSERT_DRAW - }; - ToolBoxItem - { - ITEM_FORM_CONFIG - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_GLOSSARY_DLG ; - HelpID = FN_GLOSSARY_DLG ; - DropDown = TRUE ; - }; - ToolBoxItem - { - Identifier = FN_INSERT_CAPTION; - HelpID = FN_INSERT_CAPTION ; - Hide = TRUE ; - }; - ToolBoxItem - { - Identifier = FN_INSERT_IDX_ENTRY_DLG; - HelpId = FN_INSERT_IDX_ENTRY_DLG; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = FN_INSERT_REF_FIELD; - HelpID = FN_INSERT_REF_FIELD ; - Hide = TRUE ; - }; - ToolBoxItem - { - Identifier = FN_SHADOWCURSOR ; - HelpID = FN_SHADOWCURSOR ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_SPELL_GRAMMAR_DIALOG; - HelpID = FN_SPELL_GRAMMAR_DIALOG; - }; - ToolBoxItem - { - ITEM_TOOLBAR_AUTOSPELL_CHECK - }; - ToolBoxItem - { - Identifier = FN_HYPHENATE_OPT_DLG; - HelpID = FN_HYPHENATE_OPT_DLG; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = SID_THESAURUS; - HelpID = SID_THESAURUS; - Hide = TRUE; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_SEARCH_DLG ; - HelpID = SID_SEARCH_DLG ; - }; - ToolBoxItem - { - Identifier = SID_VIEW_DATA_SOURCE_BROWSER ; - HelpID = SID_VIEW_DATA_SOURCE_BROWSER ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_ATTR_ZOOM; - HelpID = SID_ATTR_ZOOM ; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = FN_VIEW_META_CHARS ; - HelpID = FN_VIEW_META_CHARS ; - }; - ToolBoxItem - { - Identifier = FN_VIEW_FIELDNAME ; - HelpID = FN_VIEW_FIELDNAME ; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = FN_VIEW_GRAPHIC ; - HelpID = FN_VIEW_GRAPHIC ; - }; - ToolBoxItem - { - Identifier = SID_BROWSER_MODE ; - HelpID = SID_BROWSER_MODE ; - }; - }; -}; Menu MN_SRCVIEW_POPUPMENU { ItemList = diff --git a/sw/source/ui/uiview/viewdlg2.cxx b/sw/source/ui/uiview/viewdlg2.cxx index 27f017c517..8388df1566 100644 --- a/sw/source/ui/uiview/viewdlg2.cxx +++ b/sw/source/ui/uiview/viewdlg2.cxx @@ -31,7 +31,7 @@ #include <sfx2/request.hxx> #include <sfx2/viewfrm.hxx> - +#include <sfx2/objface.hxx> #include <fldmgr.hxx> #include <expfld.hxx> @@ -92,7 +92,7 @@ void SwView::ExecDlgExt(SfxRequest &rReq) pMDI, *pWrtShell, TRUE ); DBG_ASSERT(pDlg, "Dialogdiet fail!"); - pDlg->SetHelpId(FN_EDIT_FOOTNOTE); + pDlg->SetHelpId(GetStaticInterface()->GetSlot(FN_EDIT_FOOTNOTE)->GetCommand()); pDlg->SetText( SW_RESSTR(STR_EDIT_FOOTNOTE) ); pDlg->Execute(); delete pDlg; diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx index 88ad18947b..45e9272250 100644 --- a/sw/source/ui/uiview/viewprt.cxx +++ b/sw/source/ui/uiview/viewprt.cxx @@ -70,7 +70,6 @@ #include <docsh.hxx> #include <viewopt.hxx> #include <prtopt.hxx> -#include <swprtopt.hxx> #include <fontcfg.hxx> #include <cfgitems.hxx> #include <dbmgr.hxx> diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx index 36b7d7afd6..b19a36cba5 100755..100644 --- a/sw/source/ui/uno/SwXDocumentSettings.cxx +++ b/sw/source/ui/uno/SwXDocumentSettings.cxx @@ -123,7 +123,8 @@ enum SwDocumentSettingsPropertyHandles // --> OD 2008-06-05 #i89181# HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, // <-- - HANDLE_MODIFYPASSWORDINFO + HANDLE_MODIFYPASSWORDINFO, + HANDLE_MATH_BASELINE_ALIGNMENT }; MasterPropertySetInfo * lcl_createSettingsInfo() @@ -178,6 +179,7 @@ MasterPropertySetInfo * lcl_createSettingsInfo() // --> OD 2008-06-05 #i89181# { RTL_CONSTASCII_STRINGPARAM("TabAtLeftIndentForParagraphsInList"), HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, CPPUTYPE_BOOLEAN, 0, 0}, { RTL_CONSTASCII_STRINGPARAM("ModifyPasswordInfo"), HANDLE_MODIFYPASSWORDINFO, CPPUTYPE_PROPERTYVALUE, 0, 0}, + { RTL_CONSTASCII_STRINGPARAM("MathBaselineAlignment"), HANDLE_MATH_BASELINE_ALIGNMENT, CPPUTYPE_BOOLEAN, 0, 0}, /* * As OS said, we don't have a view when we need to set this, so I have to @@ -686,6 +688,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf uno::Reference< uno::XInterface >() ); } break; + case HANDLE_MATH_BASELINE_ALIGNMENT: + { + sal_Bool bTmp = *(sal_Bool*)rValue.getValue(); + mpDoc->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT, bTmp ); + } + break; default: throw UnknownPropertyException(); } @@ -1018,6 +1026,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf rValue <<= mpDocSh->GetModifyPasswordInfo(); } break; + case HANDLE_MATH_BASELINE_ALIGNMENT: + { + sal_Bool bTmp = mpDoc->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ); + rValue.setValue( &bTmp, ::getBooleanCppuType() ); + } + break; default: throw UnknownPropertyException(); diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx index 50c19caaac..f5da10cb6f 100644 --- a/sw/source/ui/uno/unomod.cxx +++ b/sw/source/ui/uno/unomod.cxx @@ -52,7 +52,7 @@ #include <comphelper/ChainablePropertySetInfo.hxx> #include <edtwin.hxx> #include <rtl/ustrbuf.hxx> - +#include <tools/urlobj.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -799,14 +799,12 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c OUString sHelpURL; if ( ! ( rValue >>= sHelpURL ) ) throw IllegalArgumentException(); - SwEditWin &rEditWin = pView->GetEditWin(); - OUString sPrefix = sHelpURL.copy ( 0, 4 ); - // Make sure we have a valid string...should be in the format HID:12345 - if ( ! sPrefix.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "HID:" ) ) ) + + INetURLObject aHID( sHelpURL ); + if ( aHID.GetProtocol() == INET_PROT_HID ) + pView->GetEditWin().SetHelpId( rtl::OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 ) ); + else throw IllegalArgumentException (); - OUString sNumber = sHelpURL.copy ( 4 ); - sal_uInt32 nHelpId = sNumber.toInt32(); - rEditWin.SetHelpId ( nHelpId ); } else throw UnknownPropertyException(); @@ -918,7 +916,7 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u case HANDLE_VIEWSET_TABSTOPS : bBoolVal = mpConstViewOption->IsTab(sal_True); break; case HANDLE_VIEWSET_BREAKS : bBoolVal = mpConstViewOption->IsLineBreak(sal_True); break; case HANDLE_VIEWSET_HIDDEN_TEXT : bBoolVal = mpConstViewOption->IsShowHiddenField(); break; - case HANDLE_VIEWSET_HIDDEN_CHARACTERS : bBoolVal = mpConstViewOption->IsShowHiddenChar(); break; + case HANDLE_VIEWSET_HIDDEN_CHARACTERS : bBoolVal = mpConstViewOption->IsShowHiddenChar(sal_True); break; case HANDLE_VIEWSET_HIDDEN_PARAGRAPHS : bBoolVal = mpConstViewOption->IsShowHiddenPara(); break; case HANDLE_VIEWSET_TABLE_BOUNDARIES : bBoolVal = SwViewOption::IsTableBoundaries(); break; case HANDLE_VIEWSET_TEXT_BOUNDARIES : bBoolVal = SwViewOption::IsDocBoundaries(); break; @@ -985,9 +983,9 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u { bBool = sal_False; OUStringBuffer sHelpURL; - sHelpURL.appendAscii ( "HID:" ); + sHelpURL.appendAscii ( INET_HID_SCHEME ); SwEditWin &rEditWin = pView->GetEditWin(); - sHelpURL.append ( static_cast < sal_Int32 > ( rEditWin.GetHelpId() ) ); + sHelpURL.append( rtl::OStringToOUString( rEditWin.GetHelpId(), RTL_TEXTENCODING_UTF8 ) ); rValue <<= sHelpURL.makeStringAndClear(); } else diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 8dd657d3ee..7752e74d28 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -47,7 +47,7 @@ #include <srcview.hxx> #include <viewsh.hxx> #include <pvprtdat.hxx> -#include <swprtopt.hxx> +#include <printdata.hxx> #include <svl/stritem.hxx> #include <unotxdoc.hxx> #include <svl/numuno.hxx> @@ -83,7 +83,6 @@ #include <globals.hrc> #include <unomid.h> #include <unotools/printwarningoptions.hxx> - #include <com/sun/star/util/SearchOptions.hpp> #include <com/sun/star/lang/ServiceNotRegisteredException.hpp> #include <com/sun/star/lang/DisposedException.hpp> @@ -948,7 +947,7 @@ SwUnoCrsr* SwXTextDocument::FindAny(const Reference< util::XSearchDescriptor > RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_PARATR_BEGIN, RES_PARATR_END-1, RES_FRMATR_BEGIN, RES_FRMATR_END-1, - RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, + RES_TXTATR_INETFMT, RES_TXTATR_CHARFMT, 0); pSearch->FillSearchItemSet(aSearch); BOOL bCancel; @@ -2716,14 +2715,15 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( m_pRenderData->ViewOptionAdjustStart( *pWrtShell, *pWrtShell->GetViewOptions() ); } - m_pRenderData->SetSwPrtOptions( new SwPrtOptions( C2U( bIsPDFExport ? "PDF export" : "Printing" ) ) ); + m_pRenderData->SetSwPrtOptions( new SwPrintData ); m_pRenderData->MakeSwPrtOptions( m_pRenderData->GetSwPrtOptionsRef(), pRenderDocShell, m_pPrintUIOptions, m_pRenderData, bIsPDFExport ); - + if (pView->IsA(aSwViewTypeId)) { // PDF export should not make use of the SwPrtOptions - const SwPrtOptions *pPrtOptions = bIsPDFExport? NULL : m_pRenderData->GetSwPrtOptions(); + const SwPrintData *pPrtOptions = (bIsPDFExport) + ? NULL : m_pRenderData->GetSwPrtOptions(); m_pRenderData->ViewOptionAdjust( pPrtOptions ); } @@ -3080,19 +3080,20 @@ void SAL_CALL SwXTextDocument::render( SwWrtShell* pWrtShell = pView->IsA(aSwViewTypeId) ? ((SwView*)pView)->GetWrtShellPtr() : 0; - + if (bIsPDFExport && bFirstPage && pWrtShell) { SwEnhancedPDFExportHelper aHelper( *pWrtShell, *pOut, aPageRange, bIsSkipEmptyPages, sal_False ); } // <-- - - const SwPrtOptions &rSwPrtOptions = *m_pRenderData->GetSwPrtOptions(); + + SwPrintData const& rSwPrtOptions = + *m_pRenderData->GetSwPrtOptions(); if (bPrintProspect) pVwSh->PrintProspect( pOut, rSwPrtOptions, nRenderer ); else // normal printing and PDF export pVwSh->PrintOrPDFExport( pOut, rSwPrtOptions, nRenderer ); - + // --> FME 2004-10-08 #i35176# // // After printing the last page, we take care for the links coming @@ -4110,8 +4111,8 @@ SwViewOptionAdjust_Impl::~SwViewOptionAdjust_Impl() } -void SwViewOptionAdjust_Impl::AdjustViewOptions( - const SwPrtOptions *pPrtOptions ) +void +SwViewOptionAdjust_Impl::AdjustViewOptions(SwPrintData const*const pPrtOptions) { // to avoid unnecessary reformatting the view options related to the content // below should only change if necessary, that is if respective content is present diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 8ba286f926..3ec786f45d 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -903,14 +903,17 @@ void SAL_CALL SwXTextView::setRubyList( /*-- 29.12.02 15:45:29--------------------------------------------------- -----------------------------------------------------------------------*/ -SfxObjectShellRef SwXTextView::BuildTmpSelectionDoc( SfxObjectShellRef& /*rRef*/ ) +SfxObjectShellRef SwXTextView::BuildTmpSelectionDoc() { SwWrtShell& rOldSh = m_pView->GetWrtShell(); SfxPrinter *pPrt = rOldSh.getIDocumentDeviceAccess()->getPrinter( false ); SwDocShell* pDocSh; SfxObjectShellRef xDocSh( pDocSh = new SwDocShell( /*pPrtDoc, */SFX_CREATE_MODE_STANDARD ) ); xDocSh->DoInitNew( 0 ); - rOldSh.FillPrtDoc(pDocSh->GetDoc(), pPrt); + SwDoc *const pTempDoc( pDocSh->GetDoc() ); + // #i103634#, #i112425#: do not expand numbering and fields on PDF export + pTempDoc->SetClipBoard(true); + rOldSh.FillPrtDoc(pTempDoc, pPrt); SfxViewFrame* pDocFrame = SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 ); SwView* pDocView = (SwView*) pDocFrame->GetViewShell(); pDocView->AttrChangedNotify( &pDocView->GetWrtShell() );//Damit SelectShell gerufen wird. diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx index 418d9ace33..e6c98ed02e 100644 --- a/sw/source/ui/utlui/content.cxx +++ b/sw/source/ui/utlui/content.cxx @@ -952,6 +952,7 @@ SwContentTree::SwContentTree(Window* pParent, const ResId& rResId) : aUpdTimer.SetTimeout(1000); Clear(); EnableContextMenuHandling(); + SetStyle( GetStyle() | WB_QUICK_SEARCH ); } /*************************************************************************** diff --git a/sw/source/ui/utlui/glbltree.cxx b/sw/source/ui/utlui/glbltree.cxx index d4e5463790..a118ca13ab 100644 --- a/sw/source/ui/utlui/glbltree.cxx +++ b/sw/source/ui/utlui/glbltree.cxx @@ -117,7 +117,7 @@ using ::rtl::OUString; #define GLBL_TABPOS_SUB 5 const SfxObjectShell* SwGlobalTree::pShowShell = 0; -static const USHORT __FAR_DATA aHelpForMenu[] = +static const char* __FAR_DATA aHelpForMenu[] = { 0, // HID_GLBLTREE_UPDATE, //CTX_UPDATE diff --git a/sw/source/ui/utlui/gloslst.src b/sw/source/ui/utlui/gloslst.src index 1ccf855ffe..db34b8c5ae 100644 --- a/sw/source/ui/utlui/gloslst.src +++ b/sw/source/ui/utlui/gloslst.src @@ -68,6 +68,7 @@ ModalDialog DLG_GLOSSARY_DECIDE_DLG }; ListBox LB_LIST { + HelpID = "sw:ListBox:DLG_GLOSSARY_DECIDE_DLG:LB_LIST"; Pos = MAP_APPFONT ( 12 , 15 ) ; Size = MAP_APPFONT ( 81 , 40 ) ; TabStop = TRUE ; diff --git a/sw/source/ui/utlui/initui.cxx b/sw/source/ui/utlui/initui.cxx index 65731de981..c4147c3910 100644 --- a/sw/source/ui/utlui/initui.cxx +++ b/sw/source/ui/utlui/initui.cxx @@ -260,7 +260,8 @@ ImpAutoFmtNameListLoader::ImpAutoFmtNameListLoader( SvStringsDtor& rLst ) p->SearchAndReplace(C2S("%1"), C2S(",,")); p->SearchAndReplace(C2S("%2"), C2S("''")); #else - const LocaleDataWrapper& rLclD = SvtSysLocale().GetLocaleData(); + const SvtSysLocale aSysLocale; + const LocaleDataWrapper& rLclD = aSysLocale.GetLocaleData(); //unter richtigen Betriebssystemen funktioniert es auch so p->SearchAndReplace(C2S("%1"), rLclD.getDoubleQuotationMarkStart()); p->SearchAndReplace(C2S("%2"), rLclD.getDoubleQuotationMarkEnd()); diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx index 55276b7e33..9f27fd34e3 100644 --- a/sw/source/ui/utlui/navipi.cxx +++ b/sw/source/ui/utlui/navipi.cxx @@ -429,14 +429,17 @@ IMPL_LINK( SwNavigationPI, ToolBoxDropdownClickHdl, ToolBox*, pBox ) case FN_DROP_REGION: { + static const char* aHIDs[] = + { + HID_NAVI_DRAG_HYP, + HID_NAVI_DRAG_LINK, + HID_NAVI_DRAG_COPY, + }; PopupMenu *pMenu = new PopupMenu; for (USHORT i = 0; i <= REGION_MODE_EMBEDDED; i++) { pMenu->InsertItem( i + 1, aContextArr[i] ); - pMenu->SetHelpId(i + 1, HID_NAVI_DRAG_HYP + i); - /*HID_NAVI_DRAG_HYP - HID_NAVI_DRAG_LINK - HID_NAVI_DRAG_COPY */ + pMenu->SetHelpId(i + 1, aHIDs[i]); } pMenu->CheckItem( nRegionMode + 1 ); pMenu->SetSelectHdl(LINK(this, SwNavigationPI, MenuSelectHdl)); @@ -865,7 +868,7 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings, ((SfxDockingWindow*)pParent)->SetOutputSizePixel(aMinSize); aContentTree.SetPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y ); - aContentTree.SetWindowBits( WB_HASBUTTONS|WB_HASBUTTONSATROOT| + aContentTree.SetStyle( aContentTree.GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT| WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE ); aContentTree.SetSpaceBetweenEntries(3); aContentTree.SetSelectionMode( SINGLE_SELECTION ); @@ -879,7 +882,7 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings, // TreeListBox fuer Globaldokument aGlobalTree.SetPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y ); aGlobalTree.SetSelectionMode( MULTIPLE_SELECTION ); - aGlobalTree.SetWindowBits( WB_HASBUTTONS|WB_HASBUTTONSATROOT| + aGlobalTree.SetStyle( aGlobalTree.GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT| WB_CLIPCHILDREN|WB_HSCROLL ); Size aGlblSize(aGlobalToolBox.CalcWindowSizePixel()); aGlobalToolBox.SetSizePixel(aGlblSize); diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx index c9e10d69c0..fb28ef5000 100644 --- a/sw/source/ui/utlui/uitool.cxx +++ b/sw/source/ui/utlui/uitool.cxx @@ -730,7 +730,8 @@ SwTwips GetTableWidth( SwFrmFmt* pFmt, SwTabCols& rCols, USHORT *pPercent, String GetAppLangDateTimeString( const DateTime& rDT ) { - const LocaleDataWrapper& rAppLclData = SvtSysLocale().GetLocaleData(); + const SvtSysLocale aSysLocale; + const LocaleDataWrapper& rAppLclData = aSysLocale.GetLocaleData(); String sRet( rAppLclData.getDate( rDT )); ( sRet += ' ' ) += rAppLclData.getTime( rDT, FALSE, FALSE ); return sRet; diff --git a/sw/source/ui/utlui/unotools.src b/sw/source/ui/utlui/unotools.src index aa4be8804c..c6a4443a39 100644 --- a/sw/source/ui/utlui/unotools.src +++ b/sw/source/ui/utlui/unotools.src @@ -44,6 +44,7 @@ ModalDialog DLG_RENAME_XNAMED }; Edit ED_NEW_NAME { + HelpID = "sw:Edit:DLG_RENAME_XNAMED:ED_NEW_NAME"; Pos = MAP_APPFONT ( 65 , 13 ) ; Size = MAP_APPFONT ( 87 , 12 ) ; Border = TRUE; diff --git a/sw/source/ui/web/web.src b/sw/source/ui/web/web.src index 08b6707962..b647d83311 100644 --- a/sw/source/ui/web/web.src +++ b/sw/source/ui/web/web.src @@ -65,124 +65,6 @@ String RID_WEBTOOLS_TOOLBOX { Text [ en-US ] = "Main Toolbar/Web" ; }; -ToolBox RID_WEBTOOLS_TOOLBOX -{ - HelpID = HID_WEBTOOLS_TOOLBOX ; - Border = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - LineSpacing = TRUE ; - HideWhenDeactivate = TRUE ; - Customize = TRUE ; - MenuStrings = TRUE ; - Scroll = TRUE ; - Hide = TRUE ; - Align = BOXALIGN_LEFT ; - ItemList = - { - ToolBoxItem - { - Identifier = FN_INSERT_CTRL ; - HelpID = HID_INSERT_CTRL ; - DropDown = TRUE ; - }; - ToolBoxItem - { - Identifier = FN_INSERT_FIELD_CTRL ; - HelpID = HID_INSERT_FIELD_CTRL ; - DropDown = TRUE ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_DRAW_TEXT_MARQUEE ; - HelpID = SID_DRAW_TEXT_MARQUEE ; - }; - ToolBoxItem - { - Identifier = SID_FM_CONFIG ; - HelpID = SID_FM_CONFIG; - DropDown = TRUE ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_GLOSSARY_DLG ; - HelpID = FN_GLOSSARY_DLG ; - DropDown = TRUE ; - }; - ToolBoxItem - { - Identifier = FN_SPELL_GRAMMAR_DIALOG; - HelpID = FN_SPELL_GRAMMAR_DIALOG; - }; - ToolBoxItem - { - ITEM_TOOLBAR_AUTOSPELL_CHECK - }; - ToolBoxItem - { - Identifier = FN_HYPHENATE_OPT_DLG; - HelpID = FN_HYPHENATE_OPT_DLG; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = SID_THESAURUS; - HelpID = SID_THESAURUS; - Hide = TRUE; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_SEARCH_DLG ; - HelpID = SID_SEARCH_DLG ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_ATTR_ZOOM; - HelpID = SID_ATTR_ZOOM ; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = FN_VIEW_META_CHARS ; - HelpID = FN_VIEW_META_CHARS ; - }; - ToolBoxItem - { - Identifier = FN_VIEW_GRAPHIC ; - HelpID = FN_VIEW_GRAPHIC ; - }; - ToolBoxItem - { - Identifier = FN_PRINT_LAYOUT ; - HelpID = FN_PRINT_LAYOUT ; - }; - ToolBoxItem - { - Identifier = SID_SOURCEVIEW ; - HelpID = HID_SOURCEVIEW ; - }; - }; -}; /************************************************************************* Textleiste *************************************************************************/ @@ -190,152 +72,18 @@ String RID_WEBTEXT_TOOLBOX { Text [ en-US ] = "Text Object Bar/Web" ; }; -ToolBox RID_WEBTEXT_TOOLBOX -{ - HelpID = HID_WEBTEXT_TOOLBOX ; - Border = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - Hide = TRUE ; - HideWhenDeactivate = TRUE ; - LineSpacing = TRUE ; - Customize = TRUE ; - MenuStrings = TRUE ; - ItemList = - { - MN_TEMPLATE - MN_FONT - MN_TEXT1(TRUE) - MN_TEXT_LTR_RTL - MN_TEXT_LINESPACE - MN_TEXT2 - MN_TEXT_BACKGROUND - MN_TEXT_DIALOGS(TRUE) - }; - Scroll = TRUE ; -}; String RID_WEBFRAME_TOOLBOX { Text [ en-US ] = "Frame Object Bar/Web" ; }; -ToolBox RID_WEBFRAME_TOOLBOX -{ - HelpID = HID_WEBFRAME_TOOLBOX ; - Border = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - Hide = TRUE ; - LineSpacing = TRUE ; - MenuStrings = TRUE ; - HideWhenDeactivate = TRUE ; - Customize = TRUE ; - ItemList = - { - MN_FRAME_WRAP_WEB - MN_FRAME1 - MN_FRAME3 - MN_LINESTYLE - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - MN_BACKGROUND_COLOR - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - MN_ATTRIBUTES_FRAME - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - MN_LAYER - ToolBoxItem - { - Identifier = FN_TOOL_ANKER ; - HelpID = FN_TOOL_ANKER ; - }; - }; - Scroll = TRUE ; -}; String RID_WEBGRAPHIC_TOOLBOX { Text [ en-US ] = "Graphics Object Bar/Web" ; }; -ToolBox RID_WEBGRAPHIC_TOOLBOX -{ - HelpID = HID_WEBGRAPHIC_TOOLBOX ; - Border = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - LineSpacing = TRUE ; - HideWhenDeactivate = TRUE ; - MenuStrings = TRUE ; - Customize = TRUE ; - Hide = TRUE ; - ItemList = - { - MN_FRAME_WRAP_WEB - MN_FRAME1 - MN_FRAME3 - MN_LINESTYLE - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - MN_ATTRIBUTES_GRAFIK - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - MN_LAYER - ToolBoxItem - { - Identifier = FN_TOOL_ANKER ; - HelpID = FN_TOOL_ANKER ; - DropDown = TRUE ; - }; - }; - Scroll = TRUE ; -}; String RID_WEBOLE_TOOLBOX { Text [ en-US ] = "Object/Web" ; }; -ToolBox RID_WEBOLE_TOOLBOX -{ - HelpID = HID_OLE_TOOLBOX ; - Border = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - LineSpacing = TRUE ; - HideWhenDeactivate = TRUE ; - Customize = TRUE ; - MenuStrings = TRUE ; - Hide = TRUE ; - Scroll = TRUE ; - ItemList = - { - MN_FRAME_WRAP_WEB - MN_FRAME1 - MN_FRAME3 - MN_LINESTYLE - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - MN_ATTRIBUTES_OLE - ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; - MN_LAYER - ToolBoxItem - { - Identifier = FN_TOOL_ANKER ; - HelpID = FN_TOOL_ANKER ; - DropDown = TRUE ; - }; - }; -}; /************************************************************************* *************************************************************************/ diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index b3087f78fb..3e0a2c8ce7 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -27,6 +27,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/embed/XVisualObject.hpp> #include <com/sun/star/embed/EmbedMisc.hpp> @@ -42,9 +43,7 @@ #include <svx/svdview.hxx> #include <sot/factory.hxx> #include <svl/itemiter.hxx> -#ifndef _SOUND_HXX //autogen #include <vcl/sound.hxx> -#endif #include <tools/bigint.hxx> #include <sot/storage.hxx> #include <svtools/insdlg.hxx> @@ -60,28 +59,21 @@ #include <vcl/graph.hxx> #include <sfx2/printer.hxx> #include <unotools/charclass.hxx> - #include <comphelper/storagehelper.hxx> #include <svx/svxdlg.hxx> #include <svx/extrusionbar.hxx> #include <svx/fontworkbar.hxx> +#include <frmfmt.hxx> #include <fmtftn.hxx> #include <fmtpdsc.hxx> -#ifndef _WDOCSH_HXX #include <wdocsh.hxx> -#endif -#ifndef _BASESH_HXX #include <basesh.hxx> -#endif #include <swmodule.hxx> #include <wrtsh.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <uitool.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif +#include <cfgitems.hxx> #include <pagedesc.hxx> #include <frmmgr.hxx> #include <shellio.hxx> @@ -89,9 +81,7 @@ #include <swundo.hxx> // fuer Undo-Ids #include <swcli.hxx> #include <poolfmt.hxx> -#ifndef _WVIEW_HXX #include <wview.hxx> -#endif #include <edtwin.hxx> #include <fmtcol.hxx> #include <swtable.hxx> @@ -100,15 +90,12 @@ #include <swdtflvr.hxx> #include <crsskip.hxx> #include <doc.hxx> -#ifndef _WRTSH_HRC #include <wrtsh.hrc> -#endif #include <SwStyleNameMapper.hxx> #include <sfx2/request.hxx> #include <paratr.hxx> #include <ndtxt.hxx> #include <editeng/acorrcfg.hxx> -//#include <svx/acorrcfg.hxx> #include <IMark.hxx> // -> #111827# @@ -123,6 +110,7 @@ #include <editeng/acorrcfg.hxx> #include "PostItMgr.hxx" +#include <sfx2/msgpool.hxx> using namespace sw::mark; using namespace com::sun::star; @@ -442,16 +430,6 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName pReq->AppendItem(SfxStringItem(FN_PARAM_2, pURL->GetMainURL(INetURLObject::NO_DECODE))); pReq->AppendItem(SfxStringItem(FN_PARAM_3 , aDlg.GetCommands())); } */ - case SID_INSERT_APPLET: - /* - if(pReq) - { - SvAppletObjectRef xApplet ( xIPObj ); - if(xApplet.Is()) - pReq->AppendItem(SfxStringItem(FN_PARAM_1 , xApplet->GetCodeBase())); - pReq->AppendItem(SfxStringItem(FN_PARAM_2 , aDlg.GetClass())); - pReq->AppendItem(SfxStringItem(FN_PARAM_3 , aDlg.GetCommands())); - }*/ case SID_INSERT_FLOATINGFRAME: /* if(pReq && xFloatingFrame.Is()) @@ -466,9 +444,13 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName pReq->AppendItem(SfxBoolItem(FN_PARAM_5, pDescriptor->HasFrameBorder())); }*/ { + SfxSlotPool* pSlotPool = SW_MOD()->GetSlotPool(); + const SfxSlot* pSlot = pSlotPool->GetSlot(nSlotId); + rtl::OString aCmd(".uno:"); + aCmd += pSlot->GetUnoName(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); SfxAbstractInsertObjectDialog* pDlg = - pFact->CreateInsertObjectDialog( GetWin(), nSlotId, xStor, &aServerList ); + pFact->CreateInsertObjectDialog( GetWin(), rtl::OUString( aCmd, aCmd.getLength(), RTL_TEXTENCODING_UTF8 ), xStor, &aServerList ); if ( pDlg ) { pDlg->Execute(); @@ -614,6 +596,11 @@ BOOL SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyFrmFm aFrmMgr.SetSize( aSz ); SwFlyFrmFmt *pFmt = SwFEShell::InsertObject( xRef, &aFrmMgr.GetAttrSet() ); + // --> #i972# + if ( bStarMath && pDoc->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) ) + AlignFormulaToBaseline( xRef.GetObject() ); + // <-- + if (pFlyFrmFmt) *pFlyFrmFmt = pFmt; @@ -774,6 +761,8 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj, if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc) || bLinkingChart // TODO/LATER: ResizeOnPrinterChange //|| SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & xObj->GetMiscStatus() + || nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE // non-resizable objects need to be + // set the size back by this method ) { pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj ); @@ -884,6 +873,17 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj, if ( bUseObjectSize ) { + // --> this moves non-resizable object so that when adding borders the baseline remains the same + const SwFlyFrmFmt *pFlyFrmFmt = dynamic_cast< const SwFlyFrmFmt * >( GetFlyFrmFmt() ); + ASSERT( pFlyFrmFmt, "Could not find fly frame." ); + if ( pFlyFrmFmt ) + { + const Point &rPoint = pFlyFrmFmt->GetLastFlyFrmPrtRectPos(); + SwRect aRect( pFlyPrtRect ? *pFlyPrtRect + : GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() )); + aArea += rPoint - aRect.Pos(); // adjust area by diff of printing area position in order to keep baseline alignment correct. + } + // <-- aArea.Width ( _aVisArea.Width() ); aArea.Height( _aVisArea.Height() ); RequestObjectResize( aArea, xObj.GetObject() ); @@ -1869,3 +1869,4 @@ String SwWrtShell::GetSelDescr() const return aResult; } + diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx index ac874a9791..1874426528 100644 --- a/sw/source/ui/wrtsh/wrtsh2.cxx +++ b/sw/source/ui/wrtsh/wrtsh2.cxx @@ -239,15 +239,8 @@ BOOL SwWrtShell::UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet) return bResult; } -BOOL SwWrtShell::UpdateField( sw::mark::IFieldmark &fieldBM ) -{ - return SwEditShell::UpdateField(fieldBM); -} - - - - // ein Klick aus das angegebene Feld. Der Cursor steht auf diesem. - // Fuehre die vor definierten Aktionen aus. +// handler for click on the field given as parameter. +// the cursor is positioned on the field. void SwWrtShell::ClickToField( const SwField& rFld ) |