summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJian Fang Zhang <zhangjf@apache.org>2012-09-12 11:19:10 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-05-31 13:58:08 +0100
commit0181f258e5598ee59b1c4847818944b8da16bd51 (patch)
tree36a8dae21eb74c0981d167407c81acd4cde40fcc
parent0f33ad3847da22350e69fd998d7494e4334c1ed9 (diff)
Resolves: #i119558# set default page mode value to false for docx
To avoid default page mode affect the calculation of table row height Found by: xiao ting xiao, tingxiaox@gmail.com Patch by: zhaoshzh, aoo.zhaoshzh@gmail.com Review by: zhangjf (cherry picked from commit 28e1cb1240e7c7a274a04756c7cab2f5797de400) Conflicts: sw/inc/unomap.hxx sw/inc/unoprnms.hxx sw/source/core/unocore/unomap.cxx sw/source/core/unocore/unoprnms.cxx sw/source/ui/uno/unotxdoc.cxx writerfilter/source/dmapper/PropertyIds.cxx Change-Id: I41745eb9d727a5ae87d34872f9dc3f4442c7bc8d
-rw-r--r--sw/inc/unomap.hxx3
-rw-r--r--sw/inc/unoprnms.hxx4
-rw-r--r--sw/source/core/unocore/unomap.cxx1
-rw-r--r--sw/source/core/unocore/unoprnms.cxx1
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx8
-rw-r--r--writerfilter/source/dmapper/PropertyIds.cxx1
-rw-r--r--writerfilter/source/dmapper/PropertyIds.hxx1
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx26
8 files changed, 30 insertions, 15 deletions
diff --git a/sw/inc/unomap.hxx b/sw/inc/unomap.hxx
index 7f130a210a8a..128570c3b1ee 100644
--- a/sw/inc/unomap.hxx
+++ b/sw/inc/unomap.hxx
@@ -237,7 +237,8 @@
#define WID_DOC_LOCK_UPDATES 1016
#define WID_DOC_HAS_VALID_SIGNATURES 1017
#define WID_DOC_BUILDID 1024
-#define WID_DOC_ISTEMPLATEID 1025
+#define WID_DOC_ISTEMPLATEID 1025
+#define WID_DOC_DEFAULT_PAGE_MODE 1069
// MailMerge
#define WID_SELECTION 1071
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 42027aff2028..fb6e9d372adf 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -820,7 +820,9 @@ enum SwPropNameIds
/* 0758 */ UNO_NAME_FILL_GRADIENT,
/* 0759 */ UNO_NAME_FILL_GRADIENT_NAME,
-/* 0760 */ SW_PROPNAME_END
+/* 0760 */ UNO_NAME_DEFAULT_PAGE_MODE,
+
+/* 0761 */ SW_PROPNAME_END
// new items in this array must match SwPropNameTab aPropNameTab
};
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 5f3cfc282fec..a9bf548d72c2 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -1559,6 +1559,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_LOCK_UPDATES), WID_DOC_LOCK_UPDATES, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_HAS_VALID_SIGNATURES), WID_DOC_HAS_VALID_SIGNATURES, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::READONLY, 0},
{ SW_PROP_NMID(UNO_NAME_BUILDID), WID_DOC_BUILDID, CPPU_E2T(CPPUTYPE_OUSTRING), 0, 0},
+ { SW_PROP_NMID(UNO_NAME_DEFAULT_PAGE_MODE), WID_DOC_DEFAULT_PAGE_MODE, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
{0,0,0,0,0,0}
};
aMapEntriesArr[nPropertyId] = aDocMap_Impl;
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index f1e0f196a4d0..f28e927ee4cf 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -789,6 +789,7 @@ const SwPropNameTab aPropNameTab = {
/* 0757 UNO_NAME_FILL_STYLE */ {MAP_CHAR_LEN("FillStyle")},
/* 0758 UNO_NAME_FILL_GRADIENT */ {MAP_CHAR_LEN("FillGradient")},
/* 0759 UNO_NAME_FILL_GRADIENT_NAME */ {MAP_CHAR_LEN("FillGradientName")},
+/* 0760 UNO_NAME_DEFAULT_PAGE_MODE */ {MAP_CHAR_LEN("DefaultPageMode")}
// new items in this array must match enum SwPropNameIds
};
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index f8d33f0ce148..84e2930e497b 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -1991,6 +1991,14 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName,
aValue >>= maBuildId;
break;
+ case WID_DOC_DEFAULT_PAGE_MODE:
+ {
+ bool bDefaultPageMode( false );
+ aValue >>= bDefaultPageMode;
+ pDocShell->GetDoc()->SetDefaultPageMode( bDefaultPageMode );
+ }
+ break;
+
default:
{
const SfxPoolItem& rItem = pDocShell->GetDoc()->GetDefault(pEntry->nWID);
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx
index 86438b9a6fc3..e506ee83ab91 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -228,6 +228,7 @@ const OUString& PropertyNameSupplier::GetName( PropertyIds eId ) const
case PROP_GRID_LINES : sName = "GridLines"; break;
case PROP_GRID_BASE_HEIGHT : sName = "GridBaseHeight"; break;
case PROP_GRID_RUBY_HEIGHT : sName = "GridRubyHeight"; break;
+ case PROP_GRID_STANDARD_MODE : sName = "StandardPageMode"; break;
case PROP_IS_ON : sName = "IsOn"; break;
case PROP_RESTART_AT_EACH_PAGE : sName = "RestartAtEachPage"; break;
case PROP_COUNT_EMPTY_LINES : sName = "CountEmptyLines"; break;
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx
index 3467321903a9..1c6b83e3a243 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -276,6 +276,7 @@ enum PropertyIds
,PROP_USER_DATA_TYPE
,PROP_VERTICAL_MERGE
,PROP_VERT_MIRRORED
+/*254*/ ,PROP_GRID_STANDARD_MODE
,PROP_VERT_ORIENT
,PROP_VERT_ORIENT_POSITION
,PROP_VERT_ORIENT_RELATION
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 9de69fce6568..ebd54970810c 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -990,21 +990,21 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
nRubyHeight = 0;
operator[]( PropertyDefinition( PROP_GRID_RUBY_HEIGHT, false )) = uno::makeAny( nRubyHeight );
- sal_Int16 nGridMode = text::TextGridMode::NONE;
-
- switch (m_nGridType)
+ // #i119558#, force to set document as standard page mode,
+ // refer to ww8 import process function "SwWW8ImplReader::SetDocumentGrid"
+ try
{
- case NS_ooxml::LN_Value_wordprocessingml_ST_DocGrid_lines:
- nGridMode = text::TextGridMode::LINES;
- break;
- case NS_ooxml::LN_Value_wordprocessingml_ST_DocGrid_linesAndChars:
- nGridMode = text::TextGridMode::LINES_AND_CHARS;
- break;
- default:
- break;
+ uno::Reference< beans::XPropertySet > xDocProperties;
+ xDocProperties = uno::Reference< beans::XPropertySet >( rDM_Impl.GetTextDocument(), uno::UNO_QUERY_THROW );
+ sal_Bool bSquaredPageMode = sal_False;
+ operator[]( PropertyDefinition( PROP_GRID_STANDARD_MODE, false )) = uno::makeAny( !bSquaredPageMode );
+ xDocProperties->setPropertyValue( OUString("DefaultPageMode"), uno::makeAny( bSquaredPageMode ));
+ }
+ catch (const uno::Exception& rEx)
+ {
+ OSL_ENSURE( false, "Exception in SectionPropertyMap::CloseSectionGroup");
+ (void)rEx;
}
-
- operator[](PropertyDefinition(PROP_GRID_MODE, false)) = uno::makeAny(nGridMode);
if (rDM_Impl.IsNewDoc())
_ApplyProperties( xFollowPageStyle );