connectivity/source/drivers/file/FResultSet.cxx   |    6 ++++
 connectivity/source/drivers/flat/ETable.cxx       |    7 +++--
 oox/source/drawingml/chart/typegroupconverter.cxx |    4 +--
 oox/source/export/chartexport.cxx                 |    7 ++++-
 sc/inc/tablink.hxx                                |    8 +++++-
 sc/source/core/data/table2.cxx                    |    2 -
 sc/source/filter/excel/xeformula.cxx              |   16 ++++++++++---
 sc/source/filter/excel/xichart.cxx                |    4 +--
 sc/source/filter/excel/xlformula.cxx              |   24 ++++++++++++++++++-
 sc/source/filter/inc/formulabase.hxx              |    1 
 sc/source/filter/inc/xlformula.hxx                |   13 ++++++++--
 sc/source/filter/oox/formulabase.cxx              |   27 +++++++++++++---------
 sc/source/filter/oox/workbookhelper.cxx           |    7 ++---
 sc/source/ui/docshell/arealink.cxx                |    2 -
 sc/source/ui/docshell/tablink.cxx                 |   18 +++++++++-----
 sc/source/ui/view/output.cxx                      |    5 ++--
 scaddins/source/analysis/analysishelper.cxx       |    2 -
 17 files changed, 110 insertions(+), 43 deletions(-)

