Tag: cws_src680_oj14
User: oj      
Date: 06/03/19 23:50:03

Modified:
 /dba/dbaccess/source/filter/xml/
  xmlExport.cxx, xmlExport.hxx, xmlHelper.cxx, xmlHierarchyCollection.cxx

Log:
 store table font

File Changes:

Directory: /dba/dbaccess/source/filter/xml/
===========================================

File [changed]: xmlExport.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/filter/xml/xmlExport.cxx?r1=1.8&r2=1.8.4.1
Delta lines:  +37 -5
--------------------
--- xmlExport.cxx       23 Sep 2005 12:10:50 -0000      1.8
+++ xmlExport.cxx       20 Mar 2006 07:49:58 -0000      1.8.4.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: xmlExport.cxx,v $
  *
- *  $Revision: 1.8 $
+ *  $Revision: 1.8.4.1 $
  *
- *  last change: $Author: hr $ $Date: 2005/09/23 12:10:50 $
+ *  last change: $Author: oj $ $Date: 2006/03/20 07:49:58 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -96,6 +96,9 @@
 #ifndef DBA_XMLHELPER_HXX
 #include "xmlHelper.hxx"
 #endif
+#ifndef _COM_SUN_STAR_AWT_FONTDESCRIPTOR_HPP_
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#endif
 
 namespace dbaxml
 {
@@ -103,6 +106,7 @@
        using namespace ::com::sun::star::sdb;
        using namespace ::com::sun::star::sdbcx;
        using namespace ::com::sun::star::util;
+    using namespace ::com::sun::star;
 
        class ODBExportHelper
        {
@@ -237,6 +241,7 @@
 // 
-----------------------------------------------------------------------------
 ODBExport::ODBExport(const Reference< XMultiServiceFactory >& 
_rxMSF,sal_uInt16 nExportFlag)
 : SvXMLExport( _rxMSF,MAP_10TH_MM,XML_DATABASE, EXPORT_OASIS)
+,m_bAllreadyFilled(sal_False)
 {
        setExportFlags( EXPORT_OASIS | nExportFlag);
        GetMM100UnitConverter().setCoreMeasureUnit(MAP_10TH_MM);
@@ -244,6 +249,7 @@
 
        _GetNamespaceMap().Add( GetXMLToken(XML_NP_OFFICE), 
GetXMLToken((getExportFlags() & EXPORT_CONTENT) != 0 ? XML_N_OOO : 
XML_N_OFFICE), XML_NAMESPACE_OFFICE );
        _GetNamespaceMap().Add( GetXMLToken(XML_NP_OOO), 
GetXMLToken(XML_N_OOO), XML_NAMESPACE_OOO );
+    _GetNamespaceMap().Add( GetXMLToken(XML_NP_SVG), GetXMLToken(XML_N_SVG), 
XML_NAMESPACE_SVG );
 
        _GetNamespaceMap().Add( GetXMLToken(XML_NP_DB), GetXMLToken(XML_N_DB), 
XML_NAMESPACE_DB );
        
@@ -879,6 +885,16 @@
        {
                if ( !aPropertyStates.empty() )
                        m_aAutoStyleNames.insert( 
TPropertyStyleMap::value_type(_xProp,GetAutoStylePool()->Add( 
XML_STYLE_FAMILY_TABLE_TABLE, aPropertyStates )));
+        try
+        {
+            awt::FontDescriptor aFont;
+            _xProp->getPropertyValue(PROPERTY_FONT) >>= aFont;
+                       
GetFontAutoStylePool()->Add(aFont.Name,aFont.StyleName,aFont.Family,aFont.Pitch,aFont.CharSet
 );
+        }
+        catch(Exception&)
+        {
+            // not interested in
+        }
                Reference< XNameAccess > xCollection = xSup->getColumns();
                ::comphelper::mem_fun1_t<ODBExport,XPropertySet* > 
aMemFunc(&ODBExport::exportAutoStyle);
                
exportCollection(xCollection,XML_TOKEN_INVALID,XML_TOKEN_INVALID,sal_False,aMemFunc);
@@ -938,8 +954,7 @@
        // there are no styles that require their own autostyles
        if ( getExportFlags() & EXPORT_CONTENT )
        {
-               exportQueries(sal_False);
-               exportTables(sal_False);
+               collectComponentStyles();
                GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_TABLE
                                                                                
,GetDocHandler()
                                                                                
,GetMM100UnitConverter()
@@ -1084,6 +1099,23 @@
        Reference< XNumberFormatsSupplier > 
xNum(m_xDataSource->getPropertyValue(PROPERTY_NUMBERFORMATSSUPPLIER),UNO_QUERY);
        SetNumberFormatsSupplier(xNum);
        SvXMLExport::setSourceDocument(xDoc);
+}
+// 
-----------------------------------------------------------------------------
+void ODBExport::_ExportFontDecls()
+{
+       GetFontAutoStylePool(); // make sure the pool is created
+       collectComponentStyles();
+       SvXMLExport::_ExportFontDecls();
+}
+// 
-----------------------------------------------------------------------------
+void ODBExport::collectComponentStyles()
+{
+       if ( m_bAllreadyFilled )
+               return;
+
+       m_bAllreadyFilled = sal_True;
+    exportQueries(sal_False);
+    exportTables(sal_False);
 }
 // 
-----------------------------------------------------------------------------
 }// dbaxml

File [changed]: xmlExport.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/filter/xml/xmlExport.hxx?r1=1.5&r2=1.5.8.1
Delta lines:  +7 -4
-------------------
--- xmlExport.hxx       8 Sep 2005 14:06:31 -0000       1.5
+++ xmlExport.hxx       20 Mar 2006 07:49:59 -0000      1.5.8.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: xmlExport.hxx,v $
  *
- *  $Revision: 1.5 $
+ *  $Revision: 1.5.8.1 $
  *
- *  last change: $Author: rt $ $Date: 2005/09/08 14:06:31 $
+ *  last change: $Author: oj $ $Date: 2006/03/20 07:49:59 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -144,6 +144,7 @@
        mutable UniReference < XMLPropertySetMapper >   
m_xTableStylesPropertySetMapper;
        mutable UniReference < XMLPropertySetMapper >   
m_xColumnStylesPropertySetMapper;
        Reference<XPropertySet>                                                 
m_xDataSource;
+    sal_Bool                                        m_bAllreadyFilled;
 
        void                                    exportDataSource();
        void                                    exportLogin();
@@ -173,6 +174,7 @@
        void                                    exportTableName(XPropertySet* 
_xProp,sal_Bool _bUpdate);
        void                                    exportAutoStyle(XPropertySet* 
_xProp);
        void                                    exportColumns(const 
Reference<XColumnsSupplier>& _xColSup);
+    void                    collectComponentStyles();
 
        ::rtl::OUString                 implConvertAny(const Any& _rValue);
 
@@ -186,6 +188,7 @@
        virtual void                                    _ExportAutoStyles();
        virtual void                                    _ExportContent();
        virtual void                                    _ExportMasterStyles();
+    virtual void                                       _ExportFontDecls();
        virtual sal_uInt32                              exportDoc( enum 
::xmloff::token::XMLTokenEnum eClass );
        virtual SvXMLAutoStylePoolP*    CreateAutoStylePool();
 
@@ -195,7 +198,7 @@
        virtual                                 ~ODBExport(){};
 public:                                                
                                                        
-       ODBExport(const Reference< XMultiServiceFactory >& _rxMSF, sal_uInt16 
nExportFlag = EXPORT_CONTENT | EXPORT_AUTOSTYLES | EXPORT_PRETTY);
+       ODBExport(const Reference< XMultiServiceFactory >& _rxMSF, sal_uInt16 
nExportFlag = EXPORT_CONTENT | EXPORT_AUTOSTYLES | 
EXPORT_PRETTY|EXPORT_FONTDECLS);
        // XServiceInfo
        DECLARE_SERVICE_INFO_STATIC( );
 

File [changed]: xmlHelper.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/filter/xml/xmlHelper.cxx?r1=1.5&r2=1.5.4.1
Delta lines:  +33 -33
---------------------
--- xmlHelper.cxx       23 Sep 2005 12:11:07 -0000      1.5
+++ xmlHelper.cxx       20 Mar 2006 07:49:59 -0000      1.5.4.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: xmlHelper.cxx,v $
  *
- *  $Revision: 1.5 $
+ *  $Revision: 1.5.4.1 $
  *
- *  last change: $Author: hr $ $Date: 2005/09/23 12:11:07 $
+ *  last change: $Author: oj $ $Date: 2006/03/20 07:49:59 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -109,8 +109,8 @@
        return pHandler;
 }
 // 
-----------------------------------------------------------------------------
-#define MAP_CONST( name, prefix, token, type, context )  { name.ascii, 
name.length,    prefix, token, type, context }
-#define MAP_CONST_ASCII( name, prefix, token, type, context )  { name, 
sizeof(name)-1, prefix, token, type, context }
+#define MAP_CONST( name, prefix, token, type, context )  { name.ascii, 
name.length,    prefix, token, type|XML_TYPE_PROP_TABLE, context }
+#define MAP_CONST_ASCII( name, prefix, token, type, context )  { name, 
sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TABLE, context }
 #define MAP_END()      { NULL, 0, 0, XML_TOKEN_INVALID, 0 }
 // 
