[Libreoffice-commits] core.git: sw/source
Oliver-Rainer Wittmann
orw at apache.org
Wed Jun 26 12:37:37 PDT 2013
sw/source/core/text/txttab.cxx | 39 +++++++++++++++++----------------------
sw/source/filter/ww8/ww8par.cxx | 35 +++++++++++++++++++++--------------
sw/source/filter/ww8/ww8par3.cxx | 14 +++++++++-----
3 files changed, 47 insertions(+), 41 deletions(-)
New commits:
commit 7a22c4c51980691146cff9c8c72a8a215fef0848
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date: Wed Aug 15 09:55:58 2012 +0000
Resolves: #i120582# consider the case that a right indent is set...
at the paragraph
- some minor reformatting and cleanup of older comments
(cherry picked from commit e4578fcc2408a530d373653b01c0a88ef46ea26f)
Conflicts:
sw/source/core/text/txttab.cxx
sw/source/filter/ww8/ww8par.cxx
Change-Id: I345a20c78f26be60de3eb01ac6f5303de46c2fc1
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index f4f3d95..363ffde 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -74,8 +74,6 @@ sal_uInt16 SwLineInfo::NumberOfTabStops() const
*************************************************************************/
SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto ) const
{
- SwTabPortion *pTabPor = 0;
-
sal_Unicode cFill = 0;
sal_Unicode cDec = 0;
SvxTabAdjust eAdj;
@@ -137,7 +135,7 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
nMyRight = aRightTop.Y();
}
- SwTwips nNextPos;
+ SwTwips nNextPos = 0;
// #i24363# tab stops relative to indent
// nSearchPos: The current position relative to the tabs origin.
@@ -152,9 +150,8 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
// Note: If there are no user defined tab stops, there is always a
// default tab stop.
//
- const SvxTabStop* pTabStop =
- aLineInf.GetTabStop( nSearchPos, nMyRight );
- if( pTabStop )
+ const SvxTabStop* pTabStop = aLineInf.GetTabStop( nSearchPos, nMyRight );
+ if ( pTabStop )
{
cFill = ' ' != pTabStop->GetFill() ? pTabStop->GetFill() : 0;
cDec = pTabStop->GetDecimal();
@@ -183,12 +180,14 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
}
SwTwips nCount = nSearchPos;
- //Minimum tab stop width is 1
+ // Minimum tab stop width is 1
if (nDefTabDist <= 0)
nDefTabDist = 1;
nCount /= nDefTabDist;
- nNextPos = nCount < 0 || (!nCount && nSearchPos <= 0)? nCount * nDefTabDist :( nCount + 1 ) * nDefTabDist ;
+ nNextPos = ( nCount < 0 || ( !nCount && nSearchPos <= 0 ) )
+ ? ( nCount * nDefTabDist )
+ : ( ( nCount + 1 ) * nDefTabDist );
// --> FME 2004-09-21 #117919 Minimum tab stop width is 1 or 51 twips:
const SwTwips nMinimumTabWidth = pFrm->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT) ? 0 : 50;
if( ( bRTL && nTabLeft - nNextPos >= nCurrentAbsPos - nMinimumTabWidth ) ||
@@ -271,6 +270,7 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
nNewTabPos = KSHORT(nNextPos);
}
+ SwTabPortion *pTabPor = 0;
if ( bAuto )
{
if ( SVX_TAB_ADJUST_DECIMAL == eAdj &&
@@ -282,36 +282,31 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
{
switch( eAdj )
{
- case SVX_TAB_ADJUST_RIGHT :
- {
+ case SVX_TAB_ADJUST_RIGHT :
+ {
pTabPor = new SwTabRightPortion( nNewTabPos, cFill );
break;
}
- case SVX_TAB_ADJUST_CENTER :
+ case SVX_TAB_ADJUST_CENTER :
{
- pTabPor = new SwTabCenterPortion( nNewTabPos, cFill );
+ pTabPor = new SwTabCenterPortion( nNewTabPos, cFill );
break;
}
- case SVX_TAB_ADJUST_DECIMAL :
+ case SVX_TAB_ADJUST_DECIMAL :
{
- pTabPor = new SwTabDecimalPortion( nNewTabPos, cDec, cFill );
+ pTabPor = new SwTabDecimalPortion( nNewTabPos, cDec, cFill );
break;
}
- default:
+ default:
{
- OSL_ENSURE( SVX_TAB_ADJUST_LEFT == eAdj || SVX_TAB_ADJUST_DEFAULT == eAdj,
- "+SwTxtFormatter::NewTabPortion: unknown adjustment" );
+ OSL_ENSURE( SVX_TAB_ADJUST_LEFT == eAdj || SVX_TAB_ADJUST_DEFAULT == eAdj,
+ "+SwTxtFormatter::NewTabPortion: unknown adjustment" );
pTabPor = new SwTabLeftPortion( nNewTabPos, cFill, bAutoTabStop );
break;
}
}
}
- // Show existence of tabs "..." is not necessary anymore
- // pCurr->SetTabulation();
- // We calculate the data as a precaution
- // pTabPor->Height( pLast->Height() );
- // pTabPor->SetAscent( pLast->GetAscent() );
return pTabPor;
}
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 7e98b00..765b0f3 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -466,7 +466,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
SfxItemSet aSet( pSdrModel->GetItemPool() );
//Originally anything that as a mso_sptTextBox was created as a
- //textbox, this was changed for #88277# to be created as a simple
+ //textbox, this was changed to be created as a simple
//rect to keep impress happy. For the rest of us we'd like to turn
//it back into a textbox again.
bool bIsSimpleDrawingTextBox = (pImpRec->eShapeType == mso_sptTextBox);
@@ -1001,6 +1001,17 @@ void SyncIndentWithList( SvxLRSpaceItem &rLR,
{
rLR.SetTxtLeft( rFmt.GetIndentAt() );
}
+ else if (!bFirstLineOfstSet && !bLeftIndentSet )
+ {
+ if ( rFmt.GetFirstLineIndent() != 0 )
+ {
+ rLR.SetTxtFirstLineOfst( rFmt.GetFirstLineIndent() );
+ }
+ if ( rFmt.GetIndentAt() != 0 )
+ {
+ rLR.SetTxtLeft( rFmt.GetIndentAt() );
+ }
+ }
}
}
@@ -1074,14 +1085,12 @@ void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
continue;
SwCntntNode* pNd = (SwCntntNode*)pNode;
- SvxLRSpaceItem aOldLR = (const SvxLRSpaceItem&)
- pNd->GetAttr(RES_LR_SPACE);
+ SvxLRSpaceItem aOldLR = (const SvxLRSpaceItem&)pNd->GetAttr(RES_LR_SPACE);
SwTxtNode *pTxtNode = (SwTxtNode*)pNode;
const SwNumFmt *pNum = 0;
- pNum = GetNumFmtFromStack(*aRegion.GetPoint(),
- *pTxtNode);
+ pNum = GetNumFmtFromStack( *aRegion.GetPoint(), *pTxtNode );
if (!pNum)
{
pNum = GetNumFmtFromTxtNode(*pTxtNode);
@@ -1261,7 +1270,6 @@ void SwWW8FltRefStack::SetAttrInDoc(const SwPosition& rTmpPos,
SwFmtFld& rFmtFld = *(SwFmtFld*)rEntry.pAttr;
SwField* pFld = rFmtFld.GetFld();
- // <NOT> got lost from revision 1.128 to 1.129
if (!RefToVar(pFld, rEntry))
{
sal_uInt16 nBkmNo;
@@ -1496,7 +1504,7 @@ void SwWW8ImplReader::ImportDop()
// COMPATIBILITY FLAGS START
//
- // i#78951, remember the unknown compatability options
+ // #i78951# - remember the unknown compatability options
// so as to export them out
rDoc.Setn32DummyCompatabilityOptions1( pWDop->GetCompatabilityOptions());
rDoc.Setn32DummyCompatabilityOptions2( pWDop->GetCompatabilityOptions2());
@@ -3072,7 +3080,7 @@ bool SwWW8ImplReader::HandlePageBreakChar()
*/
//xushanchuan add for issue106569
if (!bWasParaEnd && IsTemp)
- //xushanchuan end
+ //xushanchuan end
{
bParaEndAdded = true;
if (0 >= pPaM->GetPoint()->nContent.GetIndex())
@@ -3208,7 +3216,7 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs)
else if (bSpec)
pResult = ImportGraf();
- //#102160# If we have a bad 0x1 insert a space instead.
+ // If we have a bad 0x1 insert a space instead.
if (!pResult)
{
cInsert = ' ';
@@ -5309,7 +5317,7 @@ public:
void SwWW8ImplReader::SetOutLineStyles()
{
/*
- #i3674# & #101291# Load new document and insert document cases.
+ #i3674# - Load new document and insert document cases.
*/
SwNumRule aOutlineRule(*rDoc.GetOutlineNumRule());
// #i53044,i53213#
@@ -5336,7 +5344,7 @@ void SwWW8ImplReader::SetOutLineStyles()
for ( sw::ParaStyles::reverse_iterator aIter = aOutLined.rbegin(); aIter < aEnd; ++aIter)
{
if ((*aIter)->IsAssignedToListLevelOfOutlineStyle())
- nFlagsStyleOutlLevel |= 1 << (*aIter)->GetAssignedOutlineStyleLevel();//<-end,zhaojianwei
+ nFlagsStyleOutlLevel |= 1 << (*aIter)->GetAssignedOutlineStyleLevel();
else
break;
}
@@ -5398,7 +5406,7 @@ void SwWW8ImplReader::SetOutLineStyles()
for ( sw::ParaStyles::reverse_iterator aIter = aOutLined.rbegin(); aIter < aEnd; ++aIter)
{
if((*aIter)->IsAssignedToListLevelOfOutlineStyle())
- (*aIter)->DeleteAssignmentToListLevelOfOutlineStyle(); //<-end
+ (*aIter)->DeleteAssignmentToListLevelOfOutlineStyle();
else
break;
@@ -5868,8 +5876,7 @@ bool SwWW8ImplReader::InEqualOrHigherApo(int nLvl) const
{
if (nLvl)
--nLvl;
- // #i60827#
- // check size of <maApos> to assure that <maApos.begin() + nLvl> can be performed.
+ // #i60827# - check size of <maApos> to assure that <maApos.begin() + nLvl> can be performed.
if ( sal::static_int_cast< sal_Int32>(nLvl) >= sal::static_int_cast< sal_Int32>(maApos.size()) )
{
return false;
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 13d0646..6f2375f 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -440,11 +440,15 @@ struct WW8LFOInfo // unsortiert, d.h. Reihenfolge genau wie im WW8 Stream
};
WW8LFOInfo::WW8LFOInfo(const WW8LFO& rLFO)
- : maParaSprms(WW8ListManager::nMaxLevel),
- maOverrides(WW8ListManager::nMaxLevel), pNumRule(rLFO.pNumRule),
- nIdLst(rLFO.nIdLst), nLfoLvl(rLFO.nLfoLvl),
- bOverride(rLFO.nLfoLvl ? true : false), bSimpleList(rLFO.bSimpleList),
- bUsedInDoc(0), bLSTbUIDSet(0)
+ : maParaSprms(WW8ListManager::nMaxLevel)
+ , maOverrides(WW8ListManager::nMaxLevel)
+ , pNumRule(rLFO.pNumRule)
+ , nIdLst(rLFO.nIdLst)
+ , nLfoLvl(rLFO.nLfoLvl)
+ , bOverride(rLFO.nLfoLvl ? true : false)
+ , bSimpleList(rLFO.bSimpleList)
+ , bUsedInDoc(0)
+ , bLSTbUIDSet(0)
{
}
More information about the Libreoffice-commits
mailing list