[ooo-build-commit] patches/dev300 patches/vba
Pei Feng Lin
pflin at kemper.freedesktop.org
Mon Jul 13 00:15:02 PDT 2009
patches/dev300/apply | 2
patches/vba/vba-workbook-precisionasdisplayed.diff | 60 +++++++++++++++++++++
2 files changed, 62 insertions(+)
New commits:
commit 6150b237489fa32623a41e280011ad84ab2ad239
Author: Fong Lin <pflin at novell.com>
Date: Mon Jul 13 15:15:07 2009 +0800
support WorkBook.PrecisionAsDisplayed, n#520228
* patches/dev300/apply:
* patches/vba/vba-workbook-precisionasdisplayed.diff:
diff --git a/patches/dev300/apply b/patches/dev300/apply
index d156c3f..1fa751f 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -1870,6 +1870,8 @@ vba-combobox-rowsource-fix.diff, Fong
vba-workbook-auto-open-event.diff, n#520228, Fong
# support buildin toolbar in CommandBar object
vba-buildin-toolbar-fix.diff, n#520228, Fong
+# support WorkBook.PrecisionAsDisplayed
+vba-workbook-precisionasdisplayed.diff, n#520228, Fong
[VBAUntested]
SectionOwner => noelpwer
# doesn't work
diff --git a/patches/vba/vba-workbook-precisionasdisplayed.diff b/patches/vba/vba-workbook-precisionasdisplayed.diff
new file mode 100644
index 0000000..c846531
--- /dev/null
+++ b/patches/vba/vba-workbook-precisionasdisplayed.diff
@@ -0,0 +1,60 @@
+diff --git oovbaapi/ooo/vba/excel/XWorkbook.idl oovbaapi/ooo/vba/excel/XWorkbook.idl
+index 66a6380..d72940c 100644
+--- oovbaapi/ooo/vba/excel/XWorkbook.idl
++++ oovbaapi/ooo/vba/excel/XWorkbook.idl
+@@ -53,6 +53,7 @@ interface XWorkbook : com::sun::star::uno::XInterface
+ [attribute, readonly] boolean ProtectStructure;
+ [attribute, readonly] XWorksheet ActiveSheet;
+ [attribute, readonly] string CodeName;
++ [attribute] boolean PrecisionAsDisplayed;
+
+ any Worksheets([in] any sheet);
+ any Styles([in] any Index );
+diff --git sc/source/ui/vba/vbaworkbook.cxx sc/source/ui/vba/vbaworkbook.cxx
+index 5b6e277..7438065 100644
+--- sc/source/ui/vba/vbaworkbook.cxx
++++ sc/source/ui/vba/vbaworkbook.cxx
+@@ -52,6 +52,7 @@
+ #include <stdio.h>
+ #include "vbanames.hxx" // Amelia Wang
+ #include "nameuno.hxx"
++#include "docoptio.hxx"
+
+ // Much of the impl. for the equivalend UNO module is
+ // sc/source/ui/unoobj/docuno.cxx, viewuno.cxx
+@@ -270,6 +271,22 @@ ScVbaWorkbook::getProtectStructure() throw (uno::RuntimeException)
+ return xProt->isProtected();
+ }
+
++::sal_Bool SAL_CALL ScVbaWorkbook::getPrecisionAsDisplayed() throw (uno::RuntimeException)
++{
++ uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW );
++ ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument();
++ return pDoc->GetDocOptions().IsCalcAsShown();
++}
++
++void SAL_CALL ScVbaWorkbook::setPrecisionAsDisplayed( sal_Bool _precisionAsDisplayed ) throw (uno::RuntimeException)
++{
++ uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW );
++ ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument();
++ ScDocOptions aOpt = pDoc->GetDocOptions();
++ aOpt.SetCalcAsShown( _precisionAsDisplayed );
++ pDoc->SetDocOptions( aOpt );
++}
++
+ void
+ ScVbaWorkbook::SaveCopyAs( const rtl::OUString& sFileName ) throw ( uno::RuntimeException)
+ {
+diff --git sc/source/ui/vba/vbaworkbook.hxx sc/source/ui/vba/vbaworkbook.hxx
+index 1ce5de5..05a0d52 100644
+--- sc/source/ui/vba/vbaworkbook.hxx
++++ sc/source/ui/vba/vbaworkbook.hxx
+@@ -56,6 +56,8 @@ public:
+ // Attributes
+ virtual ::sal_Bool SAL_CALL getProtectStructure() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getActiveSheet() throw (css::uno::RuntimeException);
++ virtual ::sal_Bool SAL_CALL getPrecisionAsDisplayed() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setPrecisionAsDisplayed( sal_Bool _precisionAsDisplayed ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual css::uno::Any SAL_CALL Worksheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
More information about the ooo-build-commit
mailing list