summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLei De Bin <leidb@apache.org>2012-09-10 04:45:43 +0000
committerXisco Fauli <anistenis@gmail.com>2013-05-19 14:10:18 +0200
commitb4d1fd3cca027ceecc1230e35c15b5363a591906 (patch)
tree5e9d9878e962e4d3a3c3ab0a644bdfe0b0c60b21 /sw
parent7bcebc31ed3d6693d0d747bebab4b82bc7c2062c (diff)
Related: #i119549# fix Position of drawing obj incorrect
* when opening .doc in AOO, if the text direction of the whole document is vertical, the pos of the drawing obj will be wrong. Reported by: Lou Qing le Patch by: Chen Zuo Jun Review by: Lei De Bin (cherry picked from commit 5c413ad6d8c2b2e16c19ff007e5315b383b73eb5) Conflicts: sw/source/filter/ww8/ww8graf.cxx Change-Id: I8cfa32974662f89406e1688be0b3dec22e9b7045
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx24
1 files changed, 16 insertions, 8 deletions
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 3aebdf56ba85..3004bbb28e97 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -2118,6 +2118,7 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
OSL_ENSURE(pRecord || pFSPA, "give me something! to work with for anchoring");
if (!pRecord && !pFSPA)
return FLY_AT_PAGE;
+ sal_Bool bCurSectionVertical = maSectionManager.CurrentSectionIsVertical();
SvxMSDffImportRec aRecordFromFSPA;
if (!pRecord)
@@ -2159,7 +2160,8 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
// is a hint that these values aren't set by the escher import - see
// method <SwMSDffManager::ProcessObj(..)>. Then, check if for each
// values, if it differs from the one in the FSPA.
- if ( *(pRecord->pXRelTo) == 2 && *(pRecord->pYRelTo) == 2 )
+
+ if ( *(pRecord->pXRelTo) == 2 && *(pRecord->pYRelTo) == 2 && !bCurSectionVertical)
{
// if <nYRelTo> differs from <FSPA.nby> overwrite <nYRelTo>
if ( pFSPA->nby != *(pRecord->pYRelTo) )
@@ -2289,11 +2291,6 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
eHoriRel = text::RelOrientation::PAGE_PRINT_AREA;
}
- SwFmtHoriOrient aHoriOri(MakeSafePositioningValue(pFSPA->nXaLeft),
- eHoriOri, eHoriRel);
- if( 4 <= nXAlign )
- aHoriOri.SetPosToggle(true);
- rFlySet.Put( aHoriOri );
//Writer honours this wrap distance when aligned as "left" or "right",
//Word doesn't. Writer doesn't honour it when its "from left".
@@ -2303,7 +2300,10 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
pRecord->nDxWrapDistRight=0;
sal_Int16 eVertRel;
+
eVertRel = aVertRelOriTab[ nYRelTo ]; // #i18732#
+ if ( bCurSectionVertical && nYRelTo == 2 )
+ eVertRel = text::RelOrientation::PAGE_PRINT_AREA;
// #i22673# - fill <eVertOri> in dependence of <eVertRel>
sal_Int16 eVertOri;
if ( eVertRel == text::RelOrientation::TEXT_LINE )
@@ -2322,8 +2322,16 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
if ((eVertRel == text::RelOrientation::TEXT_LINE) && (eVertOri == text::VertOrientation::NONE))
nYPos = -nYPos;
- rFlySet.Put(SwFmtVertOrient(MakeSafePositioningValue(nYPos),
- eVertOri, eVertRel));
+ SwFmtHoriOrient aHoriOri(MakeSafePositioningValue( bCurSectionVertical ? nYPos : pFSPA->nXaLeft ),
+ bCurSectionVertical ? eVertOri : eHoriOri,
+ bCurSectionVertical ? eVertRel : eHoriRel);
+ if( 4 <= nXAlign )
+ aHoriOri.SetPosToggle(true);
+ rFlySet.Put( aHoriOri );
+
+ rFlySet.Put(SwFmtVertOrient(MakeSafePositioningValue( !bCurSectionVertical ? nYPos : -pFSPA->nXaRight ),
+ !bCurSectionVertical ? eVertOri : eHoriOri,
+ !bCurSectionVertical ? eVertRel : eHoriRel ));
}
return eAnchor;