summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-02-13 10:05:35 +0000
committerOliver Bolte <obo@openoffice.org>2009-02-13 10:05:35 +0000
commit1524aa18b9ddf7a4181e3f278155c48655084452 (patch)
tree44a60ea6c3327cc5b13c62cace39ddde425d837a /sw
parent841d2d5a1cf491cd59a89cbe26ace1cfeb18d556 (diff)
CWS-TOOLING: integrate CWS sw31bf04
2009-01-21 14:24:10 +0100 od r266670 : #i59051# correction of metric change for PolyPolygonBezier needed 2009-01-21 09:35:44 +0100 od r266632 : #i96062# adjustment of fix after rebasing 2009-01-21 09:34:56 +0100 od r266631 : #i94152# adjustment of fix after rebasing 2009-01-20 16:43:12 +0100 od r266596 : CWS-TOOLING: rebase CWS sw31bf04 to trunk@266428 (milestone: DEV300:m39) 2009-01-20 11:52:22 +0100 od r266561 : #i94152 method <SwDoc::SetOutlineNumRule(..)> - assure that at outline list style registered text node have the correct list level set 2009-01-20 10:43:53 +0100 od r266556 : #i93399# methods <SwNumRule::SetIndent(..)> and <SwNumRule::ChangeIndent(..)> - adjust also the list tab position, if a list tab stop is applied 2009-01-16 16:26:56 +0100 od r266432 : #i59051# adjust Writer's UNO-API for drawing objects - correct conversion of "StartPosition" and "EndPosition" - conversion of "PolyPolygonBezier" 2009-01-16 16:20:49 +0100 od r266430 : #i59051# - adjust UNO-API of connector shape -- convert "PolyPolygonBezier" to correct metric -- convert "StartPosition" and "EndPosition" in set-method before applying anchor position - adjust UNO-API of measure shape -- convert "StartPosition" and "EndPosition" to correct metric 2009-01-16 15:01:21 +0100 od r266419 : #i95698# method <SwFrm::GetPrevSctLeaf(..)> - only columns as previous section leaves for tables inside sections, which are inside another table. 2009-01-14 14:34:58 +0100 od r266304 : #i96092# method <HandleResetAttrAtTxtNode::~HandleResetAttrAtTxtNode()> - set list level to outline level, if needed. 2009-01-13 17:09:43 +0100 od r266238 : #i98037# method <SwWW8ImplReader::IsObjectLayoutInTableCell(..)> - adjust evaluation of WW8 attributes 2009-01-13 11:49:48 +0100 od r266203 : #i94187# method <SwTxtFormatter::NewTabPortion(..)> - correct consideration of compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST 2009-01-13 11:48:45 +0100 od r266202 : #i94187# method <OutWW8_SwTxtNode(..)> - set list style directly at paragraph only in position and space mode LABEL_WIDTH_AND_POSITION 2009-01-12 12:22:58 +0100 od r266143 : #i70582# method <SwFlyAtCntFrm::SetAbsPos(..)> and local method <lcl_CalcDownDist(..)> - correct determination of anchor's frame top for object positioning.
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/unodraw.hxx30
-rw-r--r--sw/source/core/doc/docnum.cxx8
-rw-r--r--sw/source/core/doc/number.cxx19
-rw-r--r--sw/source/core/layout/flycnt.cxx68
-rw-r--r--sw/source/core/layout/sectfrm.cxx58
-rw-r--r--sw/source/core/text/txttab.cxx2
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx15
-rw-r--r--sw/source/core/unocore/unodraw.cxx173
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx20
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx8
10 files changed, 257 insertions, 144 deletions
diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index d0d405a99da4..0103e969e8be 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -34,6 +34,9 @@
#include <calbck.hxx>
#include <frmfmt.hxx>
#include <com/sun/star/text/XTextContent.hpp>
+// --> OD 2009-01-13 #i59051#
+#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
+// <--
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
@@ -221,36 +224,25 @@ class SwXShape : public SwXShapeBaseClass,
*/
void _AdjustPositionProperties( const ::com::sun::star::awt::Point _aPosition );
- /** method to convert start and end position of the drawing object to the
- Writer specific position, which is the attribute position in layout direction
-
- OD 2004-10-28 #i36248#
-
- @author OD
- */
- void __ConvertStartEndPosToLayoutDir(
- ::com::sun::star::awt::Point& _rioStartPos,
- ::com::sun::star::awt::Point& _rioEndPos );
-
- /** method to convert start position of the drawing object to the
+ /** method to convert start or end position of the drawing object to the
Writer specific position, which is the attribute position in layout direction
- OD 2004-10-28 #i36248#
+ OD 2009-01-12 #i59051#
@author OD
*/
- ::com::sun::star::awt::Point _ConvertStartPosToLayoutDir(
- const ::com::sun::star::awt::Point& _aStartPos );
+ ::com::sun::star::awt::Point _ConvertStartOrEndPosToLayoutDir(
+ const ::com::sun::star::awt::Point& aStartOrEndPos );
- /** method to convert end position of the drawing object to the
+ /** method to convert PolyPolygonBezier of the drawing object to the
Writer specific position, which is the attribute position in layout direction
- OD 2004-10-28 #i36248#
+ OD 2009-01-13 #i59051#
@author OD
*/
- ::com::sun::star::awt::Point _ConvertEndPosToLayoutDir(
- const ::com::sun::star::awt::Point& _aEndPos );
+ ::com::sun::star::drawing::PolyPolygonBezierCoords _ConvertPolyPolygonBezierToLayoutDir(
+ const ::com::sun::star::drawing::PolyPolygonBezierCoords& aPath );
/** method to get property from aggregation object
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 005371b0d3bb..cece34f7aa97 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -115,6 +115,14 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule )
{
SwTxtNode* pTxtNd = *aIter;
pTxtNd->NumRuleChgd();
+ // --> OD 2009-01-20 #i94152#
+ // assure that list level corresponds to outline level
+ if ( pTxtNd->GetTxtColl()->IsAssignedToListLevelOfOutlineStyle() &&
+ pTxtNd->GetAttrListLevel() != pTxtNd->GetTxtColl()->GetAssignedOutlineStyleLevel() )
+ {
+ pTxtNd->SetAttrListLevel( pTxtNd->GetTxtColl()->GetAssignedOutlineStyleLevel() );
+ }
+ // <--
}
// <--
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 16ec5c453469..94925f5ffc5e 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -1098,7 +1098,15 @@ void SwNumRule::ChangeIndent( const short nDiff )
}
else if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
- long nNewIndent = nDiff +
+ // --> OD 2009-01-20 #i93399#
+ // adjust also the list tab position, if a list tab stop is applied
+ if ( aTmpNumFmt.GetLabelFollowedBy() == SvxNumberFormat::LISTTAB )
+ {
+ const long nNewListTab = aTmpNumFmt.GetListtabPos() + nDiff;
+ aTmpNumFmt.SetListtabPos( nNewListTab );
+ }
+ // <--
+ const long nNewIndent = nDiff +
aTmpNumFmt.GetIndentAt();
aTmpNumFmt.SetIndentAt( nNewIndent );
}
@@ -1123,6 +1131,15 @@ void SwNumRule::SetIndent( const short nNewIndent,
}
else if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
+ // --> OD 2009-01-20 #i93399#
+ // adjust also the list tab position, if a list tab stop is applied
+ if ( aTmpNumFmt.GetLabelFollowedBy() == SvxNumberFormat::LISTTAB )
+ {
+ const long nNewListTab = aTmpNumFmt.GetListtabPos() +
+ ( nNewIndent - aTmpNumFmt.GetIndentAt() );
+ aTmpNumFmt.SetListtabPos( nNewListTab );
+ }
+ // <--
aTmpNumFmt.SetIndentAt( nNewIndent );
}
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 3d30aee66efb..41d0e97ec6d6 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -663,13 +663,24 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
pUp = pUp->GetUpper();
const bool bVert = pUp->IsVertical();
//Dem Textflus folgen.
+ // --> OD 2009-01-12 #i70582#
+ const SwTwips nTopForObjPos =
+ bVert
+ ? ( pCnt->Frm().Left() +
+ pCnt->Frm().Width() -
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() )
+ : ( pCnt->Frm().Top() +
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() );
+ // <--
if ( pUp->Frm().IsInside( rPt ) )
{
// OD 26.09.2003 - <rPt> point is inside environment of given content frame
+ // --> OD 2009-01-12 #i70582#
if( bVert )
- rRet.nMain = pCnt->Frm().Left() + pCnt->Frm().Width() -rPt.X();
+ rRet.nMain = nTopForObjPos - rPt.X();
else
- rRet.nMain = rPt.Y() - pCnt->Frm().Top();
+ rRet.nMain = rPt.Y() - nTopForObjPos;
+ // <--
return pCnt;
}
else if ( rPt.Y() <= pUp->Frm().Top() )
@@ -689,11 +700,12 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
(!bVert && (pLay->Frm().Left() + pLay->Prt().Right())<rPt.X()) )
{
// OD 26.09.2003 - <rPt> point is in left border of environment
+ // --> OD 2009-01-12 #i70582#
if( bVert )
- rRet.nMain = pCnt->Frm().Left() + pCnt->Frm().Width()
- - rPt.X();
+ rRet.nMain = nTopForObjPos - rPt.X();
else
- rRet.nMain = rPt.Y() - pCnt->Frm().Top();
+ rRet.nMain = rPt.Y() - nTopForObjPos;
+ // <--
return pCnt;
}
else
@@ -701,9 +713,11 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
}
else
{
- rRet.nMain = bVert ? pCnt->Frm().Left() + pCnt->Frm().Width() -
- (pUp->Frm().Left() + pUp->Prt().Left())
- : (pUp->Frm().Top() + pUp->Prt().Bottom()) - pCnt->Frm().Top();
+ // --> OD 2009-01-12 #i70582#
+ rRet.nMain = bVert
+ ? nTopForObjPos - (pUp->Frm().Left() + pUp->Prt().Left())
+ : (pUp->Frm().Top() + pUp->Prt().Bottom()) - nTopForObjPos;
+ // <--
const SwFrm *pPre = pCnt;
const SwFrm *pLay = pUp->GetLeaf( MAKEPAGE_NONE, TRUE, pCnt );
@@ -1245,10 +1259,23 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
SwTwips nY;
if ( pCnt->Frm().IsInside( aNew ) )
{
- if( bVert )
- nY = pCnt->Frm().Left()+pCnt->Frm().Width()-rNew.X()-Frm().Width();
+ // --> OD 2009-01-12 #i70582#
+ const SwTwips nTopForObjPos =
+ bVert
+ ? ( pCnt->Frm().Left() +
+ pCnt->Frm().Width() -
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() )
+ : ( pCnt->Frm().Top() +
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() );
+ if ( bVert )
+ {
+ nY = nTopForObjPos - rNew.X() - Frm().Width();
+ }
else
- nY = rNew.Y() - pCnt->Frm().Top();
+ {
+ nY = rNew.Y() - nTopForObjPos;
+ }
+ // <--
}
else
{
@@ -1291,10 +1318,23 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
if ( nY == LONG_MAX )
{
- if( bVert )
- nY = pCnt->Frm().Left() + pCnt->Frm().Width() - rNew.X();
+ // --> OD 2009-01-12 #i70582#
+ const SwTwips nTopForObjPos =
+ bVert
+ ? ( pCnt->Frm().Left() +
+ pCnt->Frm().Width() -
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() )
+ : ( pCnt->Frm().Top() +
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() );
+ if ( bVert )
+ {
+ nY = nTopForObjPos - rNew.X();
+ }
else
- nY = rNew.Y() - pCnt->Frm().Top();
+ {
+ nY = rNew.Y() - nTopForObjPos;
+ }
+ // <--
}
SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)GetFmt();
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 2502e4862ac3..e6275cb5481a 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -959,10 +959,15 @@ SwFtnFrm* lcl_FindEndnote( SwSectionFrm* &rpSect, BOOL &rbEmpty,
SwSectionFrm* pSect = rbEmpty ? rpSect->GetFollow() : rpSect;
while( pSect )
{
- ASSERT( pSect->Lower() && pSect->Lower()->IsColumnFrm(),
- "InsertEndnotes: Where's my column?" );
- SwColumnFrm* pCol = (SwColumnFrm*)pSect->Lower();
- do // check all columns
+ ASSERT( (pSect->Lower() && pSect->Lower()->IsColumnFrm()) || pSect->GetUpper()->IsFtnFrm(),
+ "InsertEndnotes: Where's my column?" );
+
+ // i73332: Columned section in endnote
+ SwColumnFrm* pCol = 0;
+ if(pSect->Lower() && pSect->Lower()->IsColumnFrm())
+ pCol = (SwColumnFrm*)pSect->Lower();
+
+ while( pCol ) // check all columns
{
SwFtnContFrm* pFtnCont = pCol->FindFtnCont();
if( pFtnCont )
@@ -986,7 +991,7 @@ SwFtnFrm* lcl_FindEndnote( SwSectionFrm* &rpSect, BOOL &rbEmpty,
}
}
pCol = (SwColumnFrm*)pCol->GetNext();
- } while ( pCol );
+ }
rpSect = pSect;
pSect = pLayouter ? pSect->GetFollow() : NULL;
rbEmpty = TRUE;
@@ -1024,7 +1029,9 @@ void lcl_ColumnRefresh( SwSectionFrm* pSect, BOOL bFollow )
void SwSectionFrm::CollectEndnotes( SwLayouter* pLayouter )
{
ASSERT( IsColLocked(), "CollectEndnotes: You love the risk?" );
- ASSERT( Lower() && Lower()->IsColumnFrm(), "Where's my column?" );
+ // i73332: Section in footnode does not have columns!
+ ASSERT( (Lower() && Lower()->IsColumnFrm()) || GetUpper()->IsFtnFrm(), "Where's my column?" );
+
SwSectionFrm* pSect = this;
SwFtnFrm* pFtn;
BOOL bEmpty = FALSE;
@@ -1843,14 +1850,28 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType )
// inside a table, but then the found section frame <pSect> is also inside
// this table.
SwSectionFrm *pSect = FindSctFrm();
- SwFrm *pPrv;
- if( 0 != ( pPrv = pSect->GetIndPrev() ) )
+
+ // --> OD 2009-01-16 #i95698#
+ // A table cell containing directly a section does not break - see lcl_FindSectionsInRow(..)
+ // Thus, a table inside a section, which is inside another table can only
+ // flow backward in the columns of its section.
+ // Note: The table cell, which contains the section, can not have a master table cell.
+ if ( IsTabFrm() && pSect->IsInTab() )
{
- // Herumlungernde, halbtote SectionFrms sollen uns nicht beirren
- while( pPrv && pPrv->IsSctFrm() && !((SwSectionFrm*)pPrv)->GetSection() )
- pPrv = pPrv->GetPrev();
- if( pPrv )
- return pCol;
+ return pCol;
+ }
+ // <--
+
+ {
+ SwFrm *pPrv;
+ if( 0 != ( pPrv = pSect->GetIndPrev() ) )
+ {
+ // Herumlungernde, halbtote SectionFrms sollen uns nicht beirren
+ while( pPrv && pPrv->IsSctFrm() && !((SwSectionFrm*)pPrv)->GetSection() )
+ pPrv = pPrv->GetPrev();
+ if( pPrv )
+ return pCol;
+ }
}
const BOOL bBody = IsInDocBody();
@@ -1861,15 +1882,8 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType )
while ( pLayLeaf )
{
- // In Tabellen oder Bereiche geht's niemals hinein.
- // --> OD 2008-12-22 #i95968#
- // Condition needs to be revised:
- // If the section the <this> frame is in, is inside a table, it is
- // allowed to step into a table. Otherwise a table/paragraph inside
- // a section inside a table would leave the outer table.
-// if ( pLayLeaf->IsInTab() || pLayLeaf->IsInSct() )
- if ( ( pLayLeaf->IsInTab() && !pSect->IsInTab() ) ||
- pLayLeaf->IsInSct() )
+ //In Tabellen oder Bereiche geht's niemals hinein.
+ if ( pLayLeaf->IsInTab() || pLayLeaf->IsInSct() )
{
pLayLeaf = pLayLeaf->GetPrevLayoutLeaf();
}
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index f43b2777486f..5213166b2af5 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -252,7 +252,7 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
// it is not the list tab stop:
( !pTabStop ||
!aLineInf.IsListTabStopIncluded() ||
- nNextPos != aLineInf.GetListTabStopPosition() ) ||
+ nNextPos != aLineInf.GetListTabStopPosition() ) &&
// compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
pFrm->GetTxtNode()->getIDocumentSettingAccess()->
get(IDocumentSettingAccess::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST);
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 11e793e1b394..02912fa7b60a 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -4747,6 +4747,21 @@ namespace {
if ( mrTxtNode.GetNumRule() &&
mrTxtNode.GetListId().Len() > 0 )
{
+ // --> OD 2009-01-14 #i96062#
+ // If paragraph has no list level attribute set and list style
+ // is the outline style, apply outline level as the list level.
+ if ( !mrTxtNode.HasAttrListLevel() &&
+ mrTxtNode.GetNumRule()->GetName() ==
+ String::CreateFromAscii( SwNumRule::GetOutlineRuleName() ) &&
+ mrTxtNode.GetTxtColl()->IsAssignedToListLevelOfOutlineStyle() )
+ {
+ int nNewListLevel = mrTxtNode.GetTxtColl()->GetAssignedOutlineStyleLevel();
+ if ( 0 <= nNewListLevel && nNewListLevel < MAXLEVEL )
+ {
+ mrTxtNode.SetAttrListLevel( nNewListLevel );
+ }
+ }
+ // <--
mrTxtNode.AddToList();
}
// --> OD 2008-11-19 #i70748#
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 1b8d883f36a9..19a1a84af546 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -68,9 +68,7 @@
#include <comphelper/extract.hxx>
#include <comphelper/stl_types.hxx>
#include <svx/scene3d.hxx>
-#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPPP_
#include <com/sun/star/beans/PropertyAttribute.hpp>
-#endif
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
@@ -78,14 +76,15 @@
// OD 2004-05-05 #i28701#
#include <fmtwrapinfluenceonobjpos.hxx>
// --> OD 2004-11-10 #i35007#
-#ifndef _COM_SUN_STAR_TEXT_TEXTCONTENTANCHORTYPE_HPP
#include <com/sun/star/text/TextContentAnchorType.hpp>
-#endif
// <--
// --> OD 2005-03-10 #i44334#, #i44681#
// --> OD 2007-01-03 #i73079# - use correct matrix type
#include <basegfx/matrix/b2dhommatrix.hxx>
// <--
+// --> OD 2009-01-16 #i59051
+#include <com/sun/star/drawing/PointSequence.hpp>
+// <--
#include <vcl/svapp.hxx>
@@ -1634,13 +1633,25 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
{
awt::Point aStartPos;
aRet >>= aStartPos;
- aRet <<= _ConvertStartPosToLayoutDir( aStartPos );
+ // --> OD 2009-01-12 #i59051#
+ aRet <<= _ConvertStartOrEndPosToLayoutDir( aStartPos );
+ // <--
}
else if ( rPropertyName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EndPosition"))) )
{
awt::Point aEndPos;
aRet >>= aEndPos;
- aRet <<= _ConvertEndPosToLayoutDir( aEndPos );
+ // --> OD 2009-01-12 #i59051#
+ aRet <<= _ConvertStartOrEndPosToLayoutDir( aEndPos );
+ // <--
+ }
+ // --> OD 2009-01-16 #i59051#
+ else if ( rPropertyName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PolyPolygonBezier"))) )
+ {
+ drawing::PolyPolygonBezierCoords aPath;
+ aRet >>= aPath;
+ aRet <<= _ConvertPolyPolygonBezierToLayoutDir( aPath );
+ // <--
}
// <--
}
@@ -2628,96 +2639,104 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition )
}
}
-/** method to convert start and end position of the drawing object to the
+/** method to convert start or end position of the drawing object to the
Writer specific position, which is the attribute position in layout direction
- OD 2004-10-28 #i36248#
+ OD 2009-01-12 #i59051#
@author OD
*/
-void SwXShape::__ConvertStartEndPosToLayoutDir( awt::Point& _rioStartPos,
- awt::Point& _rioEndPos )
+::com::sun::star::awt::Point SwXShape::_ConvertStartOrEndPosToLayoutDir(
+ const ::com::sun::star::awt::Point& aStartOrEndPos )
{
- awt::Point aPos( getPosition() );
- awt::Size aSize( getSize() );
+ awt::Point aConvertedPos( aStartOrEndPos );
- if ( _rioStartPos.X == _rioEndPos.X )
- {
- _rioStartPos.X = aPos.X;
- _rioEndPos.X = aPos.X;
- }
- else if ( _rioStartPos.X < _rioEndPos.X )
- {
- _rioStartPos.X = aPos.X;
- _rioEndPos.X = aPos.X + aSize.Width;
- }
- else
- {
- _rioEndPos.X = aPos.X;
- _rioStartPos.X = aPos.X + aSize.Width;
- }
-
- if ( _rioStartPos.Y == _rioEndPos.Y )
- {
- _rioStartPos.Y = aPos.Y;
- _rioEndPos.Y = aPos.Y;
- }
- else if ( _rioStartPos.Y < _rioEndPos.Y )
- {
- _rioStartPos.Y = aPos.Y;
- _rioEndPos.Y = aPos.Y + aSize.Height;
- }
- else
- {
- _rioEndPos.Y = aPos.Y;
- _rioStartPos.Y = aPos.Y + aSize.Height;
- }
-}
-
-/** method to convert start position of the drawing object to the
- Writer specific position, which is the attribute position in layout direction
-
- OD 2004-10-28 #i36248#
-
- @author OD
-*/
-awt::Point SwXShape::_ConvertStartPosToLayoutDir( const awt::Point& _aStartPos )
-{
- awt::Point aStartPos( _aStartPos );
- awt::Point aEndPos( 0, 0 );
- SvxShape* pSvxShape( GetSvxShape() );
+ SvxShape* pSvxShape = GetSvxShape();
+ ASSERT( pSvxShape,
+ "<SwXShape::_ConvertStartOrEndPosToLayoutDir(..)> - no SvxShape found!")
if ( pSvxShape )
{
- pSvxShape->_getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EndPosition")) )
- >>= aEndPos;
-
- __ConvertStartEndPosToLayoutDir( aStartPos, aEndPos );
+ const SdrObject* pObj = pSvxShape->GetSdrObject();
+ ASSERT( pObj,
+ "<SwXShape::_ConvertStartOrEndPosToLayoutDir(..)> - no SdrObject found!")
+ if ( pObj )
+ {
+ // get position of object in Writer coordinate system.
+ awt::Point aPos( getPosition() );
+ // get position of object in Drawing layer coordinate system
+ const Point aTmpObjPos( pObj->GetSnapRect().TopLeft() );
+ const awt::Point aObjPos(
+ TWIP_TO_MM100( aTmpObjPos.X() - pObj->GetAnchorPos().X() ),
+ TWIP_TO_MM100( aTmpObjPos.Y() - pObj->GetAnchorPos().Y() ) );
+ // determine difference between these positions according to the
+ // Writer coordinate system
+ const awt::Point aTranslateDiff( aPos.X - aObjPos.X,
+ aPos.Y - aObjPos.Y );
+ // apply translation difference to transformation matrix.
+ if ( aTranslateDiff.X != 0 || aTranslateDiff.Y != 0 )
+ {
+ aConvertedPos.X = aConvertedPos.X + aTranslateDiff.X;
+ aConvertedPos.Y = aConvertedPos.Y + aTranslateDiff.Y;
+ }
+ }
}
- return aStartPos;
+ return aConvertedPos;
}
-/** method to convert end position of the drawing object to the
- Writer specific position, which is the attribute position in layout direction
-
- OD 2004-10-28 #i36248#
-
- @author OD
-*/
-awt::Point SwXShape::_ConvertEndPosToLayoutDir( const awt::Point& _aEndPos )
+::com::sun::star::drawing::PolyPolygonBezierCoords SwXShape::_ConvertPolyPolygonBezierToLayoutDir(
+ const ::com::sun::star::drawing::PolyPolygonBezierCoords& aPath )
{
- awt::Point aEndPos( _aEndPos );
- awt::Point aStartPos( 0, 0 );
- SvxShape* pSvxShape( GetSvxShape() );
+ drawing::PolyPolygonBezierCoords aConvertedPath( aPath );
+
+ SvxShape* pSvxShape = GetSvxShape();
+ ASSERT( pSvxShape,
+ "<SwXShape::_ConvertStartOrEndPosToLayoutDir(..)> - no SvxShape found!")
if ( pSvxShape )
{
- pSvxShape->_getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StartPosition")) )
- >>= aStartPos;
+ const SdrObject* pObj = pSvxShape->GetSdrObject();
+ ASSERT( pObj,
+ "<SwXShape::_ConvertStartOrEndPosToLayoutDir(..)> - no SdrObject found!")
+ if ( pObj )
+ {
+ // get position of object in Writer coordinate system.
+ awt::Point aPos( getPosition() );
+ // get position of object in Drawing layer coordinate system
+ const Point aTmpObjPos( pObj->GetSnapRect().TopLeft() );
+ const awt::Point aObjPos(
+ TWIP_TO_MM100( aTmpObjPos.X() - pObj->GetAnchorPos().X() ),
+ TWIP_TO_MM100( aTmpObjPos.Y() - pObj->GetAnchorPos().Y() ) );
+ // determine difference between these positions according to the
+ // Writer coordinate system
+ const awt::Point aTranslateDiff( aPos.X - aObjPos.X,
+ aPos.Y - aObjPos.Y );
+ // apply translation difference to PolyPolygonBezier.
+ if ( aTranslateDiff.X != 0 || aTranslateDiff.Y != 0 )
+ {
+ basegfx::B2DHomMatrix aMatrix;
+ aMatrix.translate( aTranslateDiff.X, aTranslateDiff.Y );
+
+ const sal_Int32 nOuterSequenceCount(aConvertedPath.Coordinates.getLength());
+ drawing::PointSequence* pInnerSequence = aConvertedPath.Coordinates.getArray();
+ for(sal_Int32 a(0); a < nOuterSequenceCount; a++)
+ {
+ const sal_Int32 nInnerSequenceCount(pInnerSequence->getLength());
+ awt::Point* pArray = pInnerSequence->getArray();
- __ConvertStartEndPosToLayoutDir( aStartPos, aEndPos );
+ for(sal_Int32 b(0); b < nInnerSequenceCount; b++)
+ {
+ basegfx::B2DPoint aNewCoordinatePair(pArray->X, pArray->Y);
+ aNewCoordinatePair *= aMatrix;
+ pArray->X = basegfx::fround(aNewCoordinatePair.getX());
+ pArray->Y = basegfx::fround(aNewCoordinatePair.getY());
+ pArray++;
+ }
+ }
+ }
+ }
}
- return aEndPos;
+ return aConvertedPath;
}
/*-- 31.05.01 09:59:19---------------------------------------------------
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 5decec3d7a12..de0703d36456 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1870,18 +1870,20 @@ Writer& OutWW8_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
aLR.SetTxtFirstLineOfstValue(pFmt->GetAbsLSpace() - pFmt->GetFirstLineOffset());
else
aLR.SetTxtFirstLineOfst(GetWordFirstLineOffset(*pFmt));
- }
- // <--
- if (SFX_ITEM_SET !=
- pTmpSet->GetItemState(RES_PARATR_NUMRULE, false) )
- {
- //If the numbering is not outline, and theres no numrule
- //name in the itemset, put one in there
+ // --> OD 2009-01-12 #i94187#
+ // set list style directly only in position and space mode LABEL_WIDTH_AND_POSITION
+ if (SFX_ITEM_SET !=
+ pTmpSet->GetItemState(RES_PARATR_NUMRULE, false) )
+ {
+ //If the numbering is not outline, and theres no numrule
+ //name in the itemset, put one in there
- // NumRule from a template - then put it into the itemset
- pTmpSet->Put( SwNumRuleItem( pRule->GetName() ));
+ // NumRule from a template - then put it into the itemset
+ pTmpSet->Put( SwNumRuleItem( pRule->GetName() ));
+ }
}
+ // <--
}
else
pTmpSet->ClearItem(RES_PARATR_NUMRULE);
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 057684f49b9c..e00a57fe7adf 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -2490,8 +2490,14 @@ bool SwWW8ImplReader::IsObjectLayoutInTableCell( const UINT32 nLayoutInTableCell
case 0x6000: // version 11 aka Microsoft Word 2003
case 0x8000: // version 12 aka Microsoft Word 2007
{
+ // --> OD 2009-01-13 #i98037#
+ // adjustment of conditions needed after deeper analysis of
+ // certain test cases.
if ( nLayoutInTableCell == 0xFFFFFFFF || // no explicit attribute value given
- nLayoutInTableCell & 0x00008000 )
+ nLayoutInTableCell & 0x80008000 ||
+ ( nLayoutInTableCell & 0x02000000 &&
+ !(nLayoutInTableCell & 0x80000000 ) ) )
+ // <--
{
bIsObjectLayoutInTableCell = true;
}