diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-04-07 09:56:43 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-04-07 10:24:24 +0100 |
commit | b5ce50d1d07394f6b59b028373120369c83d5d66 (patch) | |
tree | 9fb9a0c311a3dd290c3115f7e3fa32566d28e248 /sw | |
parent | e3a899907bbf76469f074e35bbe82998a05bb2e8 (diff) |
negative after-text indents ignored by msword for apos
Change-Id: I33e178f23bc4b1372c4c329954b301ae68902154
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/ww8graf.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 26 |
3 files changed, 31 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 456ce2535c83..3a11d1e3b325 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -2905,7 +2905,10 @@ SwFlyFrmFmt* SwWW8ImplReader::ConvertDrawTextToFly(SdrObject* &rpObject, MoveOutsideFly(pRetFrmFmt, aSave.GetStartPos(),!bJoined); aSave.Restore( this ); + + StripNegativeAfterIndent(pRetFrmFmt); } + } return pRetFrmFmt; } diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index a7fdff54e2eb..0a34059fe03b 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1488,6 +1488,7 @@ private: bool IsDropCap(); bool IsListOrDropcap() { return (!pAktItemSet || bDropCap); }; + //Apo == Absolutely Positioned Object, MSWord's old-style frames WW8FlyPara *ConstructApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos); bool StartApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos, SvxULSpaceItem* pULSpaceItem = 0); @@ -1495,6 +1496,7 @@ private: bool TestSameApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos); ApoTestResults TestApo(int nCellLevel, bool bTableRowEnd, const WW8_TablePos *pTabPos); + void StripNegativeAfterIndent(SwFrmFmt *pFlyFmt) const; void EndSpecial(); bool ProcessSpecial(bool &rbReSync, WW8_CP nStartCp); diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 418e130b6c65..b63e639a3a91 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -2430,6 +2430,32 @@ bool SwWW8ImplReader::JoinNode(SwPaM &rPam, bool bStealAttr) return bRet; } +//In auto-width word frames negative after-indent values are ignored +void SwWW8ImplReader::StripNegativeAfterIndent(SwFrmFmt *pFlyFmt) const +{ + const SwNodeIndex* pSttNd = pFlyFmt->GetCntnt().GetCntntIdx(); + if (!pSttNd) + return; + + SwNodeIndex aIdx(*pSttNd, 1); + SwNodeIndex aEnd(*pSttNd->GetNode().EndOfSectionNode()); + while (aIdx < aEnd) + { + SwTxtNode *pNd = aIdx.GetNode().GetTxtNode(); + if (pNd) + { + const SvxLRSpaceItem& rLR = ItemGet<SvxLRSpaceItem>(*pNd, RES_LR_SPACE); + if (rLR.GetRight() < 0) + { + SvxLRSpaceItem aLR(rLR); + aLR.SetRight(0); + pNd->SetAttr(aLR); + } + } + ++aIdx; + } +} + void SwWW8ImplReader::StopApo() { OSL_ENSURE(pWFlyPara, "no pWFlyPara to close"); |