Kaydet (Commit) c146925b authored tarafından Oliver Bolte's avatar Oliver Bolte

INTEGRATION: CWS limerickfilterteam08 (1.24.36); FILE MERGED

2003/07/17 10:34:32 cmc 1.24.36.5: #i4320# Only make title pages out of first/follow page styles if it is a plausable word title page, e.g. has same number of columns. Otherwise we'll pray that the user uses a manual page break to move to the next page descriptor in which case we'll be able to resync and noone will be the wiser
2003/07/08 16:06:21 cmc 1.24.36.4: #i12445# for ww7- export split text into ranges which can be independantly exported as different 8bit formats to retain non 1252 characters on export
2003/07/01 12:14:36 cmc 1.24.36.3: Clean GetAttr casting to make it readable
2003/06/30 12:24:41 cmc 1.24.36.2: RESYNC: (1.24-1.25); FILE MERGED
2003/06/24 16:24:56 cmc 1.24.36.1: #108854# rework column break export to check current no of columns and if column break before tries to clobber opening section mark
üst 520010c2
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: wrtw8sty.cxx,v $ * $RCSfile: wrtw8sty.cxx,v $
* *
* $Revision: 1.25 $ * $Revision: 1.26 $
* *
* last change: $Author: vg $ $Date: 2003-06-20 09:37:52 $ * last change: $Author: obo $ $Date: 2003-09-01 12:40:59 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -77,6 +77,9 @@ ...@@ -77,6 +77,9 @@
#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ #ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl> #include <com/sun/star/i18n/ScriptType.hdl>
#endif #endif
#ifndef _RTL_TENCINFO_H
#include <rtl/tencinfo.h>
#endif
#ifndef _HINTIDS_HXX #ifndef _HINTIDS_HXX
#include <hintids.hxx> #include <hintids.hxx>
...@@ -170,15 +173,23 @@ ...@@ -170,15 +173,23 @@
#ifndef _FTNIDX_HXX #ifndef _FTNIDX_HXX
#include <ftnidx.hxx> #include <ftnidx.hxx>
#endif #endif
#ifndef _FMTCLDS_HXX
#include <fmtclds.hxx>
#endif
#ifndef SW_LINEINFO_HXX #ifndef SW_LINEINFO_HXX
#include <lineinfo.hxx> #include <lineinfo.hxx>
#endif #endif
#ifndef SW_WRITERHELPER
#include "writerhelper.hxx"
#endif
#ifndef _WW8PAR_HXX #ifndef _WW8PAR_HXX
#include <ww8par.hxx> #include "ww8par.hxx"
#endif #endif
using namespace sw::util;
struct WW8_SED struct WW8_SED
{ {
SVBT16 aBits1; // orientation change + internal, Default: 6 SVBT16 aBits1; // orientation change + internal, Default: 6
...@@ -735,7 +746,7 @@ wwFont::wwFont(const String &rFamilyName, FontPitch ePitch, FontFamily eFamily, ...@@ -735,7 +746,7 @@ wwFont::wwFont(const String &rFamilyName, FontPitch ePitch, FontFamily eFamily,
if (RTL_TEXTENCODING_SYMBOL == eChrSet) if (RTL_TEXTENCODING_SYMBOL == eChrSet)
maWW8_FFN[4] = 2; maWW8_FFN[4] = 2;
else else
maWW8_FFN[4] = 0; maWW8_FFN[4] = rtl_getBestWindowsCharsetFromTextEncoding(eChrSet);
if (mbAlt) if (mbAlt)
maWW8_FFN[5] = msFamilyNm.Len()+1; maWW8_FFN[5] = msFamilyNm.Len()+1;
...@@ -924,6 +935,36 @@ WW8_WrPlcSepx::~WW8_WrPlcSepx() ...@@ -924,6 +935,36 @@ WW8_WrPlcSepx::~WW8_WrPlcSepx()
delete pTxtPos; delete pTxtPos;
} }
sal_uInt16 WW8_WrPlcSepx::CurrentNoColumns(const SwDoc &rDoc) const
{
ASSERT(aSects.Count(), "no segement inserted yet");
if (!aSects.Count())
return 1;
WW8_SepInfo& rInfo = aSects[aSects.Count() - 1];
const SwPageDesc* pPd = rInfo.pPageDesc;
if (!pPd)
pPd = &rDoc.GetPageDesc(0);
if (!pPd)
{
ASSERT(pPd, "totally impossible");
return 1;
}
const SfxItemSet &rSet = pPd->GetMaster().GetAttrSet();
SfxItemSet aSet(*rSet.GetPool(), RES_COL, RES_COL);
aSet.SetParent(&rSet);
//0xffffffff, what the hell is going on with that!, fixme most terribly
if (rInfo.pSectionFmt && (SwSectionFmt*)0xFFFFFFFF != rInfo.pSectionFmt)
aSet.Put(rInfo.pSectionFmt->GetAttr(RES_COL));
const SwFmtCol& rCol = (const SwFmtCol&)aSet.Get(RES_COL);
const SwColumns& rColumns = rCol.GetColumns();
return rColumns.Count();
}
void WW8_WrPlcSepx::AppendSep( WW8_CP nStartCp, void WW8_WrPlcSepx::AppendSep( WW8_CP nStartCp,
const SwPageDesc* pPd, const SwPageDesc* pPd,
const SwSectionFmt* pSectionFmt, const SwSectionFmt* pSectionFmt,
...@@ -1263,15 +1304,17 @@ bool WW8_WrPlcSepx::WriteKFTxt(SwWW8Writer& rWrt) ...@@ -1263,15 +1304,17 @@ bool WW8_WrPlcSepx::WriteKFTxt(SwWW8Writer& rWrt)
// am Nachkommen NUR die Spaltigkeit gemaess Sect-Attr. // am Nachkommen NUR die Spaltigkeit gemaess Sect-Attr.
// umsetzen // umsetzen
aSet.Put( rSepInfo.pSectionFmt->GetAttr( RES_COL ) ); aSet.Put(rSepInfo.pSectionFmt->GetAttr(RES_COL));
const SvxLRSpaceItem &rSectionLR = const SvxLRSpaceItem &rSectionLR =
(const SvxLRSpaceItem&)(rSepInfo.pSectionFmt->GetAttr(RES_LR_SPACE)); ItemGet<SvxLRSpaceItem>(*(rSepInfo.pSectionFmt),
RES_LR_SPACE);
const SvxLRSpaceItem &rPageLR = const SvxLRSpaceItem &rPageLR =
(const SvxLRSpaceItem&)(pPdFmt->GetAttr(RES_LR_SPACE)); ItemGet<SvxLRSpaceItem>(*pPdFmt,RES_LR_SPACE);
SvxLRSpaceItem aResultLR(rPageLR.GetLeft() + rSectionLR.GetLeft(), SvxLRSpaceItem aResultLR(rPageLR.GetLeft() +
rPageLR.GetRight() + rSectionLR.GetRight()); rSectionLR.GetLeft(), rPageLR.GetRight() +
rSectionLR.GetRight());
aSet.Put(aResultLR); aSet.Put(aResultLR);
...@@ -1321,20 +1364,54 @@ bool WW8_WrPlcSepx::WriteKFTxt(SwWW8Writer& rWrt) ...@@ -1321,20 +1364,54 @@ bool WW8_WrPlcSepx::WriteKFTxt(SwWW8Writer& rWrt)
) )
) )
{ {
if( rSepInfo.pPDNd ) /*
pPdFirstPgFmt = pPd->GetPageFmtOfNode( *rSepInfo.pPDNd ); For #i4320# I am going to try this, nothing will ever be
else perfect with the mismatch from title page of winword sections
pPdFirstPgFmt = &pPd->GetMaster(); vs our system. But I am relying on the natural inclination of
users to treat title pages as special and to generally always
have a manual page break inside them that we can convert to a
section break in the test in our page break exporter to see if
the page break will cause a new page descriptor to follow
*/
bool bPlausableTitlePage = true;
/*
So if this is not plausably a title page of the following page
style don't try to make it into one and rely on the users
likely manual page break to fix everything for us.
Additional tests may be necessary in the future. A balance
will have to be found.
*/
const SwPageDesc *pFollow = pPd->GetFollow();
const SwFrmFmt& rFollowFmt = pFollow->GetMaster();
const SwFmtCol& rFirstCols = pPdFmt->GetCol();
const SwFmtCol& rFollowCols = rFollowFmt.GetCol();
const SwColumns& rFirstColumns = rFirstCols.GetColumns();
const SwColumns& rFollowColumns = rFollowCols.GetColumns();
if (rFirstColumns.Count() != rFollowColumns.Count())
bPlausableTitlePage = false;
if (bPlausableTitlePage)
{
if (rSepInfo.pPDNd)
pPdFirstPgFmt = pPd->GetPageFmtOfNode(*rSepInfo.pPDNd);
else
pPdFirstPgFmt = &pPd->GetMaster();
rWrt.pAktPageDesc = pPd = pPd->GetFollow(); rWrt.pAktPageDesc = pPd = pFollow;
pPdFmt = &pPd->GetMaster(); pPdFmt = &rFollowFmt;
// sprmSFTitlePage // sprmSFTitlePage
if( rWrt.bWrtWW8 ) if( rWrt.bWrtWW8 )
SwWW8Writer::InsUInt16( *pO, 0x300A ); SwWW8Writer::InsUInt16( *pO, 0x300A );
else else
pO->Insert( 143, pO->Count() ); pO->Insert( 143, pO->Count() );
pO->Insert( 1, pO->Count() ); pO->Insert( 1, pO->Count() );
}
} }
const SfxItemSet* pOldI = rWrt.pISet; const SfxItemSet* pOldI = rWrt.pISet;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment