Bugzilla – Attachment 126761 Details for
Bug 84678
FILEOPEN: .DOCX textbox margins incorrectly set in 4.4.x
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
debug84678_patch.diff: to help a developer get started
debug84678_patch.diff (text/plain), 14.15 KB, created by
Justin L
on 2016-08-11 15:47:37 UTC
(
hide
)
Description:
debug84678_patch.diff: to help a developer get started
Filename:
MIME Type:
Creator:
Justin L
Created:
2016-08-11 15:47:37 UTC
Size:
14.15 KB
patch
obsolete
>diff --git a/dictionaries b/dictionaries >index 3380b51..d8738db 160000 >--- a/dictionaries >+++ b/dictionaries >@@ -1 +1 @@ >-Subproject commit 3380b51b42480693d8b3ac97f08c6568a4f73201 >+Subproject commit d8738db715233dbd83bff56aa166ae0bdf0a8e18 >diff --git a/helpcontent2 b/helpcontent2 >index 034f593..78c7e1c 160000 >--- a/helpcontent2 >+++ b/helpcontent2 >@@ -1 +1 @@ >-Subproject commit 034f593c7a63283b361349b152e598ea2ec51b90 >+Subproject commit 78c7e1c24aacacfa69c8de3644b154e98d858f7e >diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx >index 0296a18..21b9640 100644 >--- a/sw/source/core/doc/textboxhelper.cxx >+++ b/sw/source/core/doc/textboxhelper.cxx >@@ -355,15 +355,19 @@ Rectangle SwTextBoxHelper::getTextRectangle(SwFrameFormat* pShape, bool bAbsolut > xLockable->setActionLocks(nLocks); > } > >+SAL_WARN("DBG","::getTextRectangle if not absolute["<<bAbsolute<<"] and customShape["<<pCustomShape<<"]"); > if (!bAbsolute && pCustomShape) > { > // Relative, so count the logic (reference) rectangle, see the EnhancedCustomShape2d ctor. > Point aPoint(pCustomShape->GetSnapRect().Center()); > Size aSize(pCustomShape->GetLogicRect().GetSize()); >+SAL_WARN("DBG"," eventually returning rect["<<aRet<<"] from reference size["<<aSize<<"] with center["<<aPoint<<"]"); > aPoint.X() -= aSize.Width() / 2; > aPoint.Y() -= aSize.Height() / 2; > Rectangle aLogicRect(aPoint, aSize); >+SAL_WARN("DBG"," logicRect["<<aLogicRect<<"] moves rect left["<<aLogicRect.Left()<<"] up["<<aLogicRect.Top()<<"]"); > aRet.Move(-1 * aLogicRect.Left(), -1 * aLogicRect.Top()); >+SAL_WARN("DBG"," now returning rect["<<aRet<<"]"); > } > > return aRet; >@@ -550,6 +554,7 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, sal_uInt16 nWID, sal_u > > if (!aPropertyName.isEmpty()) > { >+SAL_WARN("DBG","::syncProperty propertyName["<<aPropertyName<<"] val["<<aValue<<"] adjust X["<<bAdjustX<<"] Y["<<bAdjustY<<"] size["<<bAdjustSize<<"]"); > // Position/size should be the text position/size, not the shape one as-is. > if (bAdjustX || bAdjustY || bAdjustSize) > { >@@ -565,6 +570,7 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, sal_uInt16 nWID, sal_u > nValue += TWIPS_TO_MM(aRect.getX()); > else if (bAdjustY) > nValue += TWIPS_TO_MM(aRect.getY()); >+SAL_WARN("DBG"," ::syncProperty adjusting by["<<nValue<<"] rectX["<<TWIPS_TO_MM(aRect.getX())<<"] rectY["<<TWIPS_TO_MM(aRect.getY())<<"]"); > aValue <<= nValue; > } > } >@@ -634,8 +640,12 @@ void SwTextBoxHelper::syncFlyFrameAttr(SwFrameFormat& rShape, SfxItemSet& rSet) > > SfxItemIter aIter(rSet); > sal_uInt16 nWhich = aIter.GetCurItem()->Which(); >+ bool bAdjustedH = false; >+ bool bAdjustedV = false; >+ int DBGcounter=0; > do > { >+SAL_WARN("DBG","["<<++DBGcounter<<"]::syncFlyFrameAttr for current item nWhich["<<nWhich<<"]"); > switch (nWhich) > { > case RES_VERT_ORIENT: >@@ -644,6 +654,7 @@ void SwTextBoxHelper::syncFlyFrameAttr(SwFrameFormat& rShape, SfxItemSet& rSet) > SwFormatVertOrient aOrient(rOrient); > > Rectangle aRect = getTextRectangle(&rShape, /*bAbsolute=*/false); >+SAL_WARN("DBG"," ["<<DBGcounter<<"]gotTextRectangle. empty?["<<aRect.IsEmpty()<<"] adjustedv["<<bAdjustedV<<"]h["<<bAdjustedH<<"] OrientPosV["<<aOrient.GetPos()<<"] recty["<<aRect.getY()<<"]"); > if (!aRect.IsEmpty()) > aOrient.SetPos(aOrient.GetPos() + aRect.getY()); > >@@ -656,6 +667,7 @@ void SwTextBoxHelper::syncFlyFrameAttr(SwFrameFormat& rShape, SfxItemSet& rSet) > aSize.SetHeight(aRect.getHeight()); > aTextBoxSet.Put(aSize); > } >+ bAdjustedV = true; > } > break; > case RES_HORI_ORIENT: >@@ -664,10 +676,12 @@ void SwTextBoxHelper::syncFlyFrameAttr(SwFrameFormat& rShape, SfxItemSet& rSet) > SwFormatHoriOrient aOrient(rOrient); > > Rectangle aRect = getTextRectangle(&rShape, /*bAbsolute=*/false); >+SAL_WARN("DBG"," ["<<DBGcounter<<"]gotTextRectangle. empty?["<<aRect.IsEmpty()<<"] adjustedv["<<bAdjustedV<<"]h["<<bAdjustedH<<"] OrientPosH["<<aOrient.GetPos()<<"] rectx["<<aRect.getX()<<"]"); > if (!aRect.IsEmpty()) > aOrient.SetPos(aOrient.GetPos() + aRect.getX()); > > aTextBoxSet.Put(aOrient); >+ bAdjustedH = true; > } > break; > case RES_FRM_SIZE: >@@ -681,6 +695,7 @@ void SwTextBoxHelper::syncFlyFrameAttr(SwFrameFormat& rShape, SfxItemSet& rSet) > SwFormatFrameSize aSize(pFormat->GetFrameSize()); > > Rectangle aRect = getTextRectangle(&rShape, /*bAbsolute=*/false); >+SAL_WARN("DBG"," ["<<DBGcounter<<"]gotTextRectangle. empty?["<<aRect.IsEmpty()<<"] adjustedv["<<bAdjustedV<<"]h["<<bAdjustedH<<"] OrientPosh["<<aHoriOrient.GetPos()<<"]v["<<aVertOrient.GetPos()<<"] rectx["<<aRect.getX()<<"]y["<<aRect.getY()<<"]"); > if (!aRect.IsEmpty()) > { > aVertOrient.SetPos(aVertOrient.GetPos() + aRect.getY()); >@@ -693,6 +708,7 @@ void SwTextBoxHelper::syncFlyFrameAttr(SwFrameFormat& rShape, SfxItemSet& rSet) > aSize.SetHeight(aRect.getHeight()); > aTextBoxSet.Put(aSize); > } >+ bAdjustedV = bAdjustedH = true; > } > break; > default: >diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx >index 8082ad4..cbe9644 100644 >--- a/sw/source/core/unocore/unodraw.cxx >+++ b/sw/source/core/unocore/unodraw.cxx >@@ -1084,6 +1084,11 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a > SolarMutexGuard aGuard; > SwFrameFormat* pFormat = GetFrameFormat(); > const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap().getByName( rPropertyName ); >+if( rPropertyName == "LeftMargin" || rPropertyName == "RightMargin" || rPropertyName == "TopMargin" || rPropertyName == "BottomMargin" ) >+ SAL_WARN("DBG","::setPropertyValue setting margins ["<<rPropertyName<<"] value["<<aValue<<"]"); >+if( rPropertyName == "VertOrientPosition" || rPropertyName == "HoriOrientPosition" || rPropertyName == "HoriOrient" || rPropertyName == "VertOrient" ) >+ SAL_WARN("DBG","::setPropertyValue setting orientation ["<<rPropertyName<<"] value["<<aValue<<"]"); >+ > if(xShapeAgg.is()) > { > if(pEntry) >diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx b/writerfilter/source/dmapper/GraphicHelpers.cxx >index 3d410b2..32a7996 100644 >--- a/writerfilter/source/dmapper/GraphicHelpers.cxx >+++ b/writerfilter/source/dmapper/GraphicHelpers.cxx >@@ -84,6 +84,7 @@ void PositionHandler::lcl_attribute( Id aName, Value& rVal ) > if ( pVertRelValues[i] == sal_uInt32( nIntValue ) ) > m_nRelation = pVertRelations[i]; > } >+SAL_WARN("DBG","::lcl_attribute m_nRelation (vert) = ["<<m_nRelation<<"] 0margin/pageprint["<<text::RelOrientation::PAGE_PRINT_AREA<<"],page/pageFrame["<<text::RelOrientation::PAGE_FRAME<<"],para/frame["<<text::RelOrientation::FRAME<<"],text_line["<<text::RelOrientation::TEXT_LINE<<"]"); > } > break; > case NS_ooxml::LN_CT_PosH_relativeFrom: >@@ -110,6 +111,7 @@ void PositionHandler::lcl_attribute( Id aName, Value& rVal ) > if ( pHoriRelValues[i] == sal_uInt32( nIntValue ) ) > m_nRelation = pHoriRelations[i]; > } >+SAL_WARN("DBG","::lcl_attribute m_nRelation (hori) = ["<<m_nRelation<<"] margin/pageprint["<<text::RelOrientation::PAGE_PRINT_AREA<<"],page/pageFrame["<<text::RelOrientation::PAGE_FRAME<<"],column/frame["<<text::RelOrientation::FRAME<<"],char["<<text::RelOrientation::CHAR<<"]"); > } > break; > default: >@@ -163,6 +165,7 @@ void PositionHandler::lcl_sprm(Sprm& rSprm) > break; > } > } >+SAL_WARN("DBG","::lcl_sprm["<<nSprmId<<"] set position["<<m_nPosition<<"] or Orientation["<<m_nOrient<<"] rAlign["<<m_rAligns.first<<"]["<<m_rAligns.second<<"] L["<<text::HoriOrientation::LEFT<<"]/R["<<text::HoriOrientation::RIGHT<<"]/C["<<text::HoriOrientation::CENTER<<"]/In["<<text::HoriOrientation::INSIDE<<"]/Out["<<text::HoriOrientation::OUTSIDE<<"], T["<<text::VertOrientation::TOP<<"],B["<<text::VertOrientation::BOTTOM<<"],C["<<text::VertOrientation::CENTER<<"],N["<<text::VertOrientation::NONE<<"],N"); > } > > sal_Int16 PositionHandler::orientation() const >diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx >index c526c6d..ae1c428 100644 >--- a/writerfilter/source/dmapper/GraphicImport.cxx >+++ b/writerfilter/source/dmapper/GraphicImport.cxx >@@ -342,6 +342,7 @@ public: > > void applyMargins(const uno::Reference< beans::XPropertySet >& xGraphicObjectProperties) const > { >+SAL_WARN("DBG","setting textbox margins L["<<nLeftMargin<<"] R["<<nRightMargin<<"] T["<<nTopMargin<<"] B["<<nBottomMargin<<"]"); > xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_LEFT_MARGIN ), uno::makeAny(nLeftMargin)); > xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_RIGHT_MARGIN ), uno::makeAny(nRightMargin)); > xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_TOP_MARGIN ), uno::makeAny(nTopMargin)); >@@ -546,18 +547,22 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue) > break; > case NS_ooxml::LN_CT_EffectExtent_l: > m_pImpl->m_oEffectExtentLeft = nIntValue; >+SAL_WARN("DBG","::lcl_attribute nLeftMargin["<<m_pImpl->nLeftMargin<<"] adjusted here by +["<<oox::drawingml::convertEmuToHmm(nIntValue)<<"]"); > m_pImpl->nLeftMargin += oox::drawingml::convertEmuToHmm(nIntValue); > break; > case NS_ooxml::LN_CT_EffectExtent_t: > m_pImpl->m_oEffectExtentTop = nIntValue; >+SAL_WARN("DBG","::lcl_attribute nTopMargin["<<m_pImpl->nTopMargin<<"] adjusted here by +["<<oox::drawingml::convertEmuToHmm(nIntValue)<<"]"); > m_pImpl->nTopMargin += oox::drawingml::convertEmuToHmm(nIntValue); > break; > case NS_ooxml::LN_CT_EffectExtent_r: > m_pImpl->m_oEffectExtentRight = nIntValue; >+SAL_WARN("DBG","::lcl_attribute nRightMargin["<<m_pImpl->nRightMargin<<"] adjusted here by +["<<oox::drawingml::convertEmuToHmm(nIntValue)<<"]"); > m_pImpl->nRightMargin += oox::drawingml::convertEmuToHmm(nIntValue); > break; > case NS_ooxml::LN_CT_EffectExtent_b: > m_pImpl->m_oEffectExtentBottom = nIntValue; >+SAL_WARN("DBG","::lcl_attribute nBotMargin["<<m_pImpl->nBottomMargin<<"] adjusted here by +["<<oox::drawingml::convertEmuToHmm(nIntValue)<<"]"); > m_pImpl->nBottomMargin += oox::drawingml::convertEmuToHmm(nIntValue); > break; > case NS_ooxml::LN_CT_NonVisualDrawingProps_id:// 90650; >@@ -784,7 +789,9 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue) > if (SdrObject* pShape = GetSdrObjectFromXShape(m_xShape)) > nRotation = pShape->GetRotateAngle(); > } >+SAL_WARN("DBG","::lcl_attribute LN_shape BEFORE m_xShape->setSize size["<<aSize.Width<<"]["<<aSize.Height<<"]"); > m_xShape->setSize(aSize); >+SAL_WARN("DBG","::lcl_attribute LN_shape AFTER m_xShape->setSize size["<<aSize.Width<<"]["<<aSize.Height<<"]"); > if (bKeepRotation) > xShapeProps->setPropertyValue("RotateAngle", uno::makeAny(nRotation)); > >@@ -841,6 +848,8 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue) > m_pImpl->applyRelativePosition(xShapeProps, /*bRelativeOnly=*/true); > > xShapeProps->setPropertyValue("SurroundContour", uno::makeAny(m_pImpl->bContour)); >+SAL_WARN("DBG","IMPORTANT!! applyMargins affects only the frame (both left and right), not textbox"); >+//m_pImpl->nRightMargin=0; m_pImpl->nLeftMargin=0; m_pImpl->nTopMargin=0; m_pImpl->nBottomMargin=0; > m_pImpl->applyMargins(xShapeProps); > bool bOpaque = m_pImpl->bOpaque && !m_pImpl->rDomainMapper.IsInHeaderFooter(); > xShapeProps->setPropertyValue("Opaque", uno::makeAny(bOpaque)); >@@ -946,6 +955,7 @@ uno::Reference<text::XTextContent> GraphicImport::GetGraphicObject() > void GraphicImport::ProcessShapeOptions(Value& rValue) > { > sal_Int32 nIntValue = rValue.getInt(); >+SAL_WARN("DBG","::ProcessShapeOptions sets margins ["<<nIntValue<<"]/360 = ["<<nIntValue / 360<<"]"); > switch( m_pImpl->nShapeOptionType ) > { > case NS_ooxml::LN_CT_Anchor_distL: >@@ -1044,8 +1054,10 @@ void GraphicImport::lcl_sprm(Sprm& rSprm) > m_pImpl->nHoriRelation = pHandler->relation(); > m_pImpl->nHoriOrient = pHandler->orientation(); > m_pImpl->nLeftPosition = pHandler->position(); >+SAL_WARN("DBG","::lcl_sprm NotSimplePos -setting Hori relation["<<m_pImpl->nHoriRelation<<"]/orient["<<m_pImpl->nHoriOrient<<"] position["<<m_pImpl->nLeftPosition<<"]"); > if (m_pImpl->nHoriRelation == text::RelOrientation::PAGE_FRAME && m_pImpl->nHoriOrient == text::HoriOrientation::RIGHT) > { >+SAL_WARN("DBG","some kind of right alignment adjustment"); > // If the shape is relative from page and aligned to > // right, then set the relation to right and clear the > // orientation, that provides the same visual result as >@@ -1070,6 +1082,7 @@ void GraphicImport::lcl_sprm(Sprm& rSprm) > m_pImpl->nVertRelation = pHandler->relation(); > m_pImpl->nVertOrient = pHandler->orientation(); > m_pImpl->nTopPosition = pHandler->position(); >+SAL_WARN("DBG",":lcl_sprm NotSimplePos -setting Vert relation["<<m_pImpl->nVertRelation<<"]/orient["<<m_pImpl->nVertOrient<<"] position["<<m_pImpl->nTopPosition<<"]"); > } > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 84678
:
107341
|
107342
|
119178
|
120863
|
126525
| 126761 |
126771
|
126778