[ooo-build-commit] .: patches/dev300

Kohei Yoshida kohei at kemper.freedesktop.org
Fri Mar 5 15:14:28 PST 2010


 patches/dev300/apply                                            |    4 +
 patches/dev300/calc-pdf-export-allow-filtered-range-filter.diff |   36 ++++++++++
 patches/dev300/calc-pdf-export-allow-filtered-range-sc.diff     |   36 ++++++++++
 3 files changed, 76 insertions(+)

New commits:
commit 6e847e8fba9f37c4c6a5cbe4690a36081c623953
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Mar 5 18:05:26 2010 -0500

    Allow PDF export on filtered range selection.
    
    When exporting a selection to PDF, we should not split the selected
    range by the filtered or hidden ranges but use the whole selected
    range as a single range.  Otherwise exporting such ranges would
    generate an empty PDF output.
    
    Also, when the user is trying to export multiple selections,
    throw an error message, instead of failing silently with an empty
    PDF output. (n#585028)
    
    * patches/dev300/apply:
    * patches/dev300/calc-pdf-export-allow-filtered-range-filter.diff:
    * patches/dev300/calc-pdf-export-allow-filtered-range-sc.diff:

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 6d9b137..f000b8d 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3582,6 +3582,10 @@ calc-insert-current-time-vcl.diff,       kohei
 # Simplify external ref cell tracking & break links turn ref cells into static values.
 calc-extref-simple-ref-tracking.diff, n#585094, kohei
 
+# Allow export of filtered range selection, and show error when fails.
+calc-pdf-export-allow-filtered-range-sc.diff,     n#585028, kohei
+calc-pdf-export-allow-filtered-range-filter.diff, n#585028, kohei
+
 [ GentooExperimental ]
 SectionOwner => hmth
 # jemalloc, FreeBSD 7 allocator
diff --git a/patches/dev300/calc-pdf-export-allow-filtered-range-filter.diff b/patches/dev300/calc-pdf-export-allow-filtered-range-filter.diff
new file mode 100644
index 0000000..969b273
--- /dev/null
+++ b/patches/dev300/calc-pdf-export-allow-filtered-range-filter.diff
@@ -0,0 +1,36 @@
+diff --git filter/source/pdf/impdialog.cxx filter/source/pdf/impdialog.cxx
+index dff72eb..f8ac963 100644
+--- filter/source/pdf/impdialog.cxx
++++ filter/source/pdf/impdialog.cxx
+@@ -122,7 +122,31 @@ ImpPDFTabDialog::ImpPDFTabDialog( Window* pParent,
+         {
+             Reference< view::XSelectionSupplier > xView( xController, UNO_QUERY );
+             if( xView.is() )
++            {
++                // In Calc, we need to treat a selection across hidden or 
++                // filtered ranges as one range, or else the export will
++                // fail because Calc doesn't support printing of multiple
++                // selections.
++                Reference< beans::XPropertySet > xPropSet(xView, UNO_QUERY);
++                if (xPropSet.is())
++                {
++                    sal_Bool bFilteredRange = sal_False; // Don't divide selection across filtered ranges.
++                    uno::Any any;
++                    any <<= bFilteredRange;
++                    try
++                    {
++                        xPropSet->setPropertyValue(
++                            rtl::OUString::createFromAscii("FilteredRangeSelection"), any);
++                    }
++                    catch (const beans::UnknownPropertyException&)
++                    {
++                        // For now, apps other than Calc fails to set this property,
++                        // hence an exception gets thrown.
++                    }
++                }
++
+                 xView->getSelection() >>= maSelection;
++            }
+         }
+     }
+     catch( RuntimeException )
diff --git a/patches/dev300/calc-pdf-export-allow-filtered-range-sc.diff b/patches/dev300/calc-pdf-export-allow-filtered-range-sc.diff
new file mode 100644
index 0000000..afb008a
--- /dev/null
+++ b/patches/dev300/calc-pdf-export-allow-filtered-range-sc.diff
@@ -0,0 +1,36 @@
+diff --git sc/source/ui/unoobj/docuno.cxx sc/source/ui/unoobj/docuno.cxx
+index 492a3f5..bd7a775 100644
+--- sc/source/ui/unoobj/docuno.cxx
++++ sc/source/ui/unoobj/docuno.cxx
+@@ -53,6 +53,7 @@
+ #include <ctype.h>
+ #include <float.h>	// DBL_MAX
+ 
++#include <com/sun/star/task/ErrorCodeIOException.hpp>
+ #include <com/sun/star/util/Date.hpp>
+ #include <com/sun/star/sheet/XNamedRanges.hpp>
+ #include <com/sun/star/sheet/XLabelRanges.hpp>
+@@ -104,6 +105,8 @@
+ #include <com/sun/star/document/VbaEventId.hpp>
+ using namespace com::sun::star;
+ using namespace com::sun::star::document::VbaEventId;
++using ::rtl::OUString;
++using ::com::sun::star::uno::Reference;
+ 
+ #define SC_UNO_VBADOCOBJ "ThisVBADocObj" // perhaps we want to actually make this ThisWorkbook ?
+ 
+@@ -707,7 +710,13 @@ sal_Int32 SAL_CALL ScModelObj::getRendererCount( const uno::Any& aSelection,
+     ScMarkData aMark;
+     ScPrintSelectionStatus aStatus;
+     if ( !FillRenderMarkData( aSelection, aMark, aStatus ) )
+-        return 0;
++    {
++        // TODO: Right now this error code is not reaching where it's supposed
++        // to.  Find out why and figure out how to send correct error code to
++        // the framework code.
++        throw task::ErrorCodeIOException(
++            OUString(), Reference<XInterface>(), ERRCODE_IO_NOTSUPPORTED);
++    }
+ 
+     //	The same ScPrintFuncCache object in pPrintFuncCache is used as long as
+     //	the same selection is used (aStatus) and the document isn't changed


More information about the ooo-build-commit mailing list