Bug 179887 - editors/libreoffice-i18n: Can't set ALL languages as run depends (impossible to satisfy)
Summary: editors/libreoffice-i18n: Can't set ALL languages as run depends (impossible ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Jung-uk Kim
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-23 18:10 UTC by John Marino
Modified: 2013-06-25 23:07 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Marino 2013-06-23 18:10:01 UTC
The editors/libreoffice-i18n port installs all language packs by default, although in the past some languages were off by default.

At least in one case, this is impossible to satisfy.  The en_GB and en_ZA versions CONFLICT and thus can not both be specified.

Installing el-libreoffice-4.0.3... done
===>   Returning to build of libreoffice-i18n-4.0.3
===>   libreoffice-i18n-4.0.3 depends on file: /usr/local/lib/libreoffice/readmes/README_en-GB - not found
===>    Verifying install for /usr/local/lib/libreoffice/readmes/README_en-GB in /usr/dports/editors/libreoffice-en_GB
===>   Installing existing package /usr/packages/All/en_GB-libreoffice-4.0.3.txz
Installing en_GB-libreoffice-4.0.3... done
===>   Returning to build of libreoffice-i18n-4.0.3
===>   libreoffice-i18n-4.0.3 depends on file: /usr/local/lib/libreoffice/readmes/README_en-ZA - not found
===>    Verifying install for /usr/local/lib/libreoffice/readmes/README_en-ZA in /usr/dports/editors/libreoffice-en_ZA
===>   Installing existing package /usr/packages/All/en_ZA-libreoffice-4.0.3.txz
Installing en_ZA-libreoffice-4.0.3...pkg: en_ZA-libreoffice-4.0.3 conflicts with en_GB-libreoffice-4.0.3 (installs files into the same place).  Problematic file: /usr/local/lib/libreoffice/share/extensions/dict-en/Lightproof.py

Fix: 

Remove conflict or set en_GB and en_ZA in a radio group where only once can be selected.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-06-23 18:10:14 UTC
Responsible Changed
From-To: freebsd-ports-bugs->office

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Jung-uk Kim freebsd_committer freebsd_triage 2013-06-25 20:10:51 UTC
Responsible Changed
From-To: office->jkim

I'll take it.
Comment 3 dfilter service freebsd_committer freebsd_triage 2013-06-25 22:55:26 UTC
Author: jkim
Date: Tue Jun 25 21:55:09 2013
New Revision: 321770
URL: http://svnweb.freebsd.org/changeset/ports/321770

Log:
  - Chase liborcus 0.5.1 update.
  - Do not install unused dictionary files to avoid conflicts. [1]
  - Honor real PAGE_SIZE.
  
  PR:		ports/179887 [1]

Added:
  head/editors/libreoffice/files/patch-connectivity__source__inc__dbase__dindexnode.hxx   (contents, props changed)
  head/editors/libreoffice/files/patch-liborcus-0.5.x   (contents, props changed)
  head/editors/libreoffice/files/patch-mdds-0.8.x
     - copied unchanged from r321768, head/editors/libreoffice/files/patch-mdds-api-breakage
Deleted:
  head/editors/libreoffice/files/patch-mdds-api-breakage
Modified:
  head/editors/libreoffice/Makefile
  head/editors/libreoffice/Makefile.common
  head/editors/libreoffice/files/patch-configure.ac

Modified: head/editors/libreoffice/Makefile
==============================================================================
--- head/editors/libreoffice/Makefile	Tue Jun 25 21:52:08 2013	(r321769)
+++ head/editors/libreoffice/Makefile	Tue Jun 25 21:55:09 2013	(r321770)
@@ -2,7 +2,7 @@
 
 .include "${.CURDIR}/Makefile.common"
 
-PORTREVISION=	0
+PORTREVISION=	1
 MASTER_SITES+=	http://dev-www.libreoffice.org/src/:src \
 		http://dev-www.libreoffice.org/extern/:ext
 MASTER_SITE_SUBDIR=	src/${PORTVERSION}/
