[Libreoffice-commits] .: Branch 'libreoffice-3-6' - 3 commits - oox/inc sc/source
Noel Power
noelp at kemper.freedesktop.org
Tue Jun 12 03:08:23 PDT 2012
oox/inc/oox/core/fragmenthandler2.hxx | 3 +--
sc/source/filter/oox/worksheetfragment.cxx | 24 +++++++++++++++++++-----
sc/source/filter/oox/worksheethelper.cxx | 14 +++-----------
3 files changed, 23 insertions(+), 18 deletions(-)
New commits:
commit 34ea7e01e8262fe76424545852874373cf728aed
Author: Noel Power <noel.power at novell.com>
Date: Thu Jun 7 14:00:03 2012 +0100
attempt to use mce::FallBack for control/oleObject import
commit commit afbb2d8f7d72292532a9ea54fa2e6757b6d548c2 broke the existing mce::FallBack processing.
Change-Id: I05296f6aad3841a8dd40aa345207c0114e0c7701
diff --git a/sc/source/filter/oox/worksheetfragment.cxx b/sc/source/filter/oox/worksheetfragment.cxx
index 8616305..3743b0b 100644
--- a/sc/source/filter/oox/worksheetfragment.cxx
+++ b/sc/source/filter/oox/worksheetfragment.cxx
@@ -330,12 +330,26 @@ ContextHandlerRef WorksheetFragment::onCreateContext( sal_Int32 nElement, const
case XLS_TOKEN( evenFooter ): return this; // collect h/f contents in onCharacters()
}
break;
-
+ // Only process an oleObject or control if outside a mc:AlternateContent
+ // element OR if within a mc:Fallback. I suppose ideally we
+ // should process the stuff within 'mc:Choice'
+ case XLS_TOKEN( controls ):
case XLS_TOKEN( oleObjects ):
- if( nElement == XLS_TOKEN( oleObject ) && aMceState.empty() ) importOleObject( rAttribs );
- break;
- case XLS_TOKEN( controls ):
- if( nElement == XLS_TOKEN( control ) && aMceState.empty() ) importControl( rAttribs );
+ if ( getCurrentElement() == XLS_TOKEN( controls ) )
+ {
+ if( aMceState.empty() || ( !aMceState.empty() && aMceState.back() == MCE_STARTED ) )
+ {
+ if ( getCurrentElement() == XLS_TOKEN( oleObjects ) ) importOleObject( rAttribs );
+ else
+ importControl( rAttribs );
+ }
+ else if ( !aMceState.empty() && aMceState.back() == MCE_FOUND_CHOICE )
+ {
+ // reset the handling within 'Choice'
+ // this will force attempted handling in Fallback
+ aMceState.back() = MCE_STARTED;
+ }
+ }
break;
}
return 0;
commit b3d25d0797c8697189a4db27135ae86ee92ba2f2
Author: Noel Power <noel.power at novell.com>
Date: Tue Jun 5 16:41:53 2012 +0100
fix missing ole and form control(s) on xlsx import
chang the visibility of aMceState in order to access that member to filter out reading and parsing of ./xl/ctrlProps/ctrlProp[N].xml fragments for 'controls' & 'oleObjects' elements nested withing 'mc:AlternateContent' elements
Change-Id: I6892db7e3302b9977f0fdaabbe3ac1444315e011
diff --git a/oox/inc/oox/core/fragmenthandler2.hxx b/oox/inc/oox/core/fragmenthandler2.hxx
index 781ed85..70ded85 100644
--- a/oox/inc/oox/core/fragmenthandler2.hxx
+++ b/oox/inc/oox/core/fragmenthandler2.hxx
@@ -41,7 +41,7 @@ namespace core {
class OOX_DLLPUBLIC FragmentHandler2 : public FragmentHandler, public ContextHandler2Helper
{
-private:
+protected:
enum MCE_STATE
{
MCE_UNUSED,
@@ -50,7 +50,6 @@ private:
};
::std::vector<MCE_STATE> aMceState;
-private:
bool prepareMceContext( sal_Int32 nElement, const AttributeList& rAttribs );
diff --git a/sc/source/filter/oox/worksheetfragment.cxx b/sc/source/filter/oox/worksheetfragment.cxx
index be41a16..8616305 100644
--- a/sc/source/filter/oox/worksheetfragment.cxx
+++ b/sc/source/filter/oox/worksheetfragment.cxx
@@ -332,10 +332,10 @@ ContextHandlerRef WorksheetFragment::onCreateContext( sal_Int32 nElement, const
break;
case XLS_TOKEN( oleObjects ):
- if( nElement == XLS_TOKEN( oleObject ) ) importOleObject( rAttribs );
+ if( nElement == XLS_TOKEN( oleObject ) && aMceState.empty() ) importOleObject( rAttribs );
break;
case XLS_TOKEN( controls ):
- if( nElement == XLS_TOKEN( control ) ) importControl( rAttribs );
+ if( nElement == XLS_TOKEN( control ) && aMceState.empty() ) importControl( rAttribs );
break;
}
return 0;
commit 5ea56491e3951b7c48022cf78972342dbb8fad16
Author: Noel Power <noel.power at novell.com>
Date: Thu Jun 7 18:13:09 2012 +0100
get rid of unecessary loop and change comment
followup to 764752f5d85cb7c86ad21340dfdda4b62754790c
Change-Id: Ib35b57b01ccf752c4696d6e7849629bd22a9e91a
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 48dc7d6..8563048 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -1223,17 +1223,9 @@ void WorksheetGlobals::convertRows( OutlineLevelVec& orRowLevels,
sal_Int32 nHeight = getUnitConverter().scaleToMm100( fHeight, UNIT_POINT );
if( nHeight > 0 )
{
- /* Get all rows that have custom height inside the passed row model.
- If the model has the custom height flag set, all its rows have
- custom height, otherwise get all rows specified in the class member
- maManualRowHeights that are inside the passed row model. */
- ValueRangeVector aManualRows;
- aManualRows.push_back( rRowRange );
- for( ValueRangeVector::const_iterator aIt = aManualRows.begin(), aEnd = aManualRows.end(); aIt != aEnd; ++aIt )
- {
- PropertySet aPropSet( getRows( *aIt ) );
- aPropSet.setProperty( PROP_Height, nHeight );
- }
+ /* always import the row height, ensures better layout */
+ PropertySet aPropSet( getRows( rRowRange ) );
+ aPropSet.setProperty( PROP_Height, nHeight );
}
// hidden rows: TODO: #108683# hide rows later?
More information about the Libreoffice-commits
mailing list