[ooo-build-commit] .: 4 commits - sw/inc sw/source
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Tue Sep 14 05:46:05 PDT 2010
sw/inc/IDocumentSettingAccess.hxx | 2 +
sw/inc/doc.hxx | 2 +
sw/inc/ndtxt.hxx | 2 +
sw/source/core/crsr/callnk.cxx | 50 +++++++++++++++++++++++++++++++
sw/source/core/doc/doc.cxx | 8 ++++
sw/source/core/doc/docnew.cxx | 2 +
sw/source/core/inc/frame.hxx | 4 ++
sw/source/core/layout/calcmove.cxx | 43 ++++++++++++++++++++++++++
sw/source/core/layout/findfrm.cxx | 9 +++++
sw/source/core/layout/frmtool.cxx | 9 ++++-
sw/source/core/layout/paintfrm.cxx | 2 -
sw/source/core/text/frmpaint.cxx | 34 +++++++++++----------
sw/source/core/text/itrform2.cxx | 22 +++++++++++++
sw/source/core/text/porrst.cxx | 16 +++++++++
sw/source/filter/rtf/swparrtf.cxx | 2 -
sw/source/filter/ww8/ww8par.cxx | 10 ++++--
sw/source/filter/ww8/ww8par2.cxx | 14 --------
sw/source/filter/ww8/ww8par6.cxx | 17 ++++++++--
sw/source/ui/uno/SwXDocumentSettings.cxx | 32 +++++++++++++++++--
19 files changed, 237 insertions(+), 43 deletions(-)
New commits:
commit 47472e8e70c1ae3dc55a5b00ef69eaa85f651a7f
Author: Florian Reuter <freuter at novell.com>
Date: Tue Sep 14 14:40:15 2010 +0200
sw-collapse-empty-table-par-like-html.diff:
n#376690
diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx
index 1b38208..0a9039d 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -82,6 +82,7 @@ namespace com { namespace sun { namespace star { namespace i18n { struct Forbidd
TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST,
// <--
INVERT_BORDER_SPACING,
+ COLLAPSE_EMPTY_CELL_PARA,
// COMPATIBILITY FLAGS END
BROWSE_MODE,
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index b3714a6..c6c27f4 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -604,6 +604,7 @@ private:
bool mbTabRelativeToIndent : 1; // #i24363# tab stops relative to indent
bool mbProtectForm : 1;
bool mbInvertBorderSpacing : 1;
+ bool mbCollapseEmptyCellPara : 1;
bool mbTabAtLeftIndentForParagraphsInList; // OD 2008-06-05 #i89181# - see above
// #i78591#
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index c63efbe..6d60b48 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -856,6 +856,8 @@ public:
virtual ::com::sun::star::uno::Reference<
::com::sun::star::rdf::XMetadatable > MakeUnoObject();
+ bool IsCollapse() const;
+
DECL_FIXEDMEMPOOL_NEWDEL(SwTxtNode)
};
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 9e37e40..f72be56 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -43,10 +43,15 @@
#include <doc.hxx>
#include <frmfmt.hxx>
#include <txtfrm.hxx>
+#include <tabfrm.hxx>
+#include <rowfrm.hxx>
+#include <fmtfsize.hxx>
#include <ndtxt.hxx>
#include <flyfrm.hxx>
#include <breakit.hxx>
+#include<vcl/window.hxx>
+
SwCallLink::SwCallLink( SwCrsrShell & rSh, ULONG nAktNode, xub_StrLen nAktCntnt,
BYTE nAktNdTyp, long nLRPos, bool bAktSelection )
@@ -97,6 +102,51 @@ SwCallLink::~SwCallLink()
if( !pCNd )
return;
+ bool bUpdatedTable = false;
+ SwFrm *myFrm=pCNd->GetFrm();
+ if (myFrm!=NULL)
+ {
+ // We need to emulated a change of the row height in order
+ // to have the complete row redrawn
+ SwRowFrm* pRow = myFrm->FindRowFrm( );
+ if ( pRow )
+ {
+ const SwTableLine* pLine = pRow->GetTabLine( );
+ SwFmtFrmSize pSize = pLine->GetFrmFmt( )->GetFrmSize( );
+ pRow->Modify( NULL, &pSize );
+
+ bUpdatedTable = true;
+ }
+ }
+
+ const SwDoc *pDoc=rShell.GetDoc();
+ const SwCntntNode *pNode = NULL;
+ if ( ( pDoc != NULL && nNode < pDoc->GetNodes( ).Count( ) ) )
+ {
+ pNode = pDoc->GetNodes()[nNode]->GetCntntNode();
+ }
+ if ( pNode != NULL )
+ {
+ SwFrm *myFrm2=pNode->GetFrm();
+ if (myFrm2!=NULL)
+ {
+ // We need to emulated a change of the row height in order
+ // to have the complete row redrawn
+ SwRowFrm* pRow = myFrm2->FindRowFrm();
+ if ( pRow )
+ {
+ const SwTableLine* pLine = pRow->GetTabLine( );
+ SwFmtFrmSize pSize = pLine->GetFrmFmt( )->GetFrmSize( );
+ pRow->Modify( NULL, &pSize );
+
+ bUpdatedTable = true;
+ }
+ }
+ }
+
+ if ( bUpdatedTable )
+ rShell.GetWin( )->Invalidate( 0 );
+
xub_StrLen nCmp, nAktCntnt = pCurCrsr->GetPoint()->nContent.GetIndex();
USHORT nNdWhich = pCNd->GetNodeType();
ULONG nAktNode = pCurCrsr->GetPoint()->nNode.GetIndex();
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index b7dcc21..d9d7810 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -198,6 +198,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const
case TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST: return mbTabAtLeftIndentForParagraphsInList;
// <--
case INVERT_BORDER_SPACING: return mbInvertBorderSpacing;
+ case COLLAPSE_EMPTY_CELL_PARA: return mbCollapseEmptyCellPara;
// COMPATIBILITY FLAGS END
case BROWSE_MODE: return mbBrowseMode;
@@ -324,6 +325,9 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
case INVERT_BORDER_SPACING:
mbInvertBorderSpacing = value;
break;
+ case COLLAPSE_EMPTY_CELL_PARA:
+ mbCollapseEmptyCellPara = value;
+ break;
// COMPATIBILITY FLAGS END
case BROWSE_MODE:
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 15f86f2..6ee9dbc 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -384,6 +384,7 @@ SwDoc::SwDoc() :
mbTabAtLeftIndentForParagraphsInList = false; // hidden
// <--
mbInvertBorderSpacing = false; // hidden
+ mbCollapseEmptyCellPara = true; // hidden
//
// COMPATIBILITY FLAGS END
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 6d61b3a..ca1deea 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -624,6 +624,7 @@ public:
SwRootFrm *FindRootFrm();
SwPageFrm *FindPageFrm();
SwFrm *FindColFrm();
+ SwRowFrm *FindRowFrm();
SwFtnBossFrm *FindFtnBossFrm( BOOL bFootnotes = FALSE );
SwTabFrm *ImplFindTabFrm();
SwFtnFrm *ImplFindFtnFrm();
@@ -910,6 +911,9 @@ public:
// FME 2007-08-30 #i81146# new loop control
void ValidateThisAndAllLowers( const USHORT nStage );
+
+public:
+ bool IsCollapse() const;
};
inline BOOL SwFrm::IsInDocBody() const
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 28d3a9b..3afa737 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -63,6 +63,8 @@
#include <flyfrms.hxx>
// <--
+#include <ndtxt.hxx>
+
//------------------------------------------------------------------------
// Move-Methoden
//------------------------------------------------------------------------
@@ -952,6 +954,42 @@ void SwLayoutFrm::MakeAll()
|* Letzte Aenderung MA 03. Mar. 96
|*
|*************************************************************************/
+bool SwTxtNode::IsCollapse() const
+{
+ if ( GetDoc()->get( IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA ) && GetTxt().Len()==0 ) {
+ ULONG nIdx=GetIndex();
+ const SwEndNode *pNdBefore=GetNodes()[nIdx-1]->GetEndNode();
+ const SwEndNode *pNdAfter=GetNodes()[nIdx+1]->GetEndNode();
+
+ // The paragraph is collapsed only if the NdAfter is the end of a cell
+ bool bInTable = this->FindTableNode( ) != NULL;
+
+ SwSortedObjs* pObjs = this->GetFrm()->GetDrawObjs( );
+ sal_uInt32 nObjs = ( pObjs != NULL ) ? pObjs->Count( ) : 0;
+
+ if ( pNdBefore!=NULL && pNdAfter!=NULL && nObjs == 0 && bInTable ) {
+ return true;
+ } else {
+ return false;
+ }
+ } else
+ return false;
+}
+
+bool SwFrm::IsCollapse() const
+{
+ if (IsTxtFrm()) {
+ const SwTxtFrm *pTxtFrm=(SwTxtFrm*)this;
+ const SwTxtNode *pTxtNode=pTxtFrm->GetTxtNode();
+ if (pTxtNode && pTxtNode->IsCollapse()) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+}
BOOL SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
{
@@ -1054,6 +1092,11 @@ BOOL SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
// OD 2004-03-02 #106629# - use new method <CalcLowerSpace(..)>
SwTwips nLower = CalcLowerSpace( &rAttrs );
+ if (IsCollapse()) {
+ ViewShell *pSh = GetShell();
+ nUpper=0;
+ nLower=0;
+ }
// // in balanced columned section frames we do not want the
// // common border
// sal_Bool bCommonBorder = sal_True;
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 1f7856c..cf4c84e 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -596,6 +596,15 @@ SwFrm *SwFrm::FindColFrm()
return pFrm;
}
+SwRowFrm *SwFrm::FindRowFrm()
+{
+ SwFrm *pFrm = this;
+ do
+ { pFrm = pFrm->GetUpper();
+ } while ( pFrm && !pFrm->IsRowFrm() );
+ return dynamic_cast< SwRowFrm* >( pFrm );
+}
+
SwFrm* SwFrm::FindFooterOrHeader()
{
SwFrm* pRet = this;
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index e8fc5b3..4b0246c 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -566,21 +566,25 @@ sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const
}
}
- const XubString aTmp( CH_PAR );
- SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), 0, aTmp, 0, 1 );
- aDrawInf.SetLeft( rRect.Left() );
- aDrawInf.SetRight( rRect.Right() );
- aDrawInf.SetPos( aPos );
- aDrawInf.SetSpace( 0 );
- aDrawInf.SetKanaComp( 0 );
- aDrawInf.SetWrong( NULL );
- aDrawInf.SetGrammarCheck( NULL );
- aDrawInf.SetSmartTags( NULL ); // SMARTTAGS
- aDrawInf.SetFrm( this );
- aDrawInf.SetFont( pFnt );
- aDrawInf.SetSnapToGrid( sal_False );
-
- pFnt->_DrawText( aDrawInf );
+ // Don't show the paragraph mark for collapsed paragraphs, when they are hidden
+ if ( EmptyHeight( ) > 1 )
+ {
+ const XubString aTmp( CH_PAR );
+ SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), 0, aTmp, 0, 1 );
+ aDrawInf.SetLeft( rRect.Left() );
+ aDrawInf.SetRight( rRect.Right() );
+ aDrawInf.SetPos( aPos );
+ aDrawInf.SetSpace( 0 );
+ aDrawInf.SetKanaComp( 0 );
+ aDrawInf.SetWrong( NULL );
+ aDrawInf.SetGrammarCheck( NULL );
+ aDrawInf.SetSmartTags( NULL ); // SMARTTAGS
+ aDrawInf.SetFrm( this );
+ aDrawInf.SetFont( pFnt );
+ aDrawInf.SetSnapToGrid( sal_False );
+
+ pFnt->_DrawText( aDrawInf );
+ }
delete pClip;
}
delete pFnt;
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index 9ca3d5d..3a84683 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -58,6 +58,8 @@
#include <IDocumentSettingAccess.hxx>
#include <IDocumentDeviceAccess.hxx>
+#include <crsrsh.hxx>
+
/*************************************************************************
* class SwTmpEndPortion
*************************************************************************/
@@ -228,6 +230,20 @@ SwLinePortion *SwArrowPortion::Compress() { return this; }
SwTwips SwTxtFrm::EmptyHeight() const
{
+ if (IsCollapse()) {
+ ViewShell *pSh = GetShell();
+ if ( pSh->IsA( TYPE(SwCrsrShell) ) ) {
+ SwCrsrShell *pCrSh=(SwCrsrShell*)pSh;
+ SwCntntFrm *pCurrFrm=pCrSh->GetCurrFrm();
+ if (pCurrFrm==(SwCntntFrm*)this) {
+ // do nothing
+ } else {
+ return 1;
+ }
+ } else {
+ return 1;
+ }
+ }
ASSERT( ! IsVertical() || ! IsSwapped(),"SwTxtFrm::EmptyHeight with swapped frame" );
SwFont *pFnt;
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 99c1e2b..23b4876 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1395,6 +1395,7 @@ void SwWW8ImplReader::ImportDop()
// <--
rDoc.set(IDocumentSettingAccess::INVERT_BORDER_SPACING, true);
+ rDoc.set(IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA, true);
//
// COMPATIBILITY FLAGS END
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 176abfa..5207ef6 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -3639,22 +3639,8 @@ bool lcl_PamContainsFly(SwPaM & rPam)
void SwWW8ImplReader::TabCellEnd()
{
if (nInTable && pTableDesc)
- {
pTableDesc->TableCellEnd();
- if (bReadTable
- && pWFlyPara == NULL
- && mpTableEndPaM.get() != NULL
- && (! SwPaM::Overlap(*pPaM, *mpTableEndPaM))
- && SwPaM::LessThan(*mpTableEndPaM, *pPaM)
- && mpTableEndPaM->GetPoint()->nNode.GetNode().IsTxtNode()
- && !lcl_PamContainsFly(*mpTableEndPaM)
- )
- {
- rDoc.DelFullPara(*mpTableEndPaM);
- }
- }
-
bFirstPara = true; // We have come to the end of a cell so FirstPara flag
bReadTable = false;
mpTableEndPaM.reset();
diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx
index bacb053..48d6a30 100644
--- a/sw/source/ui/uno/SwXDocumentSettings.cxx
+++ b/sw/source/ui/uno/SwXDocumentSettings.cxx
@@ -125,7 +125,8 @@ enum SwDocumentSettingsPropertyHandles
HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST,
// <--
HANDLE_MODIFYPASSWORDINFO,
- HANDLE_INVERT_BORDER_SPACING
+ HANDLE_INVERT_BORDER_SPACING,
+ HANDLE_COLLAPSE_EMPTY_CELL_PARA
};
MasterPropertySetInfo * lcl_createSettingsInfo()
@@ -181,6 +182,7 @@ MasterPropertySetInfo * lcl_createSettingsInfo()
{ RTL_CONSTASCII_STRINGPARAM("TabAtLeftIndentForParagraphsInList"), HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, CPPUTYPE_BOOLEAN, 0, 0},
{ RTL_CONSTASCII_STRINGPARAM("ModifyPasswordInfo"), HANDLE_MODIFYPASSWORDINFO, CPPUTYPE_PROPERTYVALUE, 0, 0},
{ RTL_CONSTASCII_STRINGPARAM("InvertBorderSpacing"), HANDLE_INVERT_BORDER_SPACING, CPPUTYPE_BOOLEAN, 0, 0},
+ { RTL_CONSTASCII_STRINGPARAM("CollapseEmptyCellPara"), HANDLE_COLLAPSE_EMPTY_CELL_PARA, CPPUTYPE_BOOLEAN, 0, 0},
/*
* As OS said, we don't have a view when we need to set this, so I have to
* find another solution before adding them to this property set - MTG
@@ -695,6 +697,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
mpDoc->set(IDocumentSettingAccess::INVERT_BORDER_SPACING, bTmp);
}
break;
+ case HANDLE_COLLAPSE_EMPTY_CELL_PARA:
+ {
+ sal_Bool bTmp = *(sal_Bool*)rValue.getValue();
+ mpDoc->set(IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA, bTmp);
+ }
+ break;
default:
throw UnknownPropertyException();
}
@@ -1033,6 +1041,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
rValue.setValue( &bTmp, ::getBooleanCppuType() );
}
break;
+ case HANDLE_COLLAPSE_EMPTY_CELL_PARA:
+ {
+ sal_Bool bTmp = mpDoc->get( IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA );
+ rValue.setValue( &bTmp, ::getBooleanCppuType() );
+ }
+ break;
default:
throw UnknownPropertyException();
}
commit 440bab6daea191ddf18b019fb88600b82e11a0ed
Author: Florian Reuter <freuter at novell.com>
Date: Tue Sep 14 14:36:01 2010 +0200
sw-invert-border-spacing.diff:
n#391591
diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx
index 58a6df6..1b38208 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -81,6 +81,7 @@ namespace com { namespace sun { namespace star { namespace i18n { struct Forbidd
// --> OD 2008-06-05 #i89181#
TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST,
// <--
+ INVERT_BORDER_SPACING,
// COMPATIBILITY FLAGS END
BROWSE_MODE,
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 14e25ab..b3714a6 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -603,6 +603,7 @@ private:
bool mbOldPrinterMetrics : 1; // FME 2007-05-14 #147385#
bool mbTabRelativeToIndent : 1; // #i24363# tab stops relative to indent
bool mbProtectForm : 1;
+ bool mbInvertBorderSpacing : 1;
bool mbTabAtLeftIndentForParagraphsInList; // OD 2008-06-05 #i89181# - see above
// #i78591#
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index a414c8f..b7dcc21 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -197,6 +197,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const
// --> OD 2008-06-05 #i89181#
case TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST: return mbTabAtLeftIndentForParagraphsInList;
// <--
+ case INVERT_BORDER_SPACING: return mbInvertBorderSpacing;
// COMPATIBILITY FLAGS END
case BROWSE_MODE: return mbBrowseMode;
@@ -320,6 +321,9 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
mbTabAtLeftIndentForParagraphsInList = value;
break;
// <--
+ case INVERT_BORDER_SPACING:
+ mbInvertBorderSpacing = value;
+ break;
// COMPATIBILITY FLAGS END
case BROWSE_MODE:
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 3b81863..15f86f2 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -383,6 +383,7 @@ SwDoc::SwDoc() :
// --> OD 2008-06-05 #i89181#
mbTabAtLeftIndentForParagraphsInList = false; // hidden
// <--
+ mbInvertBorderSpacing = false; // hidden
//
// COMPATIBILITY FLAGS END
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index b525043..dd0a3eb 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -2002,8 +2002,9 @@ void SwBorderAttrs::_CalcBottom()
long SwBorderAttrs::CalcRight( const SwFrm* pCaller ) const
{
- long nRight;
+ long nRight=0;
+ if (!pCaller->IsTxtFrm() || !((SwTxtFrm*)pCaller)->GetTxtNode()->GetDoc()->get(IDocumentSettingAccess::INVERT_BORDER_SPACING)) {
// OD 23.01.2003 #106895# - for cell frame in R2L text direction the left
// and right border are painted on the right respectively left.
if ( pCaller->IsCellFrm() && pCaller->IsRightToLeft() )
@@ -2011,6 +2012,7 @@ long SwBorderAttrs::CalcRight( const SwFrm* pCaller ) const
else
nRight = CalcRightLine();
+ }
// for paragraphs, "left" is "before text" and "right" is "after text"
if ( pCaller->IsTxtFrm() && pCaller->IsRightToLeft() )
nRight += rLR.GetLeft();
@@ -2030,14 +2032,16 @@ long SwBorderAttrs::CalcRight( const SwFrm* pCaller ) const
long SwBorderAttrs::CalcLeft( const SwFrm *pCaller ) const
{
- long nLeft;
+ long nLeft=0;
+ if (!pCaller->IsTxtFrm() || !((SwTxtFrm*)pCaller)->GetTxtNode()->GetDoc()->get(IDocumentSettingAccess::INVERT_BORDER_SPACING)) {
// OD 23.01.2003 #106895# - for cell frame in R2L text direction the left
// and right border are painted on the right respectively left.
if ( pCaller->IsCellFrm() && pCaller->IsRightToLeft() )
nLeft = CalcRightLine();
else
nLeft = CalcLeftLine();
+ }
// for paragraphs, "left" is "before text" and "right" is "after text"
if ( pCaller->IsTxtFrm() && pCaller->IsRightToLeft() )
@@ -2045,6 +2049,7 @@ long SwBorderAttrs::CalcLeft( const SwFrm *pCaller ) const
else
nLeft += rLR.GetLeft();
+
// --> OD 2008-01-21 #newlistlevelattrs#
// correction: do not retrieve left margin for numbering in R2L-layout
// if ( pCaller->IsTxtFrm() )
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 3c6d082..7a432fd 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4662,7 +4662,7 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
const SwBorderAttrs &rAttrs ) const
{
//fuer (Row,Body,Ftn,Root,Column,NoTxt) gibt's hier nix zu tun
- if ( (GetType() & 0x90C5) || (Prt().SSize() == Frm().SSize()) )
+ if ( (GetType() & 0x90C5) )
return;
if ( (GetType() & 0x2000) && //Cell
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index e437f24..fccac64 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -296,7 +296,7 @@ void SwRTFParser::Continue( int nToken )
// --> FME 2006-02-10 #131283#
pDoc->set(IDocumentSettingAccess::TABLE_ROW_KEEP, true);
pDoc->set(IDocumentSettingAccess::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION, true);
-
+ pDoc->set(IDocumentSettingAccess::INVERT_BORDER_SPACING, true);
//
// COMPATIBILITY FLAGS END
//
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index e93dd95..99c1e2b 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1394,6 +1394,8 @@ void SwWW8ImplReader::ImportDop()
rDoc.set(IDocumentSettingAccess::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION, true);
// <--
+ rDoc.set(IDocumentSettingAccess::INVERT_BORDER_SPACING, true);
+
//
// COMPATIBILITY FLAGS END
//
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 2b67edc..1cf6771 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -4798,10 +4798,19 @@ void SwWW8ImplReader::Read_Border(USHORT , const BYTE* , short nLen)
maTracer.Log(sw::log::eBorderDistOutside);
- aBox.SetDistance( (USHORT)aInnerDist.Left(), BOX_LINE_LEFT );
- aBox.SetDistance( (USHORT)aInnerDist.Top(), BOX_LINE_TOP );
- aBox.SetDistance( (USHORT)aInnerDist.Right(), BOX_LINE_RIGHT );
- aBox.SetDistance( (USHORT)aInnerDist.Bottom(), BOX_LINE_BOTTOM );
+ if ((nBorder & WW8_LEFT)==WW8_LEFT) {
+ aBox.SetDistance( (USHORT)aInnerDist.Left(), BOX_LINE_LEFT );
+ }
+ if ((nBorder & WW8_TOP)==WW8_TOP) {
+ aBox.SetDistance( (USHORT)aInnerDist.Top(), BOX_LINE_TOP );
+ }
+ if ((nBorder & WW8_RIGHT)==WW8_RIGHT) {
+ aBox.SetDistance( (USHORT)aInnerDist.Right(), BOX_LINE_RIGHT );
+ }
+
+ if ((nBorder & WW8_BOT)==WW8_BOT) {
+ aBox.SetDistance( (USHORT)aInnerDist.Bottom(), BOX_LINE_BOTTOM );
+ }
NewAttr( aBox );
diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx
index cbfe861..bacb053 100644
--- a/sw/source/ui/uno/SwXDocumentSettings.cxx
+++ b/sw/source/ui/uno/SwXDocumentSettings.cxx
@@ -124,7 +124,8 @@ enum SwDocumentSettingsPropertyHandles
// --> OD 2008-06-05 #i89181#
HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST,
// <--
- HANDLE_MODIFYPASSWORDINFO
+ HANDLE_MODIFYPASSWORDINFO,
+ HANDLE_INVERT_BORDER_SPACING
};
MasterPropertySetInfo * lcl_createSettingsInfo()
@@ -179,7 +180,7 @@ MasterPropertySetInfo * lcl_createSettingsInfo()
// --> OD 2008-06-05 #i89181#
{ RTL_CONSTASCII_STRINGPARAM("TabAtLeftIndentForParagraphsInList"), HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, CPPUTYPE_BOOLEAN, 0, 0},
{ RTL_CONSTASCII_STRINGPARAM("ModifyPasswordInfo"), HANDLE_MODIFYPASSWORDINFO, CPPUTYPE_PROPERTYVALUE, 0, 0},
-
+ { RTL_CONSTASCII_STRINGPARAM("InvertBorderSpacing"), HANDLE_INVERT_BORDER_SPACING, CPPUTYPE_BOOLEAN, 0, 0},
/*
* As OS said, we don't have a view when we need to set this, so I have to
* find another solution before adding them to this property set - MTG
@@ -688,6 +689,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
uno::Reference< uno::XInterface >() );
}
break;
+ case HANDLE_INVERT_BORDER_SPACING:
+ {
+ sal_Bool bTmp = *(sal_Bool*)rValue.getValue();
+ mpDoc->set(IDocumentSettingAccess::INVERT_BORDER_SPACING, bTmp);
+ }
+ break;
default:
throw UnknownPropertyException();
}
@@ -1020,7 +1027,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
rValue <<= mpDocSh->GetModifyPasswordInfo();
}
break;
-
+ case HANDLE_INVERT_BORDER_SPACING:
+ {
+ sal_Bool bTmp = mpDoc->get(IDocumentSettingAccess::INVERT_BORDER_SPACING);
+ rValue.setValue( &bTmp, ::getBooleanCppuType() );
+ }
+ break;
default:
throw UnknownPropertyException();
}
commit 70597695b23b5c45dfc735a7afd175f034428195
Author: Florian Reuter <freuter at novell.com>
Date: Tue Sep 14 14:32:01 2010 +0200
sw-allow-negative-spacing.diff: correctly display linespacing < 100%
n#364534
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 3100364..c1a838b 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1746,6 +1746,28 @@ void SwTxtFormatter::CalcRealHeight( sal_Bool bNewLine )
switch( pSpace->GetLineSpaceRule() )
{
case SVX_LINE_SPACE_AUTO:
+ if (pSpace->GetInterLineSpaceRule()==SVX_INTER_LINE_SPACE_PROP) {
+ long nTmp = pSpace->GetPropLineSpace();
+ if (nTmp<100) { // code adaped from fixed line height
+ nTmp *= nLineHeight;
+ nTmp /= 100;
+ if( !nTmp )
+ ++nTmp;
+ nLineHeight = (KSHORT)nTmp;
+/*
+ //@TODO figure out how WW maps ascent and descent
+ //in case of prop line spacing <100%
+ KSHORT nAsc = ( 4 * nLineHeight ) / 5; // 80%
+ if( nAsc < pCurr->GetAscent() ||
+ nLineHeight - nAsc < pCurr->Height() -
+pCurr->GetAscent() )
+ pCurr->SetClipping( sal_True );
+ pCurr->SetAscent( nAsc );
+*/
+ pCurr->Height( nLineHeight );
+ pInf->GetParaPortion()->SetFixLineHeight();
+ }
+ }
break;
case SVX_LINE_SPACE_MIN:
{
commit 998c642599c9196e2249fe35cf1450711fdd5d75
Author: Florian Reuter <freuter at novell.com>
Date: Tue Sep 14 14:28:15 2010 +0200
sw-section-import-fix.diff: Additional paragraph imported from ww8
n#364533
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 04341ab..e93dd95 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2713,9 +2713,10 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs)
else if (!nInTable)
{
// Always insert a txtnode for a column break, e.g. ##
- AppendTxtNode(*pPaM->GetPoint());
- rDoc.InsertPoolItem(*pPaM,
- SvxFmtBreakItem(SVX_BREAK_COLUMN_BEFORE, RES_BREAK), 0);
+ SwCntntNode *pCntNd=pPaM->GetCntntNode();
+ if (pCntNd!=NULL && pCntNd->Len()>0) // if par is empty not break is needed
+ AppendTxtNode(*pPaM->GetPoint());
+ rDoc.InsertPoolItem(*pPaM, SvxFmtBreakItem(SVX_BREAK_COLUMN_BEFORE, RES_BREAK), 0);
}
break;
case 0x7:
More information about the ooo-build-commit
mailing list