incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhan...@apache.org
Subject svn commit: r1383908 - in /incubator/ooo/trunk/main: sw/inc/ sw/source/core/unocore/ sw/source/ui/uno/ writerfilter/source/dmapper/
Date Wed, 12 Sep 2012 12:19:11 GMT
Author: zhangjf
Date: Wed Sep 12 12:19:10 2012
New Revision: 1383908

URL: http://svn.apache.org/viewvc?rev=1383908&view=rev
Log:
#i119558#, set SwDoc default page mode value to false when import MS 2007 docx file  

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

Modified:
    incubator/ooo/trunk/main/sw/inc/unomap.hxx
    incubator/ooo/trunk/main/sw/inc/unoprnms.hxx
    incubator/ooo/trunk/main/sw/source/core/unocore/unomap.cxx
    incubator/ooo/trunk/main/sw/source/core/unocore/unoprnms.cxx
    incubator/ooo/trunk/main/sw/source/ui/uno/unotxdoc.cxx
    incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyIds.cxx
    incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyIds.hxx
    incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyMap.cxx

Modified: incubator/ooo/trunk/main/sw/inc/unomap.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/inc/unomap.hxx?rev=1383908&r1=1383907&r2=1383908&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/inc/unomap.hxx (original)
+++ incubator/ooo/trunk/main/sw/inc/unomap.hxx Wed Sep 12 12:19:10 2012
@@ -247,6 +247,7 @@
 #define WID_DOC_HAS_VALID_SIGNATURES            1017
 #define WID_DOC_BUILDID							1024
 #define WID_DOC_ISTEMPLATEID						1025
+#define WID_DOC_DEFAULT_PAGE_MODE					1069
 // --> OD 2006-03-21 #b6375613#
 #define WID_APPLY_WORKAROUND_FOR_B6375613       1070
 // <--

Modified: incubator/ooo/trunk/main/sw/inc/unoprnms.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/inc/unoprnms.hxx?rev=1383908&r1=1383907&r2=1383908&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/inc/unoprnms.hxx (original)
+++ incubator/ooo/trunk/main/sw/inc/unoprnms.hxx Wed Sep 12 12:19:10 2012
@@ -805,8 +805,9 @@ enum SwPropNameIds
 /* 0740 */  UNO_NAME_EMBEDDED_OBJECT,
 
 /* 0741 */	UNO_NAME_REPLACEMENT_GRAPHIC_URL,
+/* 0742 */	UNO_NAME_DEFAULT_PAGE_MODE,
 
-/* 0742 */  SW_PROPNAME_END
+/* 0743 */  SW_PROPNAME_END
 };
 
 

Modified: incubator/ooo/trunk/main/sw/source/core/unocore/unomap.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/unocore/unomap.cxx?rev=1383908&r1=1383907&r2=1383908&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/unocore/unomap.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/unocore/unomap.cxx Wed Sep 12 12:19:10 2012
@@ -1597,6 +1597,7 @@ const SfxItemPropertyMapEntry* SwUnoProp
 					{ SW_PROP_NMID(UNO_NAME_BUILDID), WID_DOC_BUILDID, CPPU_E2T(CPPUTYPE_OUSTRING), 0, 0},
                     // --> OD 2006-03-21 #b6375613#
                     { SW_PROP_NMID(UNO_NAME_APPLY_WORKAROUND_FOR_B6375613), WID_APPLY_WORKAROUND_FOR_B6375613,
CPPU_E2T(CPPUTYPE_BOOLEAN), 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}
 				};

Modified: incubator/ooo/trunk/main/sw/source/core/unocore/unoprnms.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/unocore/unoprnms.cxx?rev=1383908&r1=1383907&r2=1383908&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/unocore/unoprnms.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/unocore/unoprnms.cxx Wed Sep 12 12:19:10 2012
@@ -777,6 +777,7 @@ const SwPropNameTab aPropNameTab = {
 /* 0739 UNO_NAME_NESTED_TEXT_CONTENT */ {MAP_CHAR_LEN("NestedTextContent")},
 /* 0740 UNO_NAME_EMBEDDED_OBJECT */ {MAP_CHAR_LEN("EmbeddedObject")},
 /* 0741 UNO_NAME_REPLACEMENT_GRAPHIC_URL */ {MAP_CHAR_LEN("ReplacementGraphicURL")},
+/* 0742 UNO_NAME_DEFAULT_PAGE_MODE */	 {MAP_CHAR_LEN("DefaultPageMode")}
 };
 
 const SwPropNameLen& SwGetPropName( sal_uInt16 nId )

Modified: incubator/ooo/trunk/main/sw/source/ui/uno/unotxdoc.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/ui/uno/unotxdoc.cxx?rev=1383908&r1=1383907&r2=1383908&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/ui/uno/unotxdoc.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/ui/uno/unotxdoc.cxx Wed Sep 12 12:19:10 2012
@@ -2144,6 +2144,13 @@ void SwXTextDocument::setPropertyValue(c
         }
         break;
         // <--
+        case WID_DOC_DEFAULT_PAGE_MODE:
+        {
+            bool bDefaultPageMode( false );
+            aValue >>= bDefaultPageMode;
+            pDocShell->GetDoc()->SetDefaultPageMode( bDefaultPageMode );
+        }
+        break;
 
         default:
 		{

Modified: incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyIds.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyIds.cxx?rev=1383908&r1=1383907&r2=1383908&view=diff
==============================================================================
--- incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyIds.cxx (original)
+++ incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyIds.cxx Wed Sep 12 12:19:10
2012
@@ -237,6 +237,7 @@ const rtl::OUString& PropertyNameSupplie
             case PROP_GRID_LINES            :    sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GridLines"));
break;
             case PROP_GRID_BASE_HEIGHT      :    sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GridBaseHeight"));
break;
             case PROP_GRID_RUBY_HEIGHT      :    sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GridRubyHeight"));
break;
+            case PROP_GRID_STANDARD_MODE     :    sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StandardPageMode"));
break;
             case PROP_IS_ON                  :    sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsOn"));
break;
             case PROP_RESTART_AT_EACH_PAGE   :    sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RestartAtEachPage"));
break;
             case PROP_COUNT_EMPTY_LINES      :    sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CountEmptyLines"));
break;

Modified: incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyIds.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyIds.hxx?rev=1383908&r1=1383907&r2=1383908&view=diff
==============================================================================
--- incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyIds.hxx (original)
+++ incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyIds.hxx Wed Sep 12 12:19:10
2012
@@ -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

Modified: incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyMap.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyMap.cxx?rev=1383908&r1=1383907&r2=1383908&view=diff
==============================================================================
--- incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyMap.cxx (original)
+++ incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyMap.cxx Wed Sep 12 12:19:10
2012
@@ -945,22 +945,22 @@ void SectionPropertyMap::CloseSectionGro
         if(nRubyHeight < 0 )
             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( rtl::OUString::createFromAscii("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);
         
         _ApplyProperties( xFollowPageStyle );
 



Mime
View raw message