[ooo-build-commit] Branch 'ooo/OOO320' - 2 commits - sw/source
Jan Holesovsky
kendy at kemper.freedesktop.org
Fri Oct 30 21:34:29 PDT 2009
sw/source/core/doc/docfmt.cxx | 61 +++++++++++++++++--------------
sw/source/core/doc/docredln.cxx | 8 +++-
sw/source/core/docnode/ndtbl.cxx | 4 +-
sw/source/core/layout/sectfrm.cxx | 4 ++
sw/source/core/text/itrcrsr.cxx | 25 ++++++++----
sw/source/core/txtnode/ndtxt.cxx | 5 +-
sw/source/core/unocore/unocrsrhelper.cxx | 4 +-
sw/source/core/unocore/unodraw.cxx | 5 ++
sw/source/core/unocore/unoobj2.cxx | 6 +++
sw/source/core/unocore/unotext.cxx | 56 +++++++++++++++++++++-------
sw/source/ui/uno/unomod.cxx | 34 ++++++++---------
11 files changed, 141 insertions(+), 71 deletions(-)
New commits:
commit 2de41c091cabf245f3759908418e82e27aca477f
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date: Thu Oct 29 12:22:30 2009 +0000
CWS-TOOLING: integrate CWS c07v026_OOO320
2009-10-19 10:26:11 +0200 mav r277008 : #b6886425# use standard solution to encode the URL for the Gnome
2009-10-19 08:38:28 +0200 mav r276998 : #b6886425# encode the URL correctly for the Gnome
2009-10-07 12:49:32 +0200 os r276749 : #b6887668# resize items depending on the item text length
2009-09-28 18:42:32 +0200 dr r276499 : #b6883075# shrink print ranges to Excel sheet limits
2009-09-28 16:50:25 +0200 od r276497 : #b6882166# method <SwSectionFrm::SimpleFormat(..)>
- assure notification on position changes, otherwise the layout will not be correct.
2009-09-15 18:31:37 +0200 dr r276185 : #b6872823# check cursor before using, patch by aw
2009-09-09 10:52:52 +0200 od r275975 : #b6879723# correct handling of new list level attributes regarding paragraph indent values,
especially in case of OOo 2.0 and former hidden compatibility option "Ignore first line
indent on numbering"
2009-09-08 11:10:31 +0200 od r275918 : #b6876367# method <lcl_SetTxtFmtColl(..)>
- do not reset list attributes at paragraph, if its applied list style
will not change due to the newly applied paragraph style.
2009-09-07 12:48:58 +0200 obo r275890 : Merge from c07v025 into this CWS
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index fff14d4..f8e267a 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1744,36 +1744,45 @@ BOOL lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs )
pFmt != pCNd->GetFmtColl() &&
pFmt->GetItemState( RES_PARATR_NUMRULE ) == SFX_ITEM_SET )
{
- // --> OD 2008-04-08 #refactorlists#
-// if ( pPara->pHistory )
-// {
-// SwTxtNode* pTNd( dynamic_cast<SwTxtNode*>(pCNd) );
-// ASSERT( pTNd,
-// "<lcl_SetTxtFmtColl(..)> - text node expected -> crash" );
-// SwRegHistory aRegH( pTNd, *pTNd, pPara->pHistory );
-// pCNd->ResetAttr( RES_PARATR_NUMRULE );
-// }
-// else
-// {
-// pCNd->ResetAttr( RES_PARATR_NUMRULE );
-// }
- std::auto_ptr< SwRegHistory > pRegH;
- if ( pPara->pHistory )
+ // --> OD 2009-09-07 #b6876367#
+ // Check, if the list style of the paragraph will change.
+ bool bChangeOfListStyleAtParagraph( true );
+ SwTxtNode* pTNd( dynamic_cast<SwTxtNode*>(pCNd) );
+ ASSERT( pTNd,
+ "<lcl_SetTxtFmtColl(..)> - text node expected -> crash" );
{
- SwTxtNode* pTNd( dynamic_cast<SwTxtNode*>(pCNd) );
- ASSERT( pTNd,
- "<lcl_SetTxtFmtColl(..)> - text node expected -> crash" );
- pRegH.reset( new SwRegHistory( pTNd, *pTNd, pPara->pHistory ) );
+ SwNumRule* pNumRuleAtParagraph( pTNd->GetNumRule() );
+ if ( pNumRuleAtParagraph )
+ {
+ const SwNumRuleItem& rNumRuleItemAtParagraphStyle =
+ pFmt->GetNumRule();
+ if ( rNumRuleItemAtParagraphStyle.GetValue() ==
+ pNumRuleAtParagraph->GetName() )
+ {
+ bChangeOfListStyleAtParagraph = false;
+ }
+ }
}
- pCNd->ResetAttr( RES_PARATR_NUMRULE );
+ if ( bChangeOfListStyleAtParagraph )
+ {
+ // --> OD 2008-04-08 #refactorlists#
+ std::auto_ptr< SwRegHistory > pRegH;
+ if ( pPara->pHistory )
+ {
+ pRegH.reset( new SwRegHistory( pTNd, *pTNd, pPara->pHistory ) );
+ }
+
+ pCNd->ResetAttr( RES_PARATR_NUMRULE );
- // reset all list attributes
- pCNd->ResetAttr( RES_PARATR_LIST_LEVEL );
- pCNd->ResetAttr( RES_PARATR_LIST_ISRESTART );
- pCNd->ResetAttr( RES_PARATR_LIST_RESTARTVALUE );
- pCNd->ResetAttr( RES_PARATR_LIST_ISCOUNTED );
- pCNd->ResetAttr( RES_PARATR_LIST_ID );
+ // reset all list attributes
+ pCNd->ResetAttr( RES_PARATR_LIST_LEVEL );
+ pCNd->ResetAttr( RES_PARATR_LIST_ISRESTART );
+ pCNd->ResetAttr( RES_PARATR_LIST_RESTARTVALUE );
+ pCNd->ResetAttr( RES_PARATR_LIST_ISCOUNTED );
+ pCNd->ResetAttr( RES_PARATR_LIST_ID );
+ }
+ // <--
}
// <--
}
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 5dcb604..1c53fea 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -1160,6 +1160,10 @@ void SwSectionFrm::SimpleFormat()
SWRECTFN( this )
if( GetPrev() || GetUpper() )
{
+ // --> OD 2009-09-28 #b6882166#
+ // assure notifications on position changes.
+ const SwLayNotify aNotify( this );
+ // <--
(this->*fnRect->fnMakePos)( GetUpper(), GetPrev(), FALSE );
bValidPos = TRUE;
}
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 7fbb6ba..b403984 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -158,7 +158,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
const SwTxtNode *pNode = pFrm->GetTxtNode();
const SvxLRSpaceItem &rSpace = pFrm->GetTxtNode()->GetSwAttrSet().GetLRSpace();
- // --> OD 2009-09-02 #i95907#
+ // --> OD 2009-09-08 #i95907#, #b6879723#
const bool bListLevelIndentsApplicable = pFrm->GetTxtNode()->AreListLevelIndentsApplicable();
// <--
@@ -183,7 +183,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
pFrm->Prt().Left() +
nLMWithNum -
pNode->GetLeftMarginWithNum( sal_False ) -
- // --> OD 2009-09-02 #i95907#
+ // --> OD 2009-09-08 #i95907#, #b6879723#
// rSpace.GetLeft() +
// rSpace.GetTxtLeft();
( bListLevelIndentsApplicable
@@ -193,14 +193,18 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
}
else
{
- if ( !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
+ // --> OD 2009-09-08 #i95907#, #b6879723#
+// if ( !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
+ if ( bListLevelIndentsApplicable ||
+ !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
+ // <--
{
// this calculation is identical this the calculation for R2L layout - see above
nLeft = pFrm->Frm().Left() +
pFrm->Prt().Left() +
nLMWithNum -
pNode->GetLeftMarginWithNum( sal_False ) -
- // --> OD 2009-09-02 #i95907#
+ // --> OD 2009-09-08 #i95907#, #b6879723#
// rSpace.GetLeft() +
// rSpace.GetTxtLeft();
( bListLevelIndentsApplicable
@@ -223,7 +227,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
// paras inside cells inside new documents:
( pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) ||
!pFrm->IsInTab() ||
- !nLMWithNum) )
+ !nLMWithNum ) )
// <--
{
nLeft = pFrm->Prt().Left() + pFrm->Frm().Left();
@@ -235,8 +239,8 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
nFirst = nLeft;
else
{
- short nFLOfst;
- long nFirstLineOfs;
+ short nFLOfst = 0;
+ long nFirstLineOfs = 0;
if( !pNode->GetFirstLineOfsWithNum( nFLOfst ) &&
rSpace.IsAutoFirst() )
{
@@ -290,8 +294,13 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
else
nFirstLineOfs = nFLOfst;
+ // --> OD 2009-09-08 #i95907#, #b6879723#
+// if ( pFrm->IsRightToLeft() ||
+// !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
if ( pFrm->IsRightToLeft() ||
- !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
+ bListLevelIndentsApplicable ||
+ !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
+ // <--
{
nFirst = nLeft + nFirstLineOfs;
}
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 7930190..84e650d 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -2852,6 +2852,9 @@ long SwTxtNode::GetLeftMarginWithNum( BOOL bTxtLeft ) const
BOOL SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const
{
BOOL bRet( FALSE );
+ // --> OD 2009-09-08 #i95907#, #b6879723#
+ rFLOffset = 0;
+ // <--
// --> OD 2005-11-02 #i51089 - TUNING#
const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
@@ -2885,8 +2888,6 @@ BOOL SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const
}
// <--
}
- else
- rFLOffset = 0;
bRet = TRUE;
}
diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx
index 2f7716b..d5315fb 100644
--- a/sw/source/ui/uno/unomod.cxx
+++ b/sw/source/ui/uno/unomod.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -576,17 +576,17 @@ void SwXPrintSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo,
break;
case HANDLE_PRINTSET_PROSPECT_RTL:
{
- rValue <<= mpPrtOpt->IsPrintProspect_RTL();
+ bBoolVal = mpPrtOpt->IsPrintProspect_RTL();
}
break;
case HANDLE_PRINTSET_PLACEHOLDER:
{
- rValue <<= mpPrtOpt->IsPrintTextPlaceholder();
+ bBoolVal = mpPrtOpt->IsPrintTextPlaceholder();
}
break;
case HANDLE_PRINTSET_HIDDEN_TEXT:
{
- rValue <<= mpPrtOpt->IsPrintHiddenText();
+ bBoolVal = mpPrtOpt->IsPrintHiddenText();
}
break;
default:
@@ -823,7 +823,7 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c
break;
case HANDLE_VIEWSET_HORI_RULER_METRIC:
case HANDLE_VIEWSET_VERT_RULER_METRIC:
- {
+ {
sal_Int32 nUnit = -1;
if( rValue >>= nUnit )
switch( nUnit )
@@ -844,9 +844,9 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c
mbApplyVRulerMetric = sal_True;
}
break;
- default:
+ default:
throw IllegalArgumentException();
- }
+ }
}
break;
default:
@@ -862,17 +862,17 @@ void SwXViewSettings::_postSetValues ()
if(mbApplyZoom )
pView->SetZoom( (SvxZoomType)mpViewOption->GetZoomType(),
mpViewOption->GetZoom(), sal_True );
- if(mbApplyHRulerMetric)
+ if(mbApplyHRulerMetric)
pView->ChangeTabMetric((FieldUnit)eHRulerUnit);
- if(mbApplyVRulerMetric)
+ if(mbApplyVRulerMetric)
pView->ChangeVLinealMetric((FieldUnit)eVRulerUnit);
-
+
}
else
{
- if(mbApplyHRulerMetric)
+ if(mbApplyHRulerMetric)
SW_MOD()->ApplyRulerMetric( (FieldUnit)eHRulerUnit, sal_True, bWeb );
- if(mbApplyVRulerMetric)
+ if(mbApplyVRulerMetric)
SW_MOD()->ApplyRulerMetric( (FieldUnit)eVRulerUnit, sal_False, bWeb );
}
@@ -880,7 +880,7 @@ void SwXViewSettings::_postSetValues ()
SW_MOD()->ApplyUsrPref( *mpViewOption, pView, pView ? VIEWOPT_DEST_VIEW_ONLY
: bWeb ? VIEWOPT_DEST_WEB
: VIEWOPT_DEST_TEXT );
-
+
delete mpViewOption;
mpViewOption = NULL;
@@ -1004,7 +1004,7 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u
}
break;
case HANDLE_VIEWSET_HORI_RULER_METRIC:
- {
+ {
if ( pView )
{
FieldUnit eUnit;
@@ -1015,12 +1015,12 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u
{
const SwMasterUsrPref* pUsrPref = SW_MOD()->GetUsrPref( bWeb );
rValue <<= (sal_Int32)pUsrPref->GetHScrollMetric();
- }
+ }
bBool = sal_False;
}
break;
case HANDLE_VIEWSET_VERT_RULER_METRIC:
- {
+ {
if ( pView )
{
FieldUnit eUnit;
@@ -1031,7 +1031,7 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u
{
const SwMasterUsrPref* pUsrPref = SW_MOD()->GetUsrPref( bWeb );
rValue <<= (sal_Int32)pUsrPref->GetVScrollMetric();
- }
+ }
bBool = sal_False;
}
break;
commit 110cdebe9e63efeac995dedd931772ddfffdd320
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date: Wed Oct 28 14:40:57 2009 +0000
CWS-TOOLING: integrate CWS writerfilter32bugfixes01
2009-10-16 10:25:35 +0200 os r276956 : warning fixed
2009-10-16 10:18:35 +0200 os r276954 : using namespace std removed from headers
2009-10-16 10:18:19 +0200 os r276953 : using namespace std removed from headers
2009-10-16 10:17:35 +0200 os r276952 : using namespace std removed from headers
2009-10-14 12:14:16 +0200 cedricbosdo r276890 : Fixed warnings
2009-10-09 08:36:35 +0200 cedricbosdo r276796 : Rebased to OOO320_m1
2009-10-05 11:32:53 +0200 cedricbosdo r276668 : * Fixed namespace_preprocess for windows build
* Removed some unused variable
* Set a default value for GetCurrentToken
2009-09-07 13:05:30 +0200 os r275892 : #i104155# support for empty URLs if called from writerfilter re-introduced
2009-09-04 14:36:14 +0200 cedricbosdo r275803 : CWS-TOOLING: rebase CWS writerfilter32bugfixes01 to trunk at 275331 (milestone: DEV300:m56)
2009-05-15 17:36:28 +0200 cedricbosdo r271958 : Added file to test docx numbering import fixes
2009-05-15 17:28:27 +0200 cedricbosdo r271955 : * Implemented a VML import basis.
* Fixed some docx numbering import bugs
* Implemented docx outline style import
2009-03-16 11:42:06 +0100 hbrinkm r269515 : moved clog inside #ifdef
2009-03-13 18:30:14 +0100 cedricbosdo r269493 : Fixed a dummy paragraph ending problem
2009-03-13 13:57:58 +0100 cedricbosdo r269477 : Added the missing headers
2009-03-13 12:03:25 +0100 cedricbosdo r269466 : Fixed i#93786 and i#100176
2009-03-12 11:39:10 +0100 cedricbosdo r269377 : Fixed a crash in the redlines patch
2009-03-12 10:11:48 +0100 cedricbosdo r269362 : Fixes for the docx import
2009-03-12 10:10:37 +0100 cedricbosdo r269361 : docx import fixes for:
+ tables styles
+ pictures positionning
+ redlines
Started to implement the docx settings.xml import
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 75d0dd1..24c7a2f 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -312,6 +312,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
#ifndef PRODUCT
SwRedline aCopy( *pNewRedl );
#endif
+ bool bError = true;
_CHECK_REDLINE( this )
if( IsRedlineOn() && !IsShowOriginal( eRedlineMode ) &&
@@ -431,6 +432,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
pRedlineTbl->Insert( pRedl );
}
+ bError = false;
bDelete = true;
}
else if( (( POS_BEFORE == eCmpPos &&
@@ -446,6 +448,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
pRedlineTbl->Remove( n );
pRedlineTbl->Insert( pRedl );
+ bError = false;
bDelete = true;
}
else if ( POS_OUTSIDE == eCmpPos )
@@ -1108,7 +1111,8 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
case POS_EQUAL:
case POS_INSIDE:
- delete pNewRedl, pNewRedl = 0;
+ // TODO Check if there is any side effect
+ //delete pNewRedl, pNewRedl = 0;
break;
case POS_OUTSIDE:
@@ -1271,7 +1275,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
}
_CHECK_REDLINE( this )
- return 0 != pNewRedl;
+ return ( 0 != pNewRedl ) || !bError;
}
void SwDoc::CompressRedlines()
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 8f01680..afab878 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1322,7 +1322,8 @@ SwTableNode* SwNodes::TextToTable( const std::vector< std::vector<SwNodeRange> >
SwTxtNode& rTxtNode = static_cast<SwTxtNode&>(rNode);
// setze den bei allen TextNode in der Tabelle den TableNode
// als StartNode
- rTxtNode.pStartOfSection = pTblNd;
+// FIXME: this is setting wrong node StartOfSections in nested tables.
+// rTxtNode.pStartOfSection = pTblNd;
// remove PageBreaks/PageDesc/ColBreak
const SwAttrSet* pSet = rTxtNode.GetpSwAttrSet();
if( pSet )
@@ -1401,7 +1402,6 @@ SwTableNode* SwNodes::TextToTable( const std::vector< std::vector<SwNodeRange> >
aCellNodeIdx = SwNodeIndex( *aCellNodeIdx.GetNode().EndOfSectionNode() );
}
-
// Section der Box zuweisen
pBox = new SwTableBox( pBoxFmt, *pSttNd, pLine );
pLine->GetTabBoxes().C40_INSERT( SwTableBox, pBox, nBoxes++ );
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index b3d17e8..08c22ac 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -1032,9 +1032,11 @@ void makeRedline( SwPaM& rPaM,
}
SwRedline* pRedline = new SwRedline( aRedlineData, rPaM );
+ RedlineMode_t nPrevMode = pRedlineAccess->GetRedlineMode( );
+
pRedlineAccess->SetRedlineMode_intern(nsRedlineMode_t::REDLINE_ON);
bool bRet = pRedlineAccess->AppendRedline( pRedline, false );
- pRedlineAccess->SetRedlineMode_intern(nsRedlineMode_t::REDLINE_NONE);
+ pRedlineAccess->SetRedlineMode_intern( nPrevMode );
if( !bRet )
throw lang::IllegalArgumentException();
}
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 0abfc68..a88f0a2 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -2117,6 +2117,7 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange)
OTextCursorHelper* pCursor = 0;
SwXTextPortion* pPortion = 0;
SwXText* pText = 0;
+ SwXParagraph* pParagraph = 0;
pRange = reinterpret_cast< SwXTextRange * >(
sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) ));
@@ -2126,6 +2127,8 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange)
sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) ));
pPortion = reinterpret_cast< SwXTextPortion * >(
sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextPortion::getUnoTunnelId()) ));
+ pParagraph = reinterpret_cast< SwXParagraph * >(
+ sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXParagraph::getUnoTunnelId( ) ) ) );
if (pRange)
pDoc = pRange->GetDoc();
@@ -2137,6 +2140,8 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange)
{
pDoc = pPortion->GetCursor()->GetDoc();
}
+ else if ( !pDoc && pParagraph && pParagraph->GetTxtNode( ) )
+ pDoc = pParagraph->GetTxtNode( )->GetDoc( );
}
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 36dd9cc..0cf7fe8 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -1192,6 +1192,12 @@ SwXTextRange::SwXTextRange(SwFrmFmt& rTblFmt) :
m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)),
pMark(NULL)
{
+ SwTable* pTable = SwTable::FindTable( &rTblFmt );
+ SwTableNode* pTblNode = pTable->GetTableNode( );
+ SwPosition aPosition( *pTblNode );
+ SwPaM aPam( aPosition );
+
+ _CreateNewBookmark( aPam );
}
SwXTextRange::~SwXTextRange()
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 73d08d7..0373d88 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -66,6 +66,8 @@
#include <memory>
#include <stdlib.h>
+#include <iostream>
+
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -1827,19 +1829,11 @@ uno::Reference< text::XTextTable > SwXText::convertToTable(
*/
if(aStartCellPam.Start()->nNode < aEndCellPam.End()->nNode)
{
- const SwNode& rStartNode = aStartCellPam.Start()->nNode.GetNode();
- if(!rStartNode.IsTxtNode() ||
- !aEndCellPam.End()->nNode.GetNode().IsTxtNode())
- {
- //start and end of the cell must be on a SwTxtNode
- bExcept = true;
- break;
- }
// increment on each StartNode and decrement on each EndNode
// we must reach zero at the end and must not go below zero
long nOpenNodeBlock = 0;
SwNodeIndex aCellIndex = aStartCellPam.Start()->nNode;
- while( ++aCellIndex < aEndCellPam.End()->nNode.GetIndex())
+ while( aCellIndex < aEndCellPam.End()->nNode.GetIndex())
{
if( aCellIndex.GetNode().IsStartNode() )
++nOpenNodeBlock;
@@ -1850,6 +1844,7 @@ uno::Reference< text::XTextTable > SwXText::convertToTable(
bExcept = true;
break;
}
+ ++aCellIndex;
}
if( nOpenNodeBlock != 0)
{
@@ -1895,7 +1890,9 @@ uno::Reference< text::XTextTable > SwXText::convertToTable(
//node border anyway
}
else
+ {
bExcept = true;
+ }
}
//now check if there's a need to insert another paragraph break
if( aEndCellPam.End()->nContent.GetIndex() < aEndCellPam.End()->nNode.GetNode().GetTxtNode()->Len())
@@ -1952,7 +1949,22 @@ uno::Reference< text::XTextTable > SwXText::convertToTable(
const beans::PropertyValue* pTableProperties = rTableProperties.getConstArray();
sal_Int32 nProperty = 0;
for( ; nProperty < rTableProperties.getLength(); ++nProperty)
- xPrSet->setPropertyValue( pTableProperties[nProperty].Name, pTableProperties[nProperty].Value );
+ {
+ try
+ {
+ xPrSet->setPropertyValue( pTableProperties[nProperty].Name, pTableProperties[nProperty].Value );
+ }
+ catch ( const uno::Exception e )
+ {
+#if DEBUG
+ std::clog << "Exception when setting property: ";
+ std::clog << rtl::OUStringToOString( pTableProperties[nProperty].Name, RTL_TEXTENCODING_UTF8 ).getStr( );
+ std::clog << ". Message: ";
+ std::clog << rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr( );
+ std::clog << std::endl;
+#endif
+ }
+ }
//apply row properties
uno::Reference< table::XTableRows > xRows = xRet->getRows();
@@ -2009,6 +2021,7 @@ uno::Reference< text::XTextTable > SwXText::convertToTable(
//--<
#endif
+
//apply cell properties
for( nRow = 0; nRow < rCellProperties.getLength(); ++nRow)
{
@@ -2021,7 +2034,8 @@ uno::Reference< text::XTextTable > SwXText::convertToTable(
uno::Reference< beans::XPropertySet > xCell( pTextTable->getCellByPosition(nCell, nRow), uno::UNO_QUERY );
for( nProperty = 0; nProperty < nCellProperties; ++nProperty)
{
- if(aCellProperties[nProperty].Name.equalsAsciiL(
+ const OUString& rName = aCellProperties[nProperty].Name;
+ if( rName.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM ( "VerticalMerge")))
{
//determine left border position
@@ -2084,8 +2098,24 @@ uno::Reference< text::XTextTable > SwXText::convertToTable(
}
}
}
- else
- xCell->setPropertyValue(aCellProperties[nProperty].Name, aCellProperties[nProperty].Value);
+ else
+ {
+ try
+ {
+ xCell->setPropertyValue(rName, aCellProperties[nProperty].Value);
+ }
+ catch ( const uno::Exception e )
+ {
+ // Apply the paragraph and char properties to the cell's content
+ uno::Reference< text::XText > xCellText( xCell, uno::UNO_QUERY );
+ uno::Reference< text::XTextCursor > xCellCurs = xCellText->createTextCursor( );
+ xCellCurs->gotoStart( false );
+ xCellCurs->gotoEnd( true );
+
+ uno::Reference< beans::XPropertySet > xCellTextProps( xCellCurs, uno::UNO_QUERY );
+ xCellTextProps->setPropertyValue( rName, aCellProperties[nProperty].Value );
+ }
+ }
}
}
}
More information about the ooo-build-commit
mailing list