-----------------------------------------------------------------------------
 UniReference < XMLPropertySetMapper > 
OXMLHelper::GetTableStylesPropertySetMapper()
@@ -142,7 +142,7 @@
                MAP_CONST_ASCII( "CharUnderline",                               
XML_NAMESPACE_STYLE,    XML_TEXT_UNDERLINE_TYPE,                
XML_TYPE_TEXT_UNDERLINE_TYPE|MID_FLAG_MERGE_PROPERTY, 0 ),
                MAP_CONST_ASCII( "CharUnderline",                               
XML_NAMESPACE_STYLE,    XML_TEXT_UNDERLINE_WIDTH,               
XML_TYPE_TEXT_UNDERLINE_WIDTH|MID_FLAG_MERGE_PROPERTY, 0 ),
                MAP_CONST_ASCII( "CharUnderlineColor",          
XML_NAMESPACE_STYLE,    XML_TEXT_UNDERLINE_COLOR,               
XML_TYPE_TEXT_UNDERLINE_COLOR|MID_FLAG_MULTI_PROPERTY, 0        ),
-               MAP_CONST_ASCII( "CharUnderlineHasColor",               
XML_NAMESPACE_STYLE,    XML_TEXT_UNDERLINE_COLOR,               
XML_TYPE_TEXT_UNDERLINE_HASCOLOR|MID_FLAG_MERGE_ATTRIBUTE, 0    ),
+               MAP_CONST_ASCII( "CharUnderlineHasColor",XML_NAMESPACE_STYLE,   
XML_TEXT_UNDERLINE_COLOR,               
XML_TYPE_TEXT_UNDERLINE_HASCOLOR|MID_FLAG_MERGE_ATTRIBUTE, 0    ),
                MAP_CONST( PROPERTY_FONTWEIGHT,                 
XML_NAMESPACE_FO,               XML_FONT_WEIGHT,                        
XML_TYPE_TEXT_WEIGHT, 0 ),
                MAP_CONST( PROPERTY_FONTWIDTH,                  
XML_NAMESPACE_STYLE,    XML_FONT_WIDTH,                         
XML_TYPE_FONT_WIDTH, 0 ),
                MAP_CONST( PROPERTY_FONTWORDLINEMODE,   XML_NAMESPACE_FO,       
        XML_SCORE_SPACES,                       XML_TYPE_NBOOL, 0 ),

File [changed]: xmlHierarchyCollection.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx?r1=1.4&r2=1.4.4.1
Delta lines:  +4 -4
-------------------
--- xmlHierarchyCollection.cxx  23 Sep 2005 12:11:34 -0000      1.4
+++ xmlHierarchyCollection.cxx  20 Mar 2006 07:50:00 -0000      1.4.4.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: xmlHierarchyCollection.cxx,v $
  *
- *  $Revision: 1.4 $
+ *  $Revision: 1.4.4.1 $
  *
- *  last change: $Author: hr $ $Date: 2005/09/23 12:11:34 $
+ *  last change: $Author: oj $ $Date: 2006/03/20 07:50:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -135,7 +135,7 @@
                        {
                                
m_xContainer.set(xORB->createInstanceWithArguments(_sCollectionServiceName,aArguments),UNO_QUERY);
                                Reference<XNameContainer> 
xNameContainer(_xParentContainer,UNO_QUERY);
-                               if ( xNameContainer.is() )
+                               if ( xNameContainer.is() && 
!xNameContainer->hasByName(m_sName) )
                                        
xNameContainer->insertByName(m_sName,makeAny(m_xContainer));
                        }
                }




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to