New commits:
commit e6e9b30375bc76c38c2b1a998ad77e4baffba41f
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sat Nov 30 11:54:20 2013 +0100

    fdo#72148 if expecting table at begin, explicitly set it so
    
    Change-Id: Ic876603e5860b987280b73726fd79a071a9c833c
    Reviewed-on: https://gerrit.libreoffice.org/6863
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/connectivity/source/drivers/file/FResultSet.cxx 
b/connectivity/source/drivers/file/FResultSet.cxx
index be363b3..180fd01 100644
--- a/connectivity/source/drivers/file/FResultSet.cxx
+++ b/connectivity/source/drivers/file/FResultSet.cxx
@@ -1094,7 +1094,11 @@ sal_Bool OResultSet::Move(IResultSetHelper::Movement 
eCursorPosition, sal_Int32
                 else // Index must be further constructed
                 {
                     // set first on the last known row
-                    if (!m_pFileSet->get().empty())
+                    if (m_pFileSet->get().empty())
+                    {
+                        m_pTable->seekRow(IResultSetHelper::ABSOLUTE, 0, 
m_nFilePos);
+                    }
+                    else
                     {
                         m_aFileSetIter = m_pFileSet->get().end()-1;
                         m_pTable->seekRow(IResultSetHelper::BOOKMARK, 
*m_aFileSetIter, m_nFilePos);
commit 435250880f626be8161467210d49fe7e620dce04
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sat Nov 30 11:58:39 2013 +0100

    flat text DB: fix move by bookmark
    
    To test whether the range [a,b( is *before* e,
    compare e to b, not to a.
    
    This makes a difference when a==b, which happens for row 0 (header)
    when there is no header.
    
    Conflicts:
        connectivity/source/drivers/flat/ETable.cxx
    
    Change-Id: I629b71936f82a468febe0360909264dd80304437
    Reviewed-on: https://gerrit.libreoffice.org/6864
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/connectivity/source/drivers/flat/ETable.cxx 
b/connectivity/source/drivers/flat/ETable.cxx
index f777e63..d1cab11 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -757,9 +757,10 @@ void OFlatTable::refreshHeader()
 // 
-----------------------------------------------------------------------------
 namespace
 {
-    template< typename Tp, typename Te> bool pairFirstLess(const Tp &p, const 
Te &e)
+    template< typename Tp, typename Te> bool RangeBefore(const Tp &p, const Te 
&e)
     {
-        return p.first < e;
+        assert(p.first <= p.second);
+        return p.second <= e;
     }
 }
 // 
-----------------------------------------------------------------------------
@@ -898,7 +899,7 @@ sal_Bool OFlatTable::seekRow(IResultSetHelper::Movement 
eCursorPosition, sal_Int
                 vector< TRowPositionInFile >::const_iterator aFind = 
lower_bound(m_aRowPosToFilePos.begin(),
                                                                                
  m_aRowPosToFilePos.end(),
                                                                                
  nOffset,
-                                                                               
  pairFirstLess< TRowPositionInFile, sal_Int32 >);
+                                                                               
  RangeBefore< TRowPositionInFile, sal_Int32 >);
 
                 if(aFind == m_aRowPosToFilePos.end() || aFind->first != 
nOffset)
                     //invalid bookmark
commit 718b1f4a580376e0a109594e3bd1a3d880b9c6b8
Author: Markus Mohrhard <markus.mohrh...@googlemail.com>
Date:   Mon Dec 2 08:06:44 2013 +0100

    don't use fixed size icon sets, fdo#62652
    
    actually we should switch to svg as soon as it becomes possible
    
    Change-Id: Ifbbe5befab94441f04fadb90b779e0bc8c15eda4
    Reviewed-on: https://gerrit.libreoffice.org/6890
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 5826efd..9bbfee8 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -882,11 +882,12 @@ BitmapEx& getIcon( ScIconSetType eType, sal_Int32 nIndex )
 
 void drawIconSets( const ScIconSetInfo* pOldIconSetInfo, OutputDevice* pDev, 
const Rectangle& rRect )
 {
-    long nSize = 16;
+    //long nSize = 16;
     ScIconSetType eType = pOldIconSetInfo->eIconSetType;
     sal_Int32 nIndex = pOldIconSetInfo->nIconIndex;
     BitmapEx& rIcon = getIcon( eType, nIndex );
-    pDev->DrawBitmapEx( Point( rRect.Left() +2, rRect.Top() + 2 ), Size( 
nSize, nSize ), rIcon );
+    long aOrigSize = std::max<long>(0,std::min(rRect.GetSize().getWidth() - 4, 
rRect.GetSize().getHeight() -4));
+    pDev->DrawBitmapEx( Point( rRect.Left() +2, rRect.Top() + 2 ), 
Size(aOrigSize, aOrigSize), rIcon );
 }
 
 void drawCells(const Color* pColor, const SvxBrushItem* pBackground, const 
Color*& pOldColor, const SvxBrushItem*& pOldBackground,
commit a231a03af930d1aead84c68a0c4745a2607130d3
Author: Andras Timar <andras.ti...@collabora.com>
Date:   Mon Dec 2 12:11:10 2013 +0100

    fdo#72078 make status bar text localizable
    
    2nd try to get it right on libreoffice-4-1
    
    Change-Id: I66ebc292231069cca708eb56ad876f56829e78f5
    Reviewed-on: https://gerrit.libreoffice.org/6894
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/filter/oox/workbookhelper.cxx 
b/sc/source/filter/oox/workbookhelper.cxx
index 8a180eb..384a55a 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -71,6 +71,7 @@
 #include "dbdata.hxx"
 #include "datauno.hxx"
 #include "globalnames.hxx"
+#include "globstr.hrc"
 
 #include "formulabuffer.hxx"
 #include "vcl/mapmod.hxx"
@@ -582,8 +583,7 @@ void WorkbookGlobals::initialize( bool bWorkbookFile )
         if( xLockable.is() )
             xLockable->addActionLock();
 
-        //! TODO: localize progress bar text
-        mxProgressBar.reset( new SegmentProgressBar( 
mrBaseFilter.getStatusIndicator(), "Loading..." ) );
+        mxProgressBar.reset( new SegmentProgressBar( 
mrBaseFilter.getStatusIndicator(), ScGlobal::GetRscString(STR_LOAD_DOC) ) );
         mxFmlaParser.reset( new FormulaParser( *this ) );
 
         //prevent unnecessary broadcasts and "half way listeners" as
@@ -592,8 +592,7 @@ void WorkbookGlobals::initialize( bool bWorkbookFile )
     }
     else if( mrBaseFilter.isExportFilter() )
     {
-        //! TODO: localize progress bar text
-        mxProgressBar.reset( new SegmentProgressBar( 
mrBaseFilter.getStatusIndicator(), "Saving..." ) );
+        mxProgressBar.reset( new SegmentProgressBar( 
mrBaseFilter.getStatusIndicator(), ScGlobal::GetRscString(STR_SAVE_DOC) ) );
     }
     // filter specific
     switch( getFilterType() )
commit 6510b696142994704ad6d52b9b990fc615430d16
Author: Markus Mohrhard <markus.mohrh...@googlemail.com>
Date:   Sun Dec 1 04:19:09 2013 +0100

    fix validation error for OOXML chart export, related fdo#67300
    
    Change-Id: I7d74439bba3b912fe9b81ebeca865298bc32d71e
    Reviewed-on: https://gerrit.libreoffice.org/6879
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>
    Tested-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index b654001..e6da04b 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1277,8 +1277,11 @@ void ChartExport::exportPieChart( Reference< 
chart2::XChartType > xChartType )
     sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y;
     exportSeries( xChartType, nAttachedAxis );
 
-    // firstSliceAng
-    exportFirstSliceAng( );
+    if( !mbIs3DChart )
+    {
+        // firstSliceAng
+        exportFirstSliceAng( );
+    }
 
     pFS->endElement( FSNS( XML_c, nTypeId ) );
 }
commit d68994b5d36c89bf1a5db89612121deed6bfb7ae
Author: Markus Mohrhard <markus.mohrh...@googlemail.com>
Date:   Sun Dec 1 04:45:36 2013 +0100

    fix 2D vs 3D coordinatesystem regression, fdo#67300
    
    regression from 088e86b865062dd4cc5ba0c85c6068dea62238db
    
    Change-Id: Ifc8d5a1da328278175bbc97b4f2aad8e6d200751
    Reviewed-on: https://gerrit.libreoffice.org/6880
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>
    Tested-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx 
b/oox/source/drawingml/chart/typegroupconverter.cxx
index bf8e166..b87fc45 100644
--- a/oox/source/drawingml/chart/typegroupconverter.cxx
+++ b/oox/source/drawingml/chart/typegroupconverter.cxx
@@ -248,9 +248,9 @@ Reference< XCoordinateSystem > 
TypeGroupConverter::createCoordinateSystem()
     if( maTypeInfo.mbPolarCoordSystem )
     {
         if( mb3dChart )
-            xCoordSystem = 
css::chart2::PolarCoordinateSystem2d::create(xContext);
-        else
             xCoordSystem = 
css::chart2::PolarCoordinateSystem3d::create(xContext);
+        else
+            xCoordSystem = 
css::chart2::PolarCoordinateSystem2d::create(xContext);
     }
     else
     {
diff --git a/sc/source/filter/excel/xichart.cxx 
b/sc/source/filter/excel/xichart.cxx
index e07d1d4..10d858a 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -2328,9 +2328,9 @@ Reference< XCoordinateSystem > 
XclImpChType::CreateCoordSystem( bool b3dChart )
     if( maTypeInfo.mbPolarCoordSystem )
     {
         if( b3dChart )
-            xCoordSystem = 
css::chart2::PolarCoordinateSystem2d::create(xContext);
-        else
             xCoordSystem = 
css::chart2::PolarCoordinateSystem3d::create(xContext);
+        else
+            xCoordSystem = 
css::chart2::PolarCoordinateSystem2d::create(xContext);
     }
     else
     {
commit 86eda6bda5a6506507248930d5cb751bc94edcf4
Author: Julien Nabet <serval2...@yahoo.fr>
Date:   Sat Nov 30 18:28:15 2013 +0100

    Resolves: fdo#72174 convert_add from "at" or "atm" to "Pa" gives same answer
    
    Change-Id: I76c1a0bd7cc93cf60ffa8da08200969a7315a8c3
    Reviewed-on: https://gerrit.libreoffice.org/6870
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>
    Tested-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/scaddins/source/analysis/analysishelper.cxx 
b/scaddins/source/analysis/analysishelper.cxx
index d84dc39..d5ff83b 100644
--- a/scaddins/source/analysis/analysishelper.cxx
+++ b/scaddins/source/analysis/analysishelper.cxx
@@ -2541,7 +2541,7 @@ ConvertDataList::ConvertDataList( void )
     // PRESSURE: 1 Pascal is...
     NEWDP( "Pa",    1.0000000000000000E00,  CDC_Pressure ); // Pascal
     NEWDP( "atm",   9.8692329999819300E-06, CDC_Pressure ); // Atmosphere
-    NEWDP( "at",    9.8692329999819300E-06, CDC_Pressure ); // Atmosphere also
+    NEWDP( "at",    1.0197162129779000E-05, CDC_Pressure ); // Atmosphere also
     NEWDP( "mmHg",  7.5006170799862700E-03, CDC_Pressure ); // mm Hg (Mercury)
     NEWD( "Torr",   7.5006380000000000E-03, CDC_Pressure ); // *** Torr
     NEWD( "psi",    1.4503770000000000E-04, CDC_Pressure ); // *** Psi
commit bfa83ee68a1d4a3c6f4efe7218910cddb4276910
Author: Eike Rathke <er...@redhat.com>
Date:   Sat Nov 2 16:25:42 2013 +0100

    resolved fdo#67536 export internal equivalents as add-in to .xls
    
    For BIFF .xls export the internal functions that are equivalents of
    known add-in functions as those add-in functions.
    
    (cherry picked from commit 06a5b1ecc39bb50dadc0bcb7378455500943ece3)
    
    Conflicts:
        sc/source/filter/inc/xlformula.hxx
    
    Change-Id: If37f616a34fdabb3fa971fddad01da3dc1f28ee9
    Reviewed-on: https://gerrit.libreoffice.org/6525
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sc/source/filter/excel/xeformula.cxx 
b/sc/source/filter/excel/xeformula.cxx
index 5265bd1..d58e0ba 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -139,6 +139,7 @@ public:
     inline sal_uInt16   GetXclFuncIdx() const { return mrFuncInfo.mnXclFunc; }
     inline bool         IsVolatile() const { return mrFuncInfo.IsVolatile(); }
     inline bool         IsFixedParamCount() const { return 
mrFuncInfo.IsFixedParamCount(); }
+    inline bool         IsAddInEquivalent() const { return 
mrFuncInfo.IsAddInEquivalent(); }
     inline bool         IsMacroFunc() const { return mrFuncInfo.IsMacroFunc(); 
}
     inline sal_uInt8    GetSpaces() const { return mrTokData.mnSpaces; }
     inline const XclExpExtFuncData& GetExtFuncData() const { return 
maExtFuncData; }
@@ -1360,8 +1361,11 @@ void XclExpFmlaCompImpl::ProcessFunction( const 
XclExpScToken& rTokData )
     mxData->mbOk = pFuncInfo != 0;
     if( !mxData->mbOk ) return;
 
+    // internal functions equivalent to an existing add-in
+    if( pFuncInfo->IsAddInEquivalent() )
+        aExtFuncData.Set( pFuncInfo->GetAddInEquivalentFuncName(), true, false 
);
     // functions simulated by a macro call in file format
-    if( pFuncInfo->IsMacroFunc() )
+    else if( pFuncInfo->IsMacroFunc() )
         aExtFuncData.Set( pFuncInfo->GetMacroFuncName(), false, true );
 
     XclExpFuncData aFuncData( rTokData, *pFuncInfo, aExtFuncData );
@@ -1643,8 +1647,11 @@ void XclExpFmlaCompImpl::AppendDefaultParam( 
XclExpFuncData& rFuncData )
         break;
         default:
         {
-            OSL_ENSURE( rFuncData.IsMacroFunc(), 
"XclExpFmlaCompImpl::AppendDefaultParam - unknown opcode" );
-            if( rFuncData.IsMacroFunc() )
+            if( rFuncData.IsAddInEquivalent() )
+            {
+                AppendAddInCallToken( rFuncData.GetExtFuncData() );
+            }
+            else if( rFuncData.IsMacroFunc() )
             {
                 // Do not write the OOXML <definedName> element for new _xlfn.
                 // prefixed functions.
@@ -1654,7 +1661,10 @@ void XclExpFmlaCompImpl::AppendDefaultParam( 
XclExpFuncData& rFuncData )
                     AppendMacroCallToken( rFuncData.GetExtFuncData() );
             }
             else
+            {
+                SAL_WARN( "sc.filter", "XclExpFmlaCompImpl::AppendDefaultParam 
- unknown opcode" );
                 AppendMissingToken();   // to keep parameter count valid
+            }
         }
     }
 
diff --git a/sc/source/filter/excel/xlformula.cxx 
b/sc/source/filter/excel/xlformula.cxx
index d4bdc86..a04a101 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -40,6 +40,13 @@ String XclFunctionInfo::GetMacroFuncName() const
     return EMPTY_STRING;
 }
 
+String XclFunctionInfo::GetAddInEquivalentFuncName() const
+{
+    if( IsAddInEquivalent() )
+        return String( mpcMacroName, strlen(mpcMacroName), 
RTL_TEXTENCODING_UTF8 );
+    return EMPTY_STRING;
+}
+
 // abbreviations for function return token class
 const sal_uInt8 R = EXC_TOKCLASS_REF;
 const sal_uInt8 V = EXC_TOKCLASS_VAL;
@@ -64,6 +71,7 @@ const sal_uInt8 MX    = 30;                 /// Maximum 
parameter count.
 
 #define EXC_FUNCNAME( ascii )       "_xlfn." ascii
 #define EXC_FUNCNAME_ODF( ascii )   "_xlfnodf." ascii
+#define EXC_FUNCNAME_ADDIN( ascii )   "com.sun.star.sheet.addin." ascii
 
 /** Functions new in BIFF2. */
 static const XclFunctionInfo saFuncTable_2[] =
@@ -309,7 +317,21 @@ static const XclFunctionInfo saFuncTable_4[] =
     { ocPercentrank,        329,    2,  3,  V, { RX, VR, VR_E }, 0, 0 },
     { ocModalValue,         330,    1,  MX, V, { VA }, 0, 0 },
     { ocTrimMean,           331,    2,  2,  V, { RX, VR }, 0, 0 },
-    { ocTInv,               332,    2,  2,  V, { VR }, 0, 0 }
+    { ocTInv,               332,    2,  2,  V, { VR }, 0, 0 },
+    // Functions equivalent to add-in functions, use same parameters as
+    // ocExternal but add programmatical function name (here without
+    // "com.sun.star.sheet.addin.") so it can be looked up and stored as
+    // add-in, as older Excel versions only know them as add-in.
+    // These are the functions flagged as AddInMap::bMapDupToInternal=true in
+    // sc/source/core/tool/odffmap.cxx
+    { ocIsEven,             255,    1,  MX, R, { RO_E, RO }, 
EXC_FUNCFLAG_EXPORTONLY | EXC_FUNCFLAG_ADDINEQUIV, EXC_FUNCNAME_ADDIN( 
"Analysis.getIseven" ) },
+    { ocIsOdd,              255,    1,  MX, R, { RO_E, RO }, 
EXC_FUNCFLAG_EXPORTONLY | EXC_FUNCFLAG_ADDINEQUIV, EXC_FUNCNAME_ADDIN( 
"Analysis.getIsodd" ) },
+    { ocGCD,                255,    1,  MX, R, { RO_E, RO }, 
EXC_FUNCFLAG_EXPORTONLY | EXC_FUNCFLAG_ADDINEQUIV, EXC_FUNCNAME_ADDIN( 
"Analysis.getGcd" ) },
+    { ocLCM,                255,    1,  MX, R, { RO_E, RO }, 
EXC_FUNCFLAG_EXPORTONLY | EXC_FUNCFLAG_ADDINEQUIV, EXC_FUNCNAME_ADDIN( 
"Analysis.getLcm" ) },
+    { ocEffektiv,           255,    1,  MX, R, { RO_E, RO }, 
EXC_FUNCFLAG_EXPORTONLY | EXC_FUNCFLAG_ADDINEQUIV, EXC_FUNCNAME_ADDIN( 
"Analysis.getEffect" ) },
+    { ocKumKapZ,            255,    1,  MX, R, { RO_E, RO }, 
EXC_FUNCFLAG_EXPORTONLY | EXC_FUNCFLAG_ADDINEQUIV, EXC_FUNCNAME_ADDIN( 
"Analysis.getCumprinc" ) },
+    { ocKumZinsZ,           255,    1,  MX, R, { RO_E, RO }, 
EXC_FUNCFLAG_EXPORTONLY | EXC_FUNCFLAG_ADDINEQUIV, EXC_FUNCNAME_ADDIN( 
"Analysis.getCumipmt" ) },
+    { ocNominal,            255,    1,  MX, R, { RO_E, RO }, 
EXC_FUNCFLAG_EXPORTONLY | EXC_FUNCFLAG_ADDINEQUIV, EXC_FUNCNAME_ADDIN( 
"Analysis.getNominal" ) }
 };
 
 /** Functions new in BIFF5/BIFF7. Unsupported functions: DATESTRING, 
NUMBERSTRING. */
diff --git a/sc/source/filter/inc/xlformula.hxx 
b/sc/source/filter/inc/xlformula.hxx
index 7768769..78b5405 100644
--- a/sc/source/filter/inc/xlformula.hxx
+++ b/sc/source/filter/inc/xlformula.hxx
@@ -285,6 +285,7 @@ const sal_uInt8 EXC_FUNCFLAG_VOLATILE       = 0x01;     /// 
Result is volatile (
 const sal_uInt8 EXC_FUNCFLAG_IMPORTONLY     = 0x02;     /// Only used in 
import filter.
 const sal_uInt8 EXC_FUNCFLAG_EXPORTONLY     = 0x04;     /// Only used in 
export filter.
 const sal_uInt8 EXC_FUNCFLAG_PARAMPAIRS     = 0x08;     /// Optional 
parameters are expected to appear in pairs.
+const sal_uInt8 EXC_FUNCFLAG_ADDINEQUIV     = 0x10;     /// Function is an 
add-in equivalent
 
 // selected function IDs
 const sal_uInt16 EXC_FUNCID_IF              = 1;
@@ -311,7 +312,11 @@ struct XclFunctionInfo
     sal_uInt8           mnRetClass;         /// Token class of the return 
value.
     XclFuncParamInfo    mpParamInfos[ EXC_FUNCINFO_PARAMINFO_COUNT ]; /// 
Information for all parameters.
     sal_uInt8           mnFlags;            /// Additional flags 
(EXC_FUNCFLAG_* constants).
-    const sal_Char*     mpcMacroName;       /// Function name, if simulated by 
a macro call (UTF-8).
+    const sal_Char*     mpcMacroName;       /** Function name, if simulated by
+                                                a macro call (UTF-8) 
EXC_FUNCFLAG_ADDINEQUIV is 0;
+                                                or programmatical add-in name
+                                                if stored as such and
+                                                EXC_FUNCFLAG_ADDINEQUIV is 
set. */
 
     /** Returns true, if the function is volatile. */
     inline bool         IsVolatile() const { return ::get_flag( mnFlags, 
EXC_FUNCFLAG_VOLATILE ); }
@@ -320,9 +325,13 @@ struct XclFunctionInfo
     /** Returns true, if the function parameter count is fixed. */
     inline bool         IsFixedParamCount() const { return (mnXclFunc != 
EXC_FUNCID_EXTERNCALL) && (mnMinParamCount == mnMaxParamCount); }
     /** Returns true, if the function is simulated by a macro call. */
-    inline bool         IsMacroFunc() const { return mpcMacroName != 0; }
+    inline bool         IsMacroFunc() const { return mpcMacroName != 0 && 
!(mnFlags & EXC_FUNCFLAG_ADDINEQUIV); }
+    /** Returns true, if the function is stored as an add-in call. */
+    inline bool         IsAddInEquivalent() const { return mpcMacroName != 0 
&& (mnFlags & EXC_FUNCFLAG_ADDINEQUIV); }
     /** Returns the name of the external function as string. */
     String              GetMacroFuncName() const;
+    /** Returns the programmatical name of the Add-In function as string. */
+    String              GetAddInEquivalentFuncName() const;
 };
 
 // ----------------------------------------------------------------------------
commit b829d1d48e755defa317590705906f50526de8a3
Author: Eike Rathke <er...@redhat.com>
Date:   Wed Nov 27 00:04:44 2013 +0100

    resolved fdo#53103 actually use the external data filter options
    
    ScDocShell::ConvertFrom() queries the filter options from the SfxItemSet
    at SfxMedium, which is fine when loading the data into the table
    selector first, but the final load via ScAreaLink created a bare
    SfxMedium without options set. Do so.
    
    Additionally it may now even work that ScDocShell sets options at
    SfxMedium, which the ScAreaLink code prepared for but previously the
    SfxMedium did not have an SfxItemSet.
    
    Change-Id: I45d6a24906dc3ba41654b8c0951dd84939d8af5e
    (cherry picked from commit 513eadd422ff6a41cfe9a16f82cf32872d729652)
    Reviewed-on: https://gerrit.libreoffice.org/6823
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sc/inc/tablink.hxx b/sc/inc/tablink.hxx
index 068d87f..49833af 100644
--- a/sc/inc/tablink.hxx
+++ b/sc/inc/tablink.hxx
@@ -72,6 +72,7 @@ public:
 
 class ScDocument;
 class SfxMedium;
+class SfxFilter;
 
 class SC_DLLPUBLIC ScDocumentLoader
 {
@@ -96,7 +97,12 @@ public:
 
     void                ReleaseDocRef();    // without calling DoClose
 
-    static OUString GetOptions( SfxMedium& rMedium );
+    /** Create SfxMedium for stream read with SfxFilter and filter options set
+        at the medium's SfxItemSet.
+     */
+    static SfxMedium*   CreateMedium( const OUString& rFileName, const 
SfxFilter* pFilter, const OUString& rOptions );
+
+    static OUString     GetOptions( SfxMedium& rMedium );
 
     /** Returns the filter name and options from a file name.
         @param bWithContent
diff --git a/sc/source/ui/docshell/arealink.cxx 
b/sc/source/ui/docshell/arealink.cxx
index 6409fbd..f80c80a 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -253,7 +253,7 @@ sal_Bool ScAreaLink::Refresh( const String& rNewFile, const 
String& rNewFilter,
     if ( rNewFilter != aFilterName )
         aOptions.Erase();
 
-    SfxMedium* pMed = new SfxMedium(aNewUrl, STREAM_STD_READ, pFilter);
+    SfxMedium* pMed = ScDocumentLoader::CreateMedium( aNewUrl, pFilter, 
aOptions);
 
     // aRef->DoClose() will be closed explicitly, but it is still more safe to 
use SfxObjectShellLock here
     ScDocShell* pSrcShell = new ScDocShell(SFX_CREATE_MODE_INTERNAL);
diff --git a/sc/source/ui/docshell/tablink.cxx 
b/sc/source/ui/docshell/tablink.cxx
index ba1ed72..0164e27 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -519,6 +519,17 @@ void ScDocumentLoader::RemoveAppPrefix( OUString& 
rFilterName )
         rFilterName = rFilterName.copy( aAppPrefix.getLength());
 }
 
+SfxMedium* ScDocumentLoader::CreateMedium( const OUString& rFileName, const 
SfxFilter* pFilter,
+        const OUString& rOptions )
+{
+    // Always create SfxItemSet so ScDocShell can set options.
+    SfxItemSet* pSet = new SfxAllItemSet( SFX_APP()->GetPool() );
+    if ( !rOptions.isEmpty() )
+        pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, rOptions ) );
+
+    return new SfxMedium( rFileName, STREAM_STD_READ, pFilter, pSet );
+}
+
 ScDocumentLoader::ScDocumentLoader( const OUString& rFileName,
                                     OUString& rFilterName, OUString& rOptions,
                                     sal_uInt32 nRekCnt, bool bWithInteraction 
) :
@@ -530,12 +541,7 @@ ScDocumentLoader::ScDocumentLoader( const OUString& 
rFileName,
 
     const SfxFilter* pFilter = 
ScDocShell::Factory().GetFilterContainer()->GetFilter4FilterName( rFilterName );
 
-    //  ItemSet immer anlegen, damit die DocShell die Optionen setzen kann
-    SfxItemSet* pSet = new SfxAllItemSet( SFX_APP()->GetPool() );
-    if ( !rOptions.isEmpty() )
-        pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, rOptions ) );
-
-    pMedium = new SfxMedium( rFileName, STREAM_STD_READ, pFilter, pSet );
+    pMedium = CreateMedium( rFileName, pFilter, rOptions);
     if ( pMedium->GetError() != ERRCODE_NONE )
         return ;
 
commit e91ffe713a68e3beedc51a255bc5bfc012a51a6b
Author: Eike Rathke <er...@redhat.com>
Date:   Sat Nov 23 12:16:51 2013 +0100

    resolved fdo#61946 use correct TabDelta for UpdateReference
    
    The sheet delta was reverted resulting in the references not being
    updated when conditional formats were copy-pasted between sheets. Saved
    to .ods then was an identical calcext:target-range-address as for the
    copied source range.
    
    (cherry picked from commit ef8e0beba442f58abe3bc77f6f55fc6109025dd4)
    
    Backported.
    
    Change-Id: I038b58f20f71ff1393dccafa3021dac02cd69e4b
    Reviewed-on: https://gerrit.libreoffice.org/6768
    Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 220211c..6c530d3 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -712,7 +712,7 @@ void ScTable::CopyConditionalFormat( SCCOL nCol1, SCROW 
nRow1, SCCOL nCol2, SCRO
         ScConditionalFormat* pNewFormat = itr->Clone(pDocument);
 
         pNewFormat->AddRange(aIntersectedRange);
-        pNewFormat->UpdateReference(URM_COPY, aNewRange, nDx, nDy, 
pTable->nTab - nTab, true);
+        pNewFormat->UpdateReference(URM_COPY, aNewRange, nDx, nDy, nTab - 
pTable->nTab, true);
 
         sal_uLong nMax = 0;
         for(ScConditionalFormatList::const_iterator itrCond = 
mpCondFormatList->begin();
commit 35faa8b9de971e8ee2e0dbe02584418e593101db
Author: Eike Rathke <er...@redhat.com>
Date:   Sat Nov 2 21:03:17 2013 +0100

    resolved fdo#67572 export add-in equivalents as internal to .xlsx
    
    For OOXML .xlsx export the add-in functions that are equivalents of
    known internal functions as those internal functions.
    
    (cherry picked from commit da7c6092a644dc22f90fb8eef0c4f0df06ec204a)
    
    Minus the DURATION change that was fixed on master (and 4.2) with
    62e1a27dc757637223f5f18b1a340ba138e0cb82
    
    Change-Id: Ic41f32b67902effa07c3d4db137be08dc5af7265
    Reviewed-on: https://gerrit.libreoffice.org/6530
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sc/source/filter/inc/formulabase.hxx 
b/sc/source/filter/inc/formulabase.hxx
index cb2785e..50948f7 100644
--- a/sc/source/filter/inc/formulabase.hxx
+++ b/sc/source/filter/inc/formulabase.hxx
@@ -499,6 +499,7 @@ struct FunctionInfo
     bool                mbParamPairs;       /// True = optional parameters are 
expected to appear in pairs.
     bool                mbVolatile;         /// True = volatile function.
     bool                mbExternal;         /// True = external function in 
Calc.
+    bool                mbInternal;         /// True = internal function in 
Calc. (Both can be true!)
     bool                mbMacroFunc;        /// True = macro sheet function or 
command.
     bool                mbVarParam;         /// True = use a tFuncVar token, 
also if min/max are equal.
 };
diff --git a/sc/source/filter/oox/formulabase.cxx 
b/sc/source/filter/oox/formulabase.cxx
index d0db2e7..c222e7e 100644
--- a/sc/source/filter/oox/formulabase.cxx
+++ b/sc/source/filter/oox/formulabase.cxx
@@ -212,6 +212,7 @@ const sal_uInt16 FUNCFLAG_MACROCALL_NEW     = 
FUNCFLAG_MACROCALL | FUNCFLAG_MACR
                                                             must exist. */
 const sal_uInt16 FUNCFLAG_BIFFIMPORTONLY    = 0x0800;   /// Only used in BIFF 
binary import filter.
 const sal_uInt16 FUNCFLAG_BIFFEXPORTONLY    = 0x1000;   /// Only used in BIFF 
binary export filter.
+const sal_uInt16 FUNCFLAG_INTERNAL          = 0x2000;   /// Function is 
internal in Calc.
 
 /// Converts a function library index (value of enum FunctionLibraryType) to 
function flags.
 #define FUNCLIB_TO_FUNCFLAGS( funclib_index ) static_cast< sal_uInt16 >( 
static_cast< sal_uInt8 >( funclib_index ) << 12 )
@@ -584,8 +585,8 @@ static const FunctionData saFuncTableBiff4[] =
     { "QUOTIENT",               "QUOTIENT",             417,    NOID,   2,  2, 
 V, { RR }, FUNCFLAG_EXTERNAL },
     { "DELTA",                  "DELTA",                418,    NOID,   1,  2, 
 V, { RR }, FUNCFLAG_EXTERNAL },
     { "GESTEP",                 "GESTEP",               419,    NOID,   1,  2, 
 V, { RR }, FUNCFLAG_EXTERNAL },
-    { "ISEVEN",                 "ISEVEN",               420,    NOID,   1,  1, 
 V, { RR }, FUNCFLAG_EXTERNAL },       // Calc: builtin and add-in
-    { "ISODD",                  "ISODD",                421,    NOID,   1,  1, 
 V, { RR }, FUNCFLAG_EXTERNAL },       // Calc: builtin and add-in
+    { "ISEVEN",                 "ISEVEN",               420,    NOID,   1,  1, 
 V, { RR }, FUNCFLAG_EXTERNAL | FUNCFLAG_INTERNAL }, // Calc: builtin and add-in
+    { "ISODD",                  "ISODD",                421,    NOID,   1,  1, 
 V, { RR }, FUNCFLAG_EXTERNAL | FUNCFLAG_INTERNAL }, // Calc: builtin and add-in
     { "MROUND",                 "MROUND",               422,    NOID,   2,  2, 
 V, { RR }, FUNCFLAG_EXTERNAL },
     { "ERF",                    "ERF",                  423,    NOID,   1,  2, 
 V, { RR }, FUNCFLAG_EXTERNAL },
     { "ERFC",                   "ERFC",                 424,    NOID,   1,  1, 
 V, { RR }, FUNCFLAG_EXTERNAL },
@@ -609,10 +610,10 @@ static const FunctionData saFuncTableBiff4[] =
     { "YIELD",                  "YIELD",                442,    NOID,   6,  7, 
 V, { RR }, FUNCFLAG_EXTERNAL },
     { "DOLLARDE",               "DOLLARDE",             443,    NOID,   2,  2, 
 V, { RR }, FUNCFLAG_EXTERNAL },
     { "DOLLARFR",               "DOLLARFR",             444,    NOID,   2,  2, 
 V, { RR }, FUNCFLAG_EXTERNAL },
-    { "NOMINAL",                "NOMINAL",              445,    NOID,   2,  2, 
 V, { RR }, FUNCFLAG_EXTERNAL },       // Calc: builtin and add-in
-    { "EFFECT",                 "EFFECT",               446,    NOID,   2,  2, 
 V, { RR }, FUNCFLAG_EXTERNAL },       // Calc: builtin and add-in
-    { "CUMPRINC",               "CUMPRINC",             447,    NOID,   6,  6, 
 V, { RR }, FUNCFLAG_EXTERNAL },       // Calc: builtin and add-in
-    { "CUMIPMT",                "CUMIPMT",              448,    NOID,   6,  6, 
 V, { RR }, FUNCFLAG_EXTERNAL },       // Calc: builtin and add-in
+    { "NOMINAL",                "NOMINAL",              445,    NOID,   2,  2, 
 V, { RR }, FUNCFLAG_EXTERNAL | FUNCFLAG_INTERNAL }, // Calc: builtin and add-in
+    { "EFFECT",                 "EFFECT",               446,    NOID,   2,  2, 
 V, { RR }, FUNCFLAG_EXTERNAL | FUNCFLAG_INTERNAL }, // Calc: builtin and add-in
+    { "CUMPRINC",               "CUMPRINC",             447,    NOID,   6,  6, 
 V, { RR }, FUNCFLAG_EXTERNAL | FUNCFLAG_INTERNAL }, // Calc: builtin and add-in
+    { "CUMIPMT",                "CUMIPMT",              448,    NOID,   6,  6, 
 V, { RR }, FUNCFLAG_EXTERNAL | FUNCFLAG_INTERNAL }, // Calc: builtin and add-in
     { "EDATE",                  "EDATE",                449,    NOID,   2,  2, 
 V, { RR }, FUNCFLAG_EXTERNAL },
     { "EOMONTH",                "EOMONTH",              450,    NOID,   2,  2, 
 V, { RR }, FUNCFLAG_EXTERNAL },
     { "YEARFRAC",               "YEARFRAC",             451,    NOID,   2,  3, 
 V, { RR }, FUNCFLAG_EXTERNAL },
@@ -622,7 +623,7 @@ static const FunctionData saFuncTableBiff4[] =
     { "COUPNCD",                "COUPNCD",              455,    NOID,   3,  4, 
 V, { RR }, FUNCFLAG_EXTERNAL },
     { "COUPNUM",                "COUPNUM",              456,    NOID,   3,  4, 
 V, { RR }, FUNCFLAG_EXTERNAL },
     { "COUPPCD",                "COUPPCD",              457,    NOID,   3,  4, 
 V, { RR }, FUNCFLAG_EXTERNAL },
-    { "DURATION",               "DURATION",             458,    NOID,   5,  6, 
 V, { RR }, FUNCFLAG_EXTERNAL },       // Calc: builtin and add-in
+    { "DURATION",               "DURATION",             458,    NOID,   5,  6, 
 V, { RR }, FUNCFLAG_EXTERNAL }, // Calc: builtin and add-in (but different!)
     { "MDURATION",              "MDURATION",            459,    NOID,   5,  6, 
 V, { RR }, FUNCFLAG_EXTERNAL },
     { "ODDLPRICE",              "ODDLPRICE",            460,    NOID,   7,  8, 
 V, { RR }, FUNCFLAG_EXTERNAL },
     { "ODDLYIELD",              "ODDLYIELD",            461,    NOID,   8,  9, 
 V, { RR }, FUNCFLAG_EXTERNAL },
@@ -632,14 +633,14 @@ static const FunctionData saFuncTableBiff4[] =
     { "WEEKNUM",                "WEEKNUM",              465,    NOID,   1,  2, 
 V, { RR }, FUNCFLAG_EXTERNAL },
     { "AMORDEGRC",              "AMORDEGRC",            466,    NOID,   6,  7, 
 V, { RR }, FUNCFLAG_EXTERNAL },
     { "AMORLINC",               "AMORLINC",             467,    NOID,   6,  7, 
 V, { RR }, FUNCFLAG_EXTERNAL },
-    { "CONVERT",                "CONVERT",              468,    NOID,   3,  3, 
 V, { RR }, FUNCFLAG_EXTERNAL },       // Calc: builtin and add-in
+    { "CONVERT",                "CONVERT",              468,    NOID,   3,  3, 
 V, { RR }, FUNCFLAG_EXTERNAL },       // Calc: builtin and add-in (but 
different!)
     { "ACCRINT",                "ACCRINT",              469,    NOID,   6,  7, 
 V, { RR }, FUNCFLAG_EXTERNAL },
     { "ACCRINTM",               "ACCRINTM",             470,    NOID,   4,  5, 
 V, { RR }, FUNCFLAG_EXTERNAL },
     { "WORKDAY",                "WORKDAY",              471,    NOID,   2,  3, 
 V, { RR, RR, RX, C }, FUNCFLAG_EXTERNAL },
     { "NETWORKDAYS",            "NETWORKDAYS",          472,    NOID,   2,  3, 
 V, { RR, RR, RX, C }, FUNCFLAG_EXTERNAL },
-    { "GCD",                    "GCD",                  473,    NOID,   1,  
MX, V, { RX }, FUNCFLAG_EXTERNAL },       // Calc: builtin and add-in
+    { "GCD",                    "GCD",                  473,    NOID,   1,  
MX, V, { RX }, FUNCFLAG_EXTERNAL | FUNCFLAG_INTERNAL }, // Calc: builtin and 
add-in
     { "MULTINOMIAL",            "MULTINOMIAL",          474,    NOID,   1,  
MX, V, { RX }, FUNCFLAG_EXTERNAL },
-    { "LCM",                    "LCM",                  475,    NOID,   1,  
MX, V, { RX }, FUNCFLAG_EXTERNAL },       // Calc: builtin and add-in
+    { "LCM",                    "LCM",                  475,    NOID,   1,  
MX, V, { RX }, FUNCFLAG_EXTERNAL | FUNCFLAG_INTERNAL }, // Calc: builtin and 
add-in
     { "FVSCHEDULE",             "FVSCHEDULE",           476,    NOID,   2,  2, 
 V, { RR, RX }, FUNCFLAG_EXTERNAL },
 
     // *** macro sheet commands ***
@@ -999,6 +1000,7 @@ void FunctionProviderImpl::initFunc( const FunctionData& 
rFuncData, sal_uInt8 nM
     xFuncInfo->mbParamPairs = getFlag( rFuncData.mnFlags, FUNCFLAG_PARAMPAIRS 
);
     xFuncInfo->mbVolatile = getFlag( rFuncData.mnFlags, FUNCFLAG_VOLATILE );
     xFuncInfo->mbExternal = getFlag( rFuncData.mnFlags, FUNCFLAG_EXTERNAL );
+    xFuncInfo->mbInternal = !xFuncInfo->mbExternal || getFlag( 
rFuncData.mnFlags, FUNCFLAG_INTERNAL );
     bool bMacroCmd = getFlag( rFuncData.mnFlags, FUNCFLAG_MACROCMD );
     xFuncInfo->mbMacroFunc = bMacroCmd || getFlag( rFuncData.mnFlags, 
FUNCFLAG_MACROFUNC );
     xFuncInfo->mbVarParam = bMacroCmd || (rFuncData.mnMinParamCount != 
rFuncData.mnMaxParamCount) || getFlag( rFuncData.mnFlags, FUNCFLAG_ALWAYSVAR );
@@ -1349,7 +1351,10 @@ bool OpCodeProviderImpl::initFuncOpCodes( const 
ApiTokenMap& rIntFuncTokenMap, c
     {
         FunctionInfoRef xFuncInfo = *aIt;
         // set API opcode from ODF function name
-        bIsValid &= initFuncOpCode( *xFuncInfo, xFuncInfo->mbExternal ? 
rExtFuncTokenMap : rIntFuncTokenMap );
+        if (xFuncInfo->mbExternal)
+            bIsValid &= initFuncOpCode( *xFuncInfo, rExtFuncTokenMap );
+        if (xFuncInfo->mbInternal)
+            bIsValid &= initFuncOpCode( *xFuncInfo, rIntFuncTokenMap );
         // insert the function info into the maps
         if( (xFuncInfo->mnApiOpCode != OPCODE_NONAME) && 
(xFuncInfo->mnApiOpCode != OPCODE_BAD) )
         {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to