ooo-build r14250 - in branches/ooo-build-3-0: . patches/dev300 patches/vba
- From: noelpwer svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r14250 - in branches/ooo-build-3-0: . patches/dev300 patches/vba
- Date: Wed, 8 Oct 2008 17:48:16 +0000 (UTC)
Author: noelpwer
Date: Wed Oct 8 17:48:16 2008
New Revision: 14250
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14250&view=rev
Log:
2008-10-08 Noel Power <noel power novell com>
* patches/dev300/apply: add patch for n#433292
* patches/vba/vba-fix-font-attribute-access.diff:
Added:
branches/ooo-build-3-0/patches/vba/vba-fix-font-attribute-access.diff
Modified:
branches/ooo-build-3-0/ChangeLog
branches/ooo-build-3-0/patches/dev300/apply
Modified: branches/ooo-build-3-0/patches/dev300/apply
==============================================================================
--- branches/ooo-build-3-0/patches/dev300/apply (original)
+++ branches/ooo-build-3-0/patches/dev300/apply Wed Oct 8 17:48:16 2008
@@ -1653,6 +1653,8 @@
# some nasty api cores
vba-fix-n431613.diff, n#431613
vba-fix-n431657.diff, n#431657
+# fix spurious core maniplulating font attributes
+vba-fix-font-attribute-access.diff, n#433292
[ VBAUntested ]
SectionOwner => noelpwer
Added: branches/ooo-build-3-0/patches/vba/vba-fix-font-attribute-access.diff
==============================================================================
--- (empty file)
+++ branches/ooo-build-3-0/patches/vba/vba-fix-font-attribute-access.diff Wed Oct 8 17:48:16 2008
@@ -0,0 +1,227 @@
+diff --git sc/inc/cellsuno.hxx sc/inc/cellsuno.hxx
+index 4118a43..99b32c4 100644
+--- sc/inc/cellsuno.hxx
++++ sc/inc/cellsuno.hxx
+@@ -170,6 +170,7 @@ class SC_DLLPUBLIC ScCellRangesBase : pu
+ friend class ScTableSheetObj; // fuer createCursorByRange()
+ friend class NumFormatHelper; // VBA helper Class that helps manipulate format data
+ friend class ScVbaRange; //Main VBA helper class for Range
++ friend class ScVbaFont; //Main VBA helper class for Font
+
+ private:
+ SfxItemPropertySet aPropSet;
+diff --git sc/source/ui/vba/vbafont.cxx sc/source/ui/vba/vbafont.cxx
+index e2a069e..27807bb 100644
+--- sc/source/ui/vba/vbafont.cxx
++++ sc/source/ui/vba/vbafont.cxx
+@@ -41,6 +41,7 @@
+ #include <svtools/itemset.hxx>
+ #include "vbafont.hxx"
+ #include "scitems.hxx"
++#include "cellsuno.hxx"
+
+ using namespace ::org::openoffice;
+ using namespace ::com::sun::star;
+@@ -68,10 +69,22 @@ const sal_Int8 SUBSCRIPTHEIGHT = 58;
+ // specifies a hight of normal font
+ const short NORMALHEIGHT = 100;
+
+-ScVbaFont::ScVbaFont( const uno::Reference< vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const ScVbaPalette& dPalette, uno::Reference< beans::XPropertySet > xPropertySet, SfxItemSet* pDataSet ) throw ( uno::RuntimeException ) : ScVbaFont_BASE( xParent, xContext ), mxFont( xPropertySet, css::uno::UNO_QUERY_THROW ), mPalette( dPalette ), mpDataSet( pDataSet )
++ScVbaFont::ScVbaFont( const uno::Reference< vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const ScVbaPalette& dPalette, uno::Reference< beans::XPropertySet > xPropertySet, ScCellRangeObj* pRangeObj ) throw ( uno::RuntimeException ) : ScVbaFont_BASE( xParent, xContext ), mxFont( xPropertySet, css::uno::UNO_QUERY_THROW ), mPalette( dPalette ), mpRangeObj( pRangeObj )
+ {
+ }
+
++SfxItemSet*
++ScVbaFont::GetDataSet()
++{
++ SfxItemSet* pDataSet = mpRangeObj ? mpRangeObj->GetCurrentDataSet( true ) : NULL ;
++ return pDataSet;
++}
++
++ScVbaFont::~ScVbaFont()
++{
++}
++
++
+ void SAL_CALL
+ ScVbaFont::setSuperscript( const uno::Any& aValue ) throw ( uno::RuntimeException )
+ {
+@@ -239,8 +252,8 @@ ScVbaFont::setSize( const uno::Any& aVal
+ uno::Any SAL_CALL
+ ScVbaFont::getSize() throw ( uno::RuntimeException )
+ {
+- if ( mpDataSet )
+- if ( mpDataSet->GetItemState( ATTR_FONT_HEIGHT, TRUE, NULL) == SFX_ITEM_DONTCARE )
++ if ( GetDataSet() )
++ if ( GetDataSet()->GetItemState( ATTR_FONT_HEIGHT, TRUE, NULL) == SFX_ITEM_DONTCARE )
+ return aNULL();
+ return mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) ) );
+ }
+@@ -268,8 +281,8 @@ uno::Any SAL_CALL
+ ScVbaFont::getColorIndex() throw ( uno::RuntimeException )
+ {
+ sal_Int32 nColor = 0;
+- if ( mpDataSet )
+- if ( mpDataSet->GetItemState( ATTR_FONT_COLOR, TRUE, NULL) == SFX_ITEM_DONTCARE )
++ if ( GetDataSet() )
++ if ( GetDataSet()->GetItemState( ATTR_FONT_COLOR, TRUE, NULL) == SFX_ITEM_DONTCARE )
+ return aNULL();
+
+ // getColor returns Xl ColorValue, need to convert it to OO val
+@@ -366,8 +379,8 @@ ScVbaFont::setBold( const uno::Any& aVal
+ uno::Any SAL_CALL
+ ScVbaFont::getBold() throw ( uno::RuntimeException )
+ {
+- if ( mpDataSet )
+- if ( mpDataSet->GetItemState( ATTR_FONT_WEIGHT, TRUE, NULL) == SFX_ITEM_DONTCARE )
++ if ( GetDataSet() )
++ if ( GetDataSet()->GetItemState( ATTR_FONT_WEIGHT, TRUE, NULL) == SFX_ITEM_DONTCARE )
+ return aNULL();
+
+ double fValue = 0.0;
+@@ -412,8 +425,8 @@ ScVbaFont::setUnderline( const uno::Any&
+ uno::Any SAL_CALL
+ ScVbaFont::getUnderline() throw ( uno::RuntimeException )
+ {
+- if ( mpDataSet )
+- if ( mpDataSet->GetItemState( ATTR_FONT_UNDERLINE, TRUE, NULL) == SFX_ITEM_DONTCARE )
++ if ( GetDataSet() )
++ if ( GetDataSet()->GetItemState( ATTR_FONT_UNDERLINE, TRUE, NULL) == SFX_ITEM_DONTCARE )
+ return aNULL();
+
+ sal_Int32 nValue = awt::FontUnderline::NONE;
+@@ -450,8 +463,8 @@ ScVbaFont::setStrikethrough( const uno::
+ uno::Any SAL_CALL
+ ScVbaFont::getStrikethrough() throw ( uno::RuntimeException )
+ {
+- if ( mpDataSet )
+- if ( mpDataSet->GetItemState( ATTR_FONT_CROSSEDOUT, TRUE, NULL) == SFX_ITEM_DONTCARE )
++ if ( GetDataSet() )
++ if ( GetDataSet()->GetItemState( ATTR_FONT_CROSSEDOUT, TRUE, NULL) == SFX_ITEM_DONTCARE )
+ return aNULL();
+ short nValue = 0;
+ mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharStrikeout" ) ) ) >>= nValue;
+@@ -467,8 +480,8 @@ ScVbaFont::setShadow( const uno::Any& aV
+ uno::Any SAL_CALL
+ ScVbaFont::getShadow() throw (uno::RuntimeException)
+ {
+- if ( mpDataSet )
+- if ( mpDataSet->GetItemState( ATTR_FONT_SHADOWED, TRUE, NULL) == SFX_ITEM_DONTCARE )
++ if ( GetDataSet() )
++ if ( GetDataSet()->GetItemState( ATTR_FONT_SHADOWED, TRUE, NULL) == SFX_ITEM_DONTCARE )
+ return aNULL();
+ return mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharShadowed" ) ) );
+ }
+@@ -487,8 +500,8 @@ ScVbaFont::setItalic( const uno::Any& aV
+ uno::Any SAL_CALL
+ ScVbaFont::getItalic() throw ( uno::RuntimeException )
+ {
+- if ( mpDataSet )
+- if ( mpDataSet->GetItemState( ATTR_FONT_POSTURE, TRUE, NULL) == SFX_ITEM_DONTCARE )
++ if ( GetDataSet() )
++ if ( GetDataSet()->GetItemState( ATTR_FONT_POSTURE, TRUE, NULL) == SFX_ITEM_DONTCARE )
+ return aNULL();
+
+ short nValue = 0;
+@@ -507,8 +520,8 @@ ScVbaFont::setName( const uno::Any& aVal
+ uno::Any SAL_CALL
+ ScVbaFont::getName() throw ( uno::RuntimeException )
+ {
+- if ( mpDataSet )
+- if ( mpDataSet->GetItemState( ATTR_FONT, TRUE, NULL) == SFX_ITEM_DONTCARE )
++ if ( GetDataSet() )
++ if ( GetDataSet()->GetItemState( ATTR_FONT, TRUE, NULL) == SFX_ITEM_DONTCARE )
+ return aNULL();
+ return mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharFontName" ) ) );
+ }
+diff --git sc/source/ui/vba/vbafont.hxx sc/source/ui/vba/vbafont.hxx
+index 665e060..da11ebe 100644
+--- sc/source/ui/vba/vbafont.hxx
++++ sc/source/ui/vba/vbafont.hxx
+@@ -38,6 +38,7 @@
+ #include "vbapalette.hxx"
+
+ class ScTableSheetsObj;
++class ScCellRangeObj;
+
+ typedef InheritedHelperInterfaceImpl1< oo::excel::XFont > ScVbaFont_BASE;
+
+@@ -45,10 +46,11 @@ class ScVbaFont : public ScVbaFont_BASE
+ {
+ css::uno::Reference< css::beans::XPropertySet > mxFont;
+ ScVbaPalette mPalette;
+- SfxItemSet* mpDataSet;
++ ScCellRangeObj* mpRangeObj;
++ SfxItemSet* GetDataSet();
+ public:
+- ScVbaFont( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const ScVbaPalette& dPalette, css::uno::Reference< css::beans::XPropertySet > xPropertySet, SfxItemSet* pDataSet = NULL ) throw ( css::uno::RuntimeException );
+- virtual ~ScVbaFont() {}
++ ScVbaFont( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const ScVbaPalette& dPalette, css::uno::Reference< css::beans::XPropertySet > xPropertySet, ScCellRangeObj* pRangeObj = NULL ) throw ( css::uno::RuntimeException );
++ virtual ~ScVbaFont();// {}
+
+ // Attributes
+ virtual css::uno::Any SAL_CALL getSize() throw (css::uno::RuntimeException);
+diff --git sc/source/ui/vba/vbarange.cxx sc/source/ui/vba/vbarange.cxx
+index 3decda8..8724906 100644
+--- sc/source/ui/vba/vbarange.cxx
++++ sc/source/ui/vba/vbarange.cxx
+@@ -239,14 +239,18 @@ uno::Reference< excel::XRange > lcl_make
+ return xRange;
+ }
+
+-SfxItemSet* ScVbaRange::getCurrentDataSet( ) throw ( uno::RuntimeException )
++ScCellRangeObj* ScVbaRange::getCellRangeObj() throw ( uno::RuntimeException )
+ {
+ uno::Reference< uno::XInterface > xIf;
+ if ( mxRanges.is() )
+ xIf.set( mxRanges, uno::UNO_QUERY_THROW );
+ else
+ xIf.set( mxRange, uno::UNO_QUERY_THROW );
+- ScCellRangeObj* pUnoCellRange = dynamic_cast< ScCellRangeObj* >( xIf.get() );
++ return dynamic_cast< ScCellRangeObj* >( xIf.get() );
++}
++SfxItemSet* ScVbaRange::getCurrentDataSet( ) throw ( uno::RuntimeException )
++{
++ ScCellRangeObj* pUnoCellRange = getCellRangeObj();
+ SfxItemSet* pDataSet = pUnoCellRange ? pUnoCellRange->GetCurrentDataSet( true ) : NULL ;
+
+ if ( !pDataSet )
+@@ -1868,15 +1872,15 @@ ScVbaRange::Font() throw ( script::Basic
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access document from shell" ) ), uno::Reference< uno::XInterface >() );
+
+ ScVbaPalette aPalette( pDoc->GetDocumentShell() );
+- SfxItemSet* pSet = NULL;
++ ScCellRangeObj* pRangeObj = NULL;
+ try
+ {
+- pSet = getCurrentDataSet();
++ pRangeObj = getCellRangeObj();
+ }
+ catch( uno::Exception& )
+ {
+ }
+- return new ScVbaFont( this, mxContext, aPalette, xProps, pSet );
++ return new ScVbaFont( this, mxContext, aPalette, xProps, pRangeObj );
+ }
+
+ uno::Reference< excel::XRange >
+diff --git sc/source/ui/vba/vbarange.hxx sc/source/ui/vba/vbarange.hxx
+index 585cadf..452ec07 100644
+--- sc/source/ui/vba/vbarange.hxx
++++ sc/source/ui/vba/vbarange.hxx
+@@ -58,6 +58,7 @@
+
+ class ScTableSheetsObj;
+ class ScCellRangesBase;
++class ScCellRangeObj;
+
+ //typedef InheritedHelperInterfaceImpl1< oo::excel::XRange > ScVbaRange_BASE;
+ typedef ScVbaFormat< oo::excel::XRange > ScVbaRange_BASE;
+@@ -111,6 +112,7 @@ class ScVbaRange : public ScVbaRange_BAS
+ virtual void setFormulaValue( const css::uno::Any& aValue, ScGrammar::Grammar ) throw ( css::uno::RuntimeException);
+ css::uno::Reference< oo::excel::XRange > getArea( sal_Int32 nIndex ) throw( css::uno::RuntimeException );
+ ScCellRangesBase* getCellRangesBase() throw ( css::uno::RuntimeException );
++ ScCellRangeObj* getCellRangeObj( ) throw ( css::uno::RuntimeException );
+ SfxItemSet* getCurrentDataSet( ) throw ( css::uno::RuntimeException );
+ css::uno::Reference< oo::vba::XCollection >& getBorders();
+ void groupUnGroup( bool bUnGroup = false ) throw ( css::script::BasicErrorException, css::uno::RuntimeException );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]