Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Legacy reports (not Sun/Oracle Report Builder ones) created by
LibreOffice 3.4 or earlier fail to open in LibreOffice 3.5 and later:
show empty data.

That's because LibreOffice 3.5 expects a hidden control named
"Sorting" to be present; but older versions did not create it.

Attached patch fixes that to cleanly catch the exception and act
accordingly. Please apply to libreoffice-3-5 branch.

-- 
Lionel
From 3533328aae5f38d6d21c2baee782abc4511bb649 Mon Sep 17 00:00:00 2001
From: Lionel Elie Mamane <lionel@mamane.lu>
Date: Tue, 5 Jun 2012 18:40:13 +0200
Subject: [PATCH] fdo#47325 legacy reports: survive absence of Sorting hidden
 control

Reports created in 3.4 and earlier lack it.

Change-Id: I2cf1cad75fff59f23ad98299c4f94253adf7355b
---
 .../wizards/report/ReportTextImplementation.java   |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java 
b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java
index 9e73038..9b1e1e2 100644
--- a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java
+++ b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java
@@ -57,6 +57,7 @@ import com.sun.star.wizards.common.PropertyNames;
 import com.sun.star.wizards.common.SystemDialog;
 import com.sun.star.wizards.db.DBMetaData;
 import com.sun.star.wizards.document.OfficeDocument;
+import com.sun.star.wizards.document.FormHandler.UnknownHiddenControlException;
 import com.sun.star.wizards.ui.UIConsts;
 import java.util.ArrayList;
 import java.util.Vector;
@@ -233,7 +234,15 @@ public class ReportTextImplementation extends ReportImplementationHelper 
impleme
                 String sCommandType = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, 
PropertyNames.COMMAND_TYPE, sMsg);
                 String sGroupFieldNames = 
getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "GroupFieldNames", sMsg);
                 String sFieldNames = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, 
"FieldNames", sMsg);
-                final String sorting = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, 
"Sorting", sMsg);
+                String sorting;
+                try
+                {
+                    sorting = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "Sorting", 
sMsg);
+                }
+                catch (UnknownHiddenControlException exception)
+                {
+                   sorting = "";
+                }
                 String sRecordFieldNames = 
getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "RecordFieldNames", sMsg);
                 if (xNamedForm.hasByName("QueryName"))
                 {
-- 
1.7.7.3


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.