summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorTushar Bende <tushar.bende@synerzip.com>2014-05-30 11:12:54 +0530
committerMichael Stahl <mstahl@redhat.com>2014-05-30 21:13:00 +0200
commitd9b607664f25c206c37dc3e9a68e94e55bd272c1 (patch)
tree9219d13383bf1251a17fb7b3440dfa3182a40a23 /writerfilter
parent16e299afa4051affc357fe7990d7632b37c6aea7 (diff)
fdo#78883: Writer getting Hang while opening document
Description: Writer getting Hang while opening document because of loop in layout. Root cause: For Documents containing table with direct formatting for Para line spacing along with style w:type="table" in style.xml LO was erasing PROP_PARA_LINE_SPACING Prop from pAllCellProps in DomainMapperTableHandler::endTableGetCellProperties(). But for Documents without direct formatting for Para line spacing this deletion was causing problem, as after deletion there is no formatting available to apply. To fix this checking whether there is a Direct formatting available for table, if Yes then proceed with this deletion logic. Change-Id: Ibaf51ebd1aca93eff44a9edfbe8fa13832ab2b70 Signed-off-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 489611732319dec36ec630f6bfffd0c6ff03b9bf)
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx5
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx12
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx11
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.hxx5
4 files changed, 30 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 09470c53d27d..0a958d43f250 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -393,6 +393,11 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
}
if( nName == NS_ooxml::LN_CT_Spacing_line )
{
+ if( m_pImpl->getTableManager().isInCell() )
+ {
+ // direct formatting is applied for table cell data
+ m_pImpl->SetIsTableHasDirectFormatting(true);
+ }
m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "line", OUString::number(nIntValue));
//now set the value depending on the Mode
if( aSpacing.Mode == style::LineSpacingMode::PROP )
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 49ea9ac62dc9..57bbd32388f9 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -757,9 +757,15 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
if ( aDefaultRepeatIt != pAllCellProps->end( ) )
pAllCellProps->erase( aDefaultRepeatIt );
- aDefaultRepeatIt = pAllCellProps->find(PROP_PARA_LINE_SPACING);
- if ( aDefaultRepeatIt != pAllCellProps->end( ) )
- pAllCellProps->erase( aDefaultRepeatIt );
+ if( m_rDMapper_Impl.GetIsTableHasDirectFormatting() )
+ {
+ // Bug#78883 : direct formatting is applied for table cell data
+ // so we can erase para line spacing property from style.xml
+ aDefaultRepeatIt = pAllCellProps->find(PROP_PARA_LINE_SPACING);
+ if ( aDefaultRepeatIt != pAllCellProps->end( ) )
+ pAllCellProps->erase( aDefaultRepeatIt );
+ m_rDMapper_Impl.SetIsTableHasDirectFormatting(false);
+ }
aDefaultRepeatIt = pAllCellProps->find(PROP_TBL_HEADER);
if ( aDefaultRepeatIt != pAllCellProps->end( ) )
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 816e85d44065..5078760f65ce 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -187,6 +187,7 @@ DomainMapper_Impl::DomainMapper_Impl(
m_bUsingEnhancedFields( false ),
m_bSdt(false),
m_bIsFirstRun(false),
+ m_bIsTableHasDirectFormatting(false),
m_xAnnotationField(),
m_nAnnotationId( -1 ),
m_aAnnotationPositions(),
@@ -450,6 +451,16 @@ bool DomainMapper_Impl::GetSdt()
return m_bSdt;
}
+void DomainMapper_Impl::SetIsTableHasDirectFormatting(bool bIsTableHasDirectFormatting)
+{
+ m_bIsTableHasDirectFormatting = bIsTableHasDirectFormatting;
+}
+
+bool DomainMapper_Impl::GetIsTableHasDirectFormatting()
+{
+ return m_bIsTableHasDirectFormatting;
+}
+
bool DomainMapper_Impl::GetParaChanged()
{
return m_bParaChanged;
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index f2d61e0c33af..74ff7845abf3 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -387,6 +387,7 @@ private:
/// If the current paragraph is inside a structured document element.
bool m_bSdt;
bool m_bIsFirstRun;
+ bool m_bIsTableHasDirectFormatting;
css::uno::Reference< css::text::XTextCursor > xTOCMarkerCursor;
css::uno::Reference< css::text::XTextCursor > mxTOCTextCursor;
@@ -472,6 +473,10 @@ public:
void SetSdt(bool bSdt);
/// Getter method for m_bSdt.
bool GetSdt();
+ /// Getter method for m_bIsTableHasDirectFormatting
+ bool GetIsTableHasDirectFormatting();
+ /// Setter method for m_bIsTableHasDirectFormatting
+ void SetIsTableHasDirectFormatting(bool bIsTableHasDirectFormatting);
bool GetParaChanged();
void deferBreak( BreakType deferredBreakType );