@@ -25,7 +25,7 @@ BUILD_DEPENDS=	p5-Archive-Zip>=0:${PORTS
 
 LIB_DEPENDS=	icutu:${PORTSDIR}/devel/icu \
 		langtag:${PORTSDIR}/devel/liblangtag \
-		orcus-0.4:${PORTSDIR}/devel/liborcus \
+		orcus-0.6:${PORTSDIR}/devel/liborcus \
 		curl.6:${PORTSDIR}/ftp/curl \
 		cairo.2:${PORTSDIR}/graphics/cairo \
 		graphite2:${PORTSDIR}/graphics/graphite2 \

Modified: head/editors/libreoffice/Makefile.common
==============================================================================
--- head/editors/libreoffice/Makefile.common	Tue Jun 25 21:52:08 2013	(r321769)
+++ head/editors/libreoffice/Makefile.common	Tue Jun 25 21:55:09 2013	(r321770)
@@ -39,6 +39,13 @@ PLISTD?=	${WRKDIR}/plist_dirs
 PLISTF?=	${WRKDIR}/plist_files
 
 .if defined(LO_I18N)
+LO_HAS_DICT=	af ar be bg bn br bs ca ca_XV cs da de el en_GB en_ZA es et \
+		fr he hi hr hu it ku lt lv nb ne nl nn oc pl pt pt_BR ro ru \
+		sh si sk sl sr sv te th uk zu
+.if (${LO_HAS_DICT:M${LO_I18N}})
+PORTREVISION=	1
+.endif
+
 NO_BUILD=	yes
 
 RUN_DEPENDS=	libreoffice:${PORTSDIR}/editors/libreoffice
@@ -61,7 +68,8 @@ DISTFILES+=	${LO_I18N_FILE}_helppack_${L
 .endif
 COMMENT?=	${LO_I18N} language pack for ${PORTNAME}
 
-EXTRACT_AFTER_ARGS=	--strip-components 1
+EXTRACT_AFTER_ARGS=	--exclude '${PORTNAME}*-dict-*.deb' \
+			--strip-components 1
 
 post-extract:
 	@${MKDIR} ${WRKSRC}; \

Modified: head/editors/libreoffice/files/patch-configure.ac
==============================================================================
--- head/editors/libreoffice/files/patch-configure.ac	Tue Jun 25 21:52:08 2013	(r321769)
+++ head/editors/libreoffice/files/patch-configure.ac	Tue Jun 25 21:55:09 2013	(r321770)
@@ -1,6 +1,6 @@
---- ./configure.ac.orig	2013-01-31 05:54:53.000000000 -0500
-+++ ./configure.ac	2013-02-18 18:14:20.000000000 -0500
-@@ -3588,7 +3588,7 @@
+--- configure.ac.orig	2013-06-11 05:33:38.000000000 -0400
++++ configure.ac	2013-06-24 17:44:14.000000000 -0400
+@@ -3617,7 +3617,7 @@
          PLATFORMID=freebsd_x86
          OUTPATH=unxfbsdi
          ;;
@@ -9,7 +9,7 @@
          CPU=X
          CPUNAME=X86_64
          RTL_ARCH=X86_64
-@@ -6200,21 +6200,13 @@
+@@ -6261,21 +6261,13 @@
              JAVA_ARCH="i386"
              JAVA_TOOLKIT="client"
              ;;
@@ -34,7 +34,7 @@
          ;;
  
      k*bsd*-gnu*)
-@@ -7861,9 +7853,13 @@
+@@ -7909,9 +7901,13 @@
      AC_MSG_CHECKING([which hash container mdds shall use])
      if test "x$HAVE_CXX0X" = "xTRUE"; then
          MDDS_CPPFLAGS="-std=gnu++0x"
@@ -49,7 +49,7 @@
          AC_MSG_RESULT([boost::unordered_map])
      fi
  
-@@ -8230,7 +8226,7 @@
+@@ -8278,7 +8274,7 @@
  dnl ===================================================================
  
  AC_MSG_CHECKING([whether to enable graphite support])
@@ -58,7 +58,7 @@
      AC_MSG_RESULT([yes])
      ENABLE_GRAPHITE="TRUE"
      AC_MSG_CHECKING([which graphite to use])
-@@ -8482,8 +8478,8 @@
+@@ -8530,8 +8526,8 @@
      AC_MSG_RESULT([external])
      # Mac OS builds should get out without extra stuff is the Mac porters'
      # wish. And pkg-config is although Xcode ships a .pc for openssl
@@ -69,7 +69,16 @@
          OPENSSL_CFLAGS=
          OPENSSL_LIBS="-lssl -lcrypto"
      else
-@@ -10325,10 +10321,10 @@
+@@ -8584,7 +8580,7 @@
+ if test "$with_system_orcus" = "yes"; then
+     AC_MSG_RESULT([external])
+     SYSTEM_LIBORCUS=YES
+-    PKG_CHECK_MODULES(ORCUS, liborcus-0.4 >= 0.3.0)
++    PKG_CHECK_MODULES(ORCUS, liborcus-0.6 >= 0.5.0)
+ else
+     AC_MSG_RESULT([internal])
+     BUILD_TYPE="$BUILD_TYPE ORCUS"
+@@ -10396,10 +10392,10 @@
  
      dnl Check for Meta Object Compiler
  

Added: head/editors/libreoffice/files/patch-connectivity__source__inc__dbase__dindexnode.hxx
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/libreoffice/files/patch-connectivity__source__inc__dbase__dindexnode.hxx	Tue Jun 25 21:55:09 2013	(r321770)
@@ -0,0 +1,14 @@
+--- connectivity/source/inc/dbase/dindexnode.hxx.orig	2013-06-11 05:33:38.000000000 -0400
++++ connectivity/source/inc/dbase/dindexnode.hxx	2013-06-25 13:44:38.000000000 -0400
+@@ -26,7 +26,11 @@
+ #include <tools/ref.hxx>
+ 
+ #define NODE_NOTFOUND 0xFFFF
++#ifdef __FreeBSD__
++#include <sys/param.h>
++#else
+ #define PAGE_SIZE 512
++#endif
+ 
+ namespace connectivity
+ {

Added: head/editors/libreoffice/files/patch-liborcus-0.5.x
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/libreoffice/files/patch-liborcus-0.5.x	Tue Jun 25 21:55:09 2013	(r321770)
@@ -0,0 +1,540 @@
+--- sc/inc/document.hxx	2013-06-11 05:33:38.000000000 -0400
++++ sc/inc/document.hxx	2013-06-24 19:08:23.000000000 -0400
+@@ -750,6 +750,7 @@
+     SC_DLLPUBLIC bool           SetString(
+         SCCOL nCol, SCROW nRow, SCTAB nTab, const rtl::OUString& rString,
+         ScSetStringParam* pParam = NULL );
++    SC_DLLPUBLIC bool SetString( const ScAddress& rPos, const OUString& rString, ScSetStringParam* pParam = NULL );
+     SC_DLLPUBLIC void           SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVal );
+     void            SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const sal_uInt16 nError);
+ 
+--- sc/inc/orcusfilters.hxx	2013-06-11 05:33:38.000000000 -0400
++++ sc/inc/orcusfilters.hxx	2013-06-24 19:08:23.000000000 -0400
+@@ -30,6 +30,10 @@
+ 
+     virtual bool importGnumeric(ScDocument& rDoc, const rtl::OUString& rPath) const = 0;
+ 
++    virtual bool importXLSX(ScDocument& rDoc, const rtl::OUString& rPath) const = 0;
++
++    virtual bool importODS(ScDocument& rDoc, const rtl::OUString& rPath) const = 0;
++
+     /**
+      * Create a context for XML file.  The context object stores session
+      * information for each unique XML file.  You must create a new context
+--- sc/inc/stringutil.hxx	2013-06-11 05:33:38.000000000 -0400
++++ sc/inc/stringutil.hxx	2013-06-24 19:08:23.000000000 -0400
+@@ -72,16 +72,26 @@
+     TextFormatPolicy meSetTextNumFormat;
+ 
+     /**
+-     * When true, treat input with a leading apostrophe / single quote special
+-     * in that it escapes numeric or date/time input such that it is not
+-     * interpreted and the input string is taken instead. This can be used
+-     * during text file import so the leading apostrophe is not lost if it
+-     * precedes a numeric value.
+-     * Usually set mbHandleApostrophe = !mbSetTextCellFormat
++     * When true, treat input with a leading apostrophe as an escape character
++     * for a numeric value content, to treat the numeric value as a text. When
++     * false, the whole string input including the leading apostrophe will be
++     * entered literally as string.
+      */
+     bool mbHandleApostrophe;
+ 
+     ScSetStringParam();
++
++    /**
++     * Call this whenever you need to unconditionally set input as text, no
++     * matter what the input is.
++     */
++    void setTextInput();
++
++    /**
++     * Call this whenever you need to maximize the chance of input being
++     * detected as a numeric value (numbers, dates, times etc).
++     */
++    void setNumericInput();
+ };
+ 
+ // ============================================================================
+--- sc/source/core/data/document.cxx	2013-06-11 05:33:38.000000000 -0400
++++ sc/source/core/data/document.cxx	2013-06-24 19:08:23.000000000 -0400
+@@ -2940,6 +2940,12 @@
+         return false;
+ }
+ 
++bool ScDocument::SetString(
++    const ScAddress& rPos, const OUString& rString, ScSetStringParam* pParam )
++{
++    return SetString(rPos.Col(), rPos.Row(), rPos.Tab(), rString, pParam);
++}
++
+ 
+ void ScDocument::SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVal )
+ {
+--- sc/source/core/tool/stringutil.cxx	2013-06-11 05:33:38.000000000 -0400
++++ sc/source/core/tool/stringutil.cxx	2013-06-24 19:08:23.000000000 -0400
+@@ -32,6 +32,20 @@
+ {
+ }
+ 
++void ScSetStringParam::setTextInput()
++{
++    mbDetectNumberFormat = false;
++    mbHandleApostrophe = false;
++    meSetTextNumFormat = Always;
++}
++
++void ScSetStringParam::setNumericInput()
++{
++    mbDetectNumberFormat = true;
++    mbHandleApostrophe = true;
++    meSetTextNumFormat = Never;
++}
++
+ // ============================================================================-
+ 
+ bool ScStringUtil::parseSimpleNumber(
+--- sc/source/filter/inc/orcusfiltersimpl.hxx	2013-06-11 05:33:38.000000000 -0400
++++ sc/source/filter/inc/orcusfiltersimpl.hxx	2013-06-24 19:08:23.000000000 -0400
+@@ -22,6 +22,8 @@
+ 
+     virtual bool importCSV(ScDocument& rDoc, const rtl::OUString& rPath) const;
+     virtual bool importGnumeric(ScDocument& rDoc, const rtl::OUString& rPath) const;
++    virtual bool importXLSX(ScDocument& rDoc, const rtl::OUString& rPath) const;
++    virtual bool importODS(ScDocument& rDoc, const rtl::OUString& rPath) const;
+ 
+     virtual ScOrcusXMLContext* createXMLContext(ScDocument& rDoc, const rtl::OUString& rPath) const;
+ };
+--- sc/source/filter/inc/orcusinterface.hxx	2013-06-11 05:33:38.000000000 -0400
++++ sc/source/filter/inc/orcusinterface.hxx	2013-06-24 19:08:23.000000000 -0400
+@@ -21,13 +21,26 @@
+ 
+ class ScDocument;
+ class ScOrcusSheet;
++class ScOrcusFactory;
+ class ScRangeData;
+ 
++class ScOrcusGlobalSettings : public orcus::spreadsheet::iface::import_global_settings
++{
++    ScDocument& mrDoc;
++
++public:
++    ScOrcusGlobalSettings(ScDocument& rDoc);
++
++    virtual void set_origin_date(int year, int month, int day);
++};
++
+ class ScOrcusSharedStrings : public orcus::spreadsheet::iface::import_shared_strings
+ {
+-    std::vector<OUString> maSharedStrings;
++    std::vector<OUString>& mrStrings;
+ 
+ public:
++    ScOrcusSharedStrings(std::vector<OUString>& rStrings);
++
+     virtual size_t append(const char* s, size_t n);
+     virtual size_t add(const char* s, size_t n);
+ 
+@@ -38,50 +51,49 @@
+     virtual void append_segment(const char* s, size_t n);
+ 
+     virtual size_t commit_segments();
+-
+-    const OUString& getByIndex(size_t index) const;
+-};
+-
+-class ScOrcusFactory : public orcus::spreadsheet::iface::import_factory
+-{
+-    ScDocument& mrDoc;
+-    boost::ptr_vector<ScOrcusSheet> maSheets;
+-    ScOrcusSharedStrings maSharedStrings;
+-
+-public:
+-    ScOrcusFactory(ScDocument& rDoc);
+-
+-    virtual orcus::spreadsheet::iface::import_sheet* append_sheet(const char *sheet_name, size_t sheet_name_length);
+-    virtual orcus::spreadsheet::iface::import_sheet* get_sheet(const char *sheet_name, size_t sheet_name_length);
+-    virtual orcus::spreadsheet::iface::import_shared_strings* get_shared_strings();
+-    virtual orcus::spreadsheet::iface::import_styles* get_styles();
+ };
+ 
+ class ScOrcusSheet : public orcus::spreadsheet::iface::import_sheet
+ {
+     ScDocument& mrDoc;
+     SCTAB mnTab;
+-    ScOrcusSharedStrings& mrSharedStrings;
++    ScOrcusFactory& mrFactory;
+ 
+     typedef std::map<size_t, ScRangeData*> SharedFormulaContainer;
+     SharedFormulaContainer maSharedFormulas;
+ public:
+-    ScOrcusSheet(ScDocument& rDoc, SCTAB nTab, ScOrcusSharedStrings& rSharedStrings);
++    ScOrcusSheet(ScDocument& rDoc, SCTAB nTab, ScOrcusFactory& rFactory);
+ 
+     // Orcus import interface
+     virtual void set_auto(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, const char* p, size_t n);
++    virtual void set_string(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, size_t sindex);
++    virtual void set_value(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, double value);
++    virtual void set_bool(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, bool value);
++    virtual void set_date_time(
++        orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, int year, int month, int day, int hour, int minute, double second);
++
+     virtual void set_format(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, size_t xf_index);
++
+     virtual void set_formula(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, orcus::spreadsheet::formula_grammar_t grammar, const char* p, size_t n);
+     virtual void set_formula_result(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, const char* p, size_t n);
++
+     virtual void set_shared_formula(
+         orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, orcus::spreadsheet::formula_grammar_t grammar, size_t sindex,
+         const char* p_formula, size_t n_formula);
++
+     virtual void set_shared_formula(
+         orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, orcus::spreadsheet::formula_grammar_t grammar, size_t sindex,
+         const char* p_formula, size_t n_formula, const char* p_range, size_t n_range);
++
+     virtual void set_shared_formula(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, size_t sindex);
+-    virtual void set_string(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, size_t sindex);
+-    virtual void set_value(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, double value);
++
++    virtual void set_array_formula(
++        orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, orcus::spreadsheet::formula_grammar_t grammar,
++        const char* p, size_t n, orcus::spreadsheet::row_t array_rows, orcus::spreadsheet::col_t array_cols);
++
++    virtual void set_array_formula(
++        orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, orcus::spreadsheet::formula_grammar_t grammar,
++        const char* p, size_t n, const char* p_range, size_t n_range);
+ 
+     SCTAB getIndex() const { return mnTab; }
+ };
+@@ -119,6 +131,10 @@
+     virtual void set_cell_locked(bool b);
+     virtual size_t commit_cell_protection();
+ 
++    // number format
++    virtual void set_number_format(const char* s, size_t n);
++    virtual size_t commit_number_format();
++
+     // cell style xf
+ 
+     virtual void set_cell_style_xf_count(size_t n);
+@@ -147,5 +163,38 @@
+     virtual size_t commit_cell_style();
+ };
+ 
++class ScOrcusFactory : public orcus::spreadsheet::iface::import_factory
++{
++    struct StringCellCache
++    {
++        ScAddress maPos;
++        size_t mnIndex;
++
++        StringCellCache(const ScAddress& rPos, size_t nIndex);
++    };
++
++    typedef std::vector<StringCellCache> StringCellCaches;
++
++    ScDocument& mrDoc;
++    std::vector<OUString> maStrings;
++    StringCellCaches maStringCells;
++    ScOrcusGlobalSettings maGlobalSettings;
++    ScOrcusSharedStrings maSharedStrings;
++    boost::ptr_vector<ScOrcusSheet> maSheets;
++    ScOrcusStyles maStyles;
++
++public:
++    ScOrcusFactory(ScDocument& rDoc);
++
++    virtual orcus::spreadsheet::iface::import_sheet* append_sheet(const char *sheet_name, size_t sheet_name_length);
++    virtual orcus::spreadsheet::iface::import_sheet* get_sheet(const char *sheet_name, size_t sheet_name_length);
++    virtual orcus::spreadsheet::iface::import_global_settings* get_global_settings();
++    virtual orcus::spreadsheet::iface::import_shared_strings* get_shared_strings();
++    virtual orcus::spreadsheet::iface::import_styles* get_styles();
++    virtual void finalize();
++
++    void pushStringCell(const ScAddress& rPos, size_t nStrIndex);
++};
++
+ #endif
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+--- sc/source/filter/orcus/interface.cxx	2013-06-11 05:33:38.000000000 -0400
++++ sc/source/filter/orcus/interface.cxx	2013-06-24 19:08:23.000000000 -0400
+@@ -13,14 +13,34 @@
+ #include "cell.hxx"
+ #include "rangenam.hxx"
+ #include "tokenarray.hxx"
+-#include <formula/token.hxx>
++#include "stringutil.hxx"
++#include "docoptio.hxx"
+ 
++#include "formula/token.hxx"
++#include "tools/datetime.hxx"
++
++#define D_TIMEFACTOR              86400.0
+ 
+ using orcus::spreadsheet::row_t;
+ using orcus::spreadsheet::col_t;
+ using orcus::spreadsheet::formula_grammar_t;
+ 
+-ScOrcusFactory::ScOrcusFactory(ScDocument& rDoc) : mrDoc(rDoc) {}
++ScOrcusGlobalSettings::ScOrcusGlobalSettings(ScDocument& rDoc) : mrDoc(rDoc) {}
++
++void ScOrcusGlobalSettings::set_origin_date(int year, int month, int day)
++{
++    ScDocOptions aOpt = mrDoc.GetDocOptions();
++    aOpt.SetDate(year, month, day);
++    mrDoc.SetDocOptions(aOpt);
++}
++
++ScOrcusFactory::StringCellCache::StringCellCache(const ScAddress& rPos, size_t nIndex) :
++    maPos(rPos), mnIndex(nIndex) {}
++
++ScOrcusFactory::ScOrcusFactory(ScDocument& rDoc) :
++    mrDoc(rDoc),
++    maGlobalSettings(mrDoc),
++    maSharedStrings(maStrings) {}
+ 
+ orcus::spreadsheet::iface::import_sheet* ScOrcusFactory::append_sheet(const char* sheet_name, size_t sheet_name_length)
+ {
+@@ -29,7 +49,7 @@
+         return NULL;
+ 
+     SCTAB nTab = mrDoc.GetTableCount() - 1;
+-    maSheets.push_back(new ScOrcusSheet(mrDoc, nTab, maSharedStrings));
++    maSheets.push_back(new ScOrcusSheet(mrDoc, nTab, *this));
+     return &maSheets.back();
+ }
+ 
+@@ -61,10 +81,15 @@
+         return &(*it);
+ 
+     // Create a new orcus sheet instance for this.
+-    maSheets.push_back(new ScOrcusSheet(mrDoc, nTab, maSharedStrings));
++    maSheets.push_back(new ScOrcusSheet(mrDoc, nTab, *this));
+     return &maSheets.back();
+ }
+ 
++orcus::spreadsheet::iface::import_global_settings* ScOrcusFactory::get_global_settings()
++{
++    return &maGlobalSettings;
++}
++
+ orcus::spreadsheet::iface::import_shared_strings* ScOrcusFactory::get_shared_strings()
+ {
+     return &maSharedStrings;
+@@ -73,11 +98,31 @@
+ orcus::spreadsheet::iface::import_styles* ScOrcusFactory::get_styles()
+ {
+     // We don't support it yet.
+-    return new ScOrcusStyles;
++    return &maStyles;
+ }
+ 
+-ScOrcusSheet::ScOrcusSheet(ScDocument& rDoc, SCTAB nTab, ScOrcusSharedStrings& rSharedStrings) :
+-    mrDoc(rDoc), mnTab(nTab), mrSharedStrings(rSharedStrings) {}
++void ScOrcusFactory::finalize()
++{
++    ScSetStringParam aParam;
++    aParam.setTextInput();
++    StringCellCaches::const_iterator it = maStringCells.begin(), itEnd = maStringCells.end();
++    for (; it != itEnd; ++it)
++    {
++        if (it->mnIndex >= maStrings.size())
++            // String index out-of-bound!  Something is up.
++            continue;
++
++        mrDoc.SetString(it->maPos, maStrings[it->mnIndex], &aParam);
++    }
++}
++
++void ScOrcusFactory::pushStringCell(const ScAddress& rPos, size_t nStrIndex)
++{
++    maStringCells.push_back(StringCellCache(rPos, nStrIndex));
++}
++
++ScOrcusSheet::ScOrcusSheet(ScDocument& rDoc, SCTAB nTab, ScOrcusFactory& rFactory) :
++    mrDoc(rDoc), mnTab(nTab), mrFactory(rFactory) {}
+ 
+ void ScOrcusSheet::set_auto(row_t row, col_t col, const char* p, size_t n)
+ {
+@@ -85,6 +130,49 @@
+     mrDoc.SetString(col, row, mnTab, aVal);
+ }
+ 
++void ScOrcusSheet::set_string(row_t row, col_t col, size_t sindex)
++{
++    // We need to defer string cells since the shared string pool is not yet
++    // populated at the time this method is called.  Orcus imports string
++    // table after the cells get imported.  We won't need to do this once we
++    // implement true shared strings in Calc core.
++
++    mrFactory.pushStringCell(ScAddress(col, row, mnTab), sindex);
++}
++
++void ScOrcusSheet::set_value(row_t row, col_t col, double value)
++{
++    mrDoc.SetValue( col, row, mnTab, value );
++}
++
++void ScOrcusSheet::set_bool(row_t row, col_t col, bool value)
++{
++    mrDoc.SetValue(col, row, mnTab, value ? 1.0 : 0.0);
++}
++
++void ScOrcusSheet::set_date_time(
++    row_t row, col_t col, int year, int month, int day, int hour, int minute, double second)
++{
++    SvNumberFormatter* pFormatter = mrDoc.GetFormatTable();
++
++    Date aDate(day, month, year);
++    sal_uIntPtr nSec = floor(second);
++    sal_uIntPtr nSec100 = (second - nSec) * 100;
++    Time aTime(hour, minute, nSec, nSec100);
++    Date aNullDate(*pFormatter->GetNullDate());
++    long nDateDiff = aDate - aNullDate;
++
++    double fTime =
++        static_cast<double>(aTime.Get100Sec()) / 100.0 +
++        aTime.GetSec() +
++        aTime.GetMin() * 60.0 +
++        aTime.GetHour() * 3600.0;
++
++    fTime /= D_TIMEFACTOR;
++
++    mrDoc.SetValue(col, row, mnTab, nDateDiff + fTime);
++}
++
+ void ScOrcusSheet::set_format(row_t /*row*/, col_t /*col*/, size_t /*xf_index*/)
+ {
+ }
+@@ -191,45 +279,35 @@
+     mrDoc.PutCell( col, row, mnTab, pCell );
+ }
+ 
+-void ScOrcusSheet::set_string(row_t row, col_t col, size_t sindex)
++void ScOrcusSheet::set_array_formula(
++    row_t /*row*/, col_t /*col*/, formula_grammar_t /*grammar*/,
++    const char* /*p*/, size_t /*n*/, row_t /*array_rows*/, col_t /*array_cols*/)
+ {
+-    // Calc does not yet support shared strings so we have to
+-    // workaround by importing shared strings into a temporary
+-    // shared string container and writing into calc model as
+-    // normal string
+-
+-    const OUString& rSharedString = mrSharedStrings.getByIndex(sindex);
+-    ScBaseCell* pCell = ScBaseCell::CreateTextCell( rSharedString, &mrDoc );
+-    mrDoc.PutCell(col, row, mnTab, pCell);
+ }
+ 
+-void ScOrcusSheet::set_value(row_t row, col_t col, double value)
++void ScOrcusSheet::set_array_formula(
++    row_t /*row*/, col_t /*col*/, formula_grammar_t /*grammar*/,
++    const char* /*p*/, size_t /*n*/, const char* /*p_range*/, size_t /*n_range*/)
+ {
+-    mrDoc.SetValue( col, row, mnTab, value );
+ }
+ 
++ScOrcusSharedStrings::ScOrcusSharedStrings(std::vector<OUString>& rStrings) :
++    mrStrings(rStrings) {}
++
+ size_t ScOrcusSharedStrings::append(const char* s, size_t n)
+ {
+     OUString aNewString(s, n, RTL_TEXTENCODING_UTF8);
+-    maSharedStrings.push_back(aNewString);
++    mrStrings.push_back(aNewString);
+ 
+-    return maSharedStrings.size() - 1;
++    return mrStrings.size() - 1;
+ }
+ 
+ size_t ScOrcusSharedStrings::add(const char* s, size_t n)
+ {
+     OUString aNewString(s, n, RTL_TEXTENCODING_UTF8);
+-    maSharedStrings.push_back(aNewString);
+-
+-    return maSharedStrings.size() - 1;
+-}
+-
+-const OUString& ScOrcusSharedStrings::getByIndex(size_t nIndex) const
+-{
+-    if(nIndex < maSharedStrings.size())
+-        return maSharedStrings[nIndex];
++    mrStrings.push_back(aNewString);
+ 
+-    throw std::exception();
++    return mrStrings.size() - 1;
+ }
+ 
+ void ScOrcusSharedStrings::set_segment_bold(bool /*b*/)
+@@ -341,6 +419,14 @@
+     return 0;
+ }
+ 
++void ScOrcusStyles::set_number_format(const char* /*s*/, size_t /*n*/)
++{
++}
++
++size_t ScOrcusStyles::commit_number_format()
++{
++    return 0;
++}
+ 
+ // cell style xf
+ 
+--- sc/source/filter/orcus/orcusfiltersimpl.cxx	2013-06-11 05:33:38.000000000 -0400
++++ sc/source/filter/orcus/orcusfiltersimpl.cxx	2013-06-24 19:08:23.000000000 -0400
+@@ -17,6 +17,8 @@
+ #include <orcus/spreadsheet/import_interface.hpp>
+ #include <orcus/orcus_csv.hpp>
+ #include <orcus/orcus_gnumeric.hpp>
++#include <orcus/orcus_xlsx.hpp>
++#include <orcus/orcus_ods.hpp>
+ #include <orcus/global.hpp>
+ 
+ #ifdef WNT
+@@ -71,6 +73,46 @@
+     return true;
+ }
+ 
++bool ScOrcusFiltersImpl::importXLSX(ScDocument& rDoc, const rtl::OUString& rPath) const
++{
++    ScOrcusFactory aFactory(rDoc);
++    OString aSysPath = toSystemPath(rPath);
++    const char* path = aSysPath.getStr();
++
++    try
++    {
++        orcus::orcus_xlsx filter(&aFactory);
++        filter.read_file(path);
++    }
++    catch (const std::exception& e)
++    {
++        SAL_WARN("sc", "Unable to load xlsx file! " << e.what());
++        return false;
++    }
++
++    return true;
++}
++
++bool ScOrcusFiltersImpl::importODS(ScDocument& rDoc, const rtl::OUString& rPath) const
++{
++    ScOrcusFactory aFactory(rDoc);
++    OString aSysPath = toSystemPath(rPath);
++    const char* path = aSysPath.getStr();
++
++    try
++    {
++        orcus::orcus_ods filter(&aFactory);
++        filter.read_file(path);
++    }
++    catch (const std::exception& e)
++    {
++        SAL_WARN("sc", "Unable to load ods file! " << e.what());
++        return false;
++    }
++
++    return true;
++}
++
+ ScOrcusXMLContext* ScOrcusFiltersImpl::createXMLContext(ScDocument& rDoc, const rtl::OUString& rPath) const
+ {
+     return new ScOrcusXMLContextImpl(rDoc, rPath);

Copied: head/editors/libreoffice/files/patch-mdds-0.8.x (from r321768, head/editors/libreoffice/files/patch-mdds-api-breakage)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/libreoffice/files/patch-mdds-0.8.x	Tue Jun 25 21:55:09 2013	(r321770, copy of r321768, head/editors/libreoffice/files/patch-mdds-api-breakage)
@@ -0,0 +1,72 @@
+From 4a8e36d20609f1f7918976d4db13d720524a3c9c Mon Sep 17 00:00:00 2001
+From: Kohei Yoshida <kohei.yoshida@gmail.com>
+Date: Mon, 06 May 2013 14:27:55 +0000
+Subject: Adjust for API change in mdds 0.8.0.
+
+The return value of search_tree() in flat_segment_tree has changed.
+
+Change-Id: I51d8676bd0621bd43b3f8a8f6be4bf4056d45904
+---
+diff --git a/sc/source/core/data/dpfilteredcache.cxx b/sc/source/core/data/dpfilteredcache.cxx
+index 47adbbe..51bf571 100644
+--- sc/source/core/data/dpfilteredcache.cxx
++++ b/sc/source/core/data/dpfilteredcache.cxx
+@@ -172,7 +172,7 @@ void ScDPFilteredCache::fillTable(
+         {
+             if (nRow > nEndSegment)
+             {
+-                if (!maShowByFilter.search_tree(nRow, bShow, NULL, &nEndSegment))
++                if (!maShowByFilter.search_tree(nRow, bShow, NULL, &nEndSegment).second)
+                 {
+                     OSL_FAIL("Tree search failed!");
+                     continue;
+diff --git a/sc/source/core/data/segmenttree.cxx b/sc/source/core/data/segmenttree.cxx
+index e74b0fd..b02f164 100644
+--- sc/source/core/data/segmenttree.cxx
++++ b/sc/source/core/data/segmenttree.cxx
+@@ -159,7 +159,7 @@ bool ScFlatSegmentsImpl<_ValueType, _ExtValueType>::getRangeData(SCCOLROW nPos,
+     if (!maSegments.is_tree_valid())
+         maSegments.build_tree();
+ 
+-    if (!maSegments.search_tree(nPos, nValue, &nPos1, &nPos2))
++    if (!maSegments.search_tree(nPos, nValue, &nPos1, &nPos2).second)
+         return false;
+ 
+     rData.mnPos1 = nPos1;
+diff --git a/sc/source/filter/excel/colrowst.cxx b/sc/source/filter/excel/colrowst.cxx
+index 53aa04b..bc43a1e 100644
+--- sc/source/filter/excel/colrowst.cxx
++++ b/sc/source/filter/excel/colrowst.cxx
+@@ -208,7 +208,7 @@ void XclImpColRowSettings::Convert( SCTAB nScTab )
+         if (GetColFlag(nCol, EXC_COLROW_USED))
+         {
+             sal_uInt16 nTmp;
+-            if (maColWidths.search_tree(nCol, nTmp))
++            if (maColWidths.search_tree(nCol, nTmp).second)
+                 nWidth = nTmp;
+         }
+ 
+@@ -258,7 +258,7 @@ void XclImpColRowSettings::Convert( SCTAB nScTab )
+                     for (SCROW i = nPrevRow; i <= nRow - 1; ++i)
+                     {
+                         SCROW nLast;
+-                        if (!maRowHeights.search_tree(i, nHeight, NULL, &nLast))
++                        if (!maRowHeights.search_tree(i, nHeight, NULL, &nLast).second)
+                         {
+                             // search failed for some reason
+                             return;
+diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx
+index 4f7a937..cefa640 100644
+--- sc/source/filter/xml/XMLStylesExportHelper.cxx
++++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
+@@ -1280,7 +1280,7 @@ sal_Int32 ScRowStyles::GetStyleNameIndex(const sal_Int32 nTable, const sal_Int32
+         r.build_tree();
+     sal_Int32 nStyle;
+     sal_Int32 nStart, nEnd;
+-    if (r.search_tree(nField, nStyle, &nStart, &nEnd))
++    if (r.search_tree(nField, nStyle, &nStart, &nEnd).second)
+     {
+         // Cache this value for better performance.
+         maCache.mnTable = nTable;
+--
+cgit v0.9.0.2-2-gbebe
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 4 Jung-uk Kim freebsd_committer freebsd_triage 2013-06-25 23:07:05 UTC
State Changed
From-To: open->closed

Fixed in r321770.  Thanks!