summaryrefslogtreecommitdiff
path: root/sc/source/filter
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/filter')
-rw-r--r--sc/source/filter/excel/excimp8.cxx64
-rw-r--r--sc/source/filter/excel/excrecds.cxx23
-rw-r--r--sc/source/filter/excel/xeformula.cxx8
-rw-r--r--sc/source/filter/excel/xename.cxx85
-rw-r--r--sc/source/filter/excel/xepivot.cxx2
-rw-r--r--sc/source/filter/excel/xiname.cxx2
-rw-r--r--sc/source/filter/excel/xipivot.cxx8
-rw-r--r--sc/source/filter/excel/xltools.cxx7
-rw-r--r--sc/source/filter/inc/excimp8.hxx15
-rw-r--r--sc/source/filter/inc/xltools.hxx5
-rw-r--r--sc/source/filter/xml/XMLExportDataPilot.cxx12
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx2
12 files changed, 71 insertions, 162 deletions
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index 43f1da0844c1..a1bbe57dbc0c 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -82,6 +82,7 @@
#include "attrib.hxx"
#include "conditio.hxx"
#include "dbcolect.hxx"
+#include "globalnames.hxx"
#include "editutil.hxx"
#include "markdata.hxx"
#include "rangenam.hxx"
@@ -468,8 +469,6 @@ void ImportExcel8::FilterMode( void )
// then the latter is true..
if( !pExcRoot->pAutoFilterBuffer ) return;
- pExcRoot->pAutoFilterBuffer->IncrementActiveAF();
-
XclImpAutoFilterData* pData = pExcRoot->pAutoFilterBuffer->GetByTab( GetCurrScTab() );
if( pData )
pData->SetAutoOrAdvanced();
@@ -498,15 +497,14 @@ void ImportExcel8::AutoFilter( void )
-XclImpAutoFilterData::XclImpAutoFilterData( RootData* pRoot, const ScRange& rRange, const String& rName ) :
+XclImpAutoFilterData::XclImpAutoFilterData( RootData* pRoot, const ScRange& rRange ) :
ExcRoot( pRoot ),
pCurrDBData(NULL),
nFirstEmpty( 0 ),
bActive( false ),
bHasConflict( false ),
bCriteria( false ),
- bAutoOrAdvanced(false),
- aFilterName(rName)
+ bAutoOrAdvanced(false)
{
aParam.nCol1 = rRange.aStart.Col();
aParam.nRow1 = rRange.aStart.Row();
@@ -750,9 +748,9 @@ void XclImpAutoFilterData::SetExtractPos( const ScAddress& rAddr )
aParam.bDestPers = sal_True;
}
-void XclImpAutoFilterData::Apply( const sal_Bool bUseUnNamed )
+void XclImpAutoFilterData::Apply()
{
- CreateScDBData(bUseUnNamed);
+ CreateScDBData();
if( bActive )
{
@@ -774,35 +772,27 @@ void XclImpAutoFilterData::Apply( const sal_Bool bUseUnNamed )
}
}
-void XclImpAutoFilterData::CreateScDBData( const sal_Bool bUseUnNamed )
+void XclImpAutoFilterData::CreateScDBData()
{
// Create the ScDBData() object if the AutoFilter is activated
// or if we need to create the Advanced Filter.
if( bActive || bCriteria)
{
- ScDBCollection& rColl = pExcRoot->pIR->GetDatabaseRanges();
- pCurrDBData = rColl.GetDBAtArea( Tab(), StartCol(), StartRow(), EndCol(), EndRow() );
- if( !pCurrDBData )
+ ScDocument* pDoc = pExcRoot->pIR->GetDocPtr();
+ String aNewName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME));
+ pCurrDBData = new ScDBData(aNewName , Tab(),
+ StartCol(),StartRow(), EndCol(),EndRow() );
+ if(bCriteria)
{
- AmendAFName(bUseUnNamed);
-
- pCurrDBData = new ScDBData( aFilterName, Tab(), StartCol(), StartRow(), EndCol(), EndRow() );
-
- if( pCurrDBData )
- {
- if(bCriteria)
- {
- EnableRemoveFilter();
+ EnableRemoveFilter();
- pCurrDBData->SetQueryParam( aParam );
- pCurrDBData->SetAdvancedQuerySource(&aCriteriaRange);
- }
- else
- pCurrDBData->SetAdvancedQuerySource(NULL);
- rColl.Insert( pCurrDBData );
- }
+ pCurrDBData->SetQueryParam( aParam );
+ pCurrDBData->SetAdvancedQuerySource(&aCriteriaRange);
}
+ else
+ pCurrDBData->SetAdvancedQuerySource(NULL);
+ pDoc->SetAnonymousDBData(Tab(), pCurrDBData);
}
}
@@ -822,18 +812,7 @@ void XclImpAutoFilterData::EnableRemoveFilter()
// inside the advanced range
}
-void XclImpAutoFilterData::AmendAFName(const sal_Bool bUseUnNamed)
-{
- // If-and-only-if we have one AF filter then
- // use the Calc "unnamed" range name. Calc
- // only supports one in total while Excel
- // supports one per sheet.
- if( bUseUnNamed && bAutoOrAdvanced )
- aFilterName = ScGlobal::GetRscString(STR_DB_NONAME);
-}
-
-XclImpAutoFilterBuffer::XclImpAutoFilterBuffer() :
- nAFActiveCount( 0 )
+XclImpAutoFilterBuffer::XclImpAutoFilterBuffer()
{
}
@@ -843,11 +822,10 @@ XclImpAutoFilterBuffer::~XclImpAutoFilterBuffer()
delete pData;
}
-void XclImpAutoFilterBuffer::Insert( RootData* pRoot, const ScRange& rRange,
- const String& rName )
+void XclImpAutoFilterBuffer::Insert( RootData* pRoot, const ScRange& rRange)
{
if( !GetByTab( rRange.aStart.Tab() ) )
- Append( new XclImpAutoFilterData( pRoot, rRange, rName ) );
+ Append( new XclImpAutoFilterData( pRoot, rRange) );
}
void XclImpAutoFilterBuffer::AddAdvancedRange( const ScRange& rRange )
@@ -867,7 +845,7 @@ void XclImpAutoFilterBuffer::AddExtractPos( const ScRange& rRange )
void XclImpAutoFilterBuffer::Apply()
{
for( XclImpAutoFilterData* pData = _First(); pData; pData = _Next() )
- pData->Apply(UseUnNamed());
+ pData->Apply();
}
XclImpAutoFilterData* XclImpAutoFilterBuffer::GetByTab( SCTAB nTab )
diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx
index ec4c425c1621..d3671b4d1cbe 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -856,31 +856,18 @@ ExcAutoFilterRecs::ExcAutoFilterRecs( const XclExpRoot& rRoot, SCTAB nTab ) :
pFilterInfo( NULL )
, mbAutoFilter (false)
{
- ScDBCollection& rDBColl = GetDatabaseRanges();
XclExpNameManager& rNameMgr = GetNameManager();
- // search for first DB-range with filter
- sal_uInt16 nIndex = 0;
sal_Bool bFound = false;
sal_Bool bAdvanced = false;
- ScDBData* pData = NULL;
+ ScDBData* pData = rRoot.GetDoc().GetAnonymousDBData(nTab);
ScRange aAdvRange;
- while( (nIndex < rDBColl.GetCount()) && !bFound )
+ if (pData)
{
- pData = rDBColl[ nIndex ];
- if( pData )
- {
- ScRange aRange;
- pData->GetArea( aRange );
- bAdvanced = pData->GetAdvancedQuerySource( aAdvRange );
- bFound = (aRange.aStart.Tab() == nTab) &&
- (pData->HasQueryParam() || pData->HasAutoFilter() || bAdvanced);
- }
- if( !bFound )
- nIndex++;
+ bAdvanced = pData->GetAdvancedQuerySource( aAdvRange );
+ bFound = (pData->HasQueryParam() || pData->HasAutoFilter() || bAdvanced);
}
-
- if( pData && bFound )
+ if( bFound )
{
ScQueryParam aParam;
pData->GetQueryParam( aParam );
diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx
index 7acec465c4ac..dab35e4ba7b8 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -418,7 +418,6 @@ private:
void ProcessExternalRangeRef( const XclExpScToken& rTokData );
void ProcessDefinedName( const XclExpScToken& rTokData );
void ProcessExternalName( const XclExpScToken& rTokData );
- void ProcessDatabaseArea( const XclExpScToken& rTokData );
// token vector -----------------------------------------------------------
@@ -1184,7 +1183,6 @@ XclExpScToken XclExpFmlaCompImpl::Factor( XclExpScToken aTokData )
case ocBad: ProcessBad( aTokData ); break;
case ocOpen: ProcessParentheses( aTokData ); break;
case ocName: ProcessDefinedName( aTokData ); break;
- case ocDBArea: ProcessDatabaseArea( aTokData ); break;
case ocFalse:
case ocTrue: ProcessBoolean( aTokData ); break;
case ocDde: ProcessDdeLink( aTokData ); break;
@@ -2138,12 +2136,6 @@ void XclExpFmlaCompImpl::ProcessExternalName( const XclExpScToken& rTokData )
AppendErrorToken( EXC_ERR_NAME, rTokData.mnSpaces );
}
-void XclExpFmlaCompImpl::ProcessDatabaseArea( const XclExpScToken& rTokData )
-{
- sal_uInt16 nNameIdx = GetNameManager().InsertDBRange( rTokData.mpScToken->GetIndex() );
- AppendNameToken( nNameIdx, rTokData.mnSpaces );
-}
-
// token vector ---------------------------------------------------------------
void XclExpFmlaCompImpl::PushOperandPos( sal_uInt16 nTokPos )
diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx
index 846e6229aa10..69377c5d06f4 100644
--- a/sc/source/filter/excel/xename.cxx
+++ b/sc/source/filter/excel/xename.cxx
@@ -38,6 +38,7 @@
#include "dbcolect.hxx"
#include "xehelper.hxx"
#include "xelink.hxx"
+#include "globalnames.hxx"
// for filter manager
#include "excrecds.hxx"
@@ -138,11 +139,10 @@ public:
/** Inserts the Calc name with the passed index and returns the Excel NAME index. */
sal_uInt16 InsertName( SCTAB nTab, sal_uInt16 nScNameIdx );
- /** Inserts the Calc database range with the passed index and returns the Excel NAME index. */
- sal_uInt16 InsertDBRange( sal_uInt16 nScDBRangeIdx );
/** Inserts a new built-in defined name. */
sal_uInt16 InsertBuiltInName( sal_Unicode cBuiltIn, XclTokenArrayRef xTokArr, SCTAB nScTab );
+ sal_uInt16 InsertBuiltInName( sal_Unicode cBuiltIn, XclTokenArrayRef xTokArr, const ScRange& aRange );
/** Inserts a new defined name. Sets another unused name, if rName already exists. */
sal_uInt16 InsertUniqueName( const String& rName, XclTokenArrayRef xTokArr, SCTAB nScTab );
/** Returns index of an existing name, or creates a name without definition. */
@@ -179,10 +179,6 @@ private:
*/
sal_uInt16 FindNamedExpIndex( SCTAB nTab, sal_uInt16 nScIdx );
- /**
- * Find the index of a NAME record from Calc's database range index.
- */
- sal_uInt16 FindDBNameIdx( sal_uInt16 nScIdx ) const;
/** Returns the index of an existing built-in NAME record with the passed definition, otherwise 0. */
sal_uInt16 FindBuiltInNameIdx( const String& rName,
const XclTokenArray& rTokArr, bool bDBRange ) const;
@@ -203,8 +199,6 @@ private:
void CreateBuiltInNames();
/** Creates NAME records for all user-defined names in the document. */
void CreateUserNames();
- /** Creates NAME records for all database ranges in the document. */
- void CreateDatabaseNames();
private:
/**
@@ -214,8 +208,6 @@ private:
*/
NamedExpIndexMap maNamedExpMap;
XclExpNameList maNameList; /// List of NAME records.
- XclExpIndexMap maDBRangeMap; /// Maps Calc database ranges to Excel NAME records.
- String maUnnamedDBName; /// Name of the hidden unnamed database range.
size_t mnFirstUserIdx; /// List index of first user-defined NAME record.
};
@@ -254,9 +246,11 @@ XclExpName::XclExpName( const XclExpRoot& rRoot, sal_Unicode cBuiltIn ) :
{
String aName( XclTools::GetXclBuiltInDefName( EXC_BUILTIN_FILTERDATABASE ) );
mxName = XclExpStringHelper::CreateString( rRoot, aName, EXC_STR_8BITLENGTH );
+ maOrigName = XclTools::GetXclBuiltInDefName( cBuiltIn );
}
else
{
+ maOrigName = XclTools::GetBuiltInDefNameXml( cBuiltIn ) ;
mxName = XclExpStringHelper::CreateString( rRoot, cBuiltIn, EXC_STR_8BITLENGTH );
::set_flag( mnFlags, EXC_NAME_BUILTIN );
}
@@ -336,10 +330,6 @@ void XclExpName::Save( XclExpStream& rStrm )
void XclExpName::SaveXml( XclExpXmlStream& rStrm )
{
- // For some reason, AutoFilter creates exportable names where maOrigName==""
- if( maOrigName.Len() == 0 )
- return;
-
sax_fastparser::FSHelperPtr& rWorkbook = rStrm.GetCurrentStream();
rWorkbook->startElement( XML_definedName,
// OOXTODO: XML_comment, "",
@@ -383,7 +373,6 @@ void XclExpName::WriteBody( XclExpStream& rStrm )
XclExpNameManagerImpl::XclExpNameManagerImpl( const XclExpRoot& rRoot ) :
XclExpRoot( rRoot ),
- maUnnamedDBName( ScGlobal::GetRscString( STR_DB_NONAME ) ),
mnFirstUserIdx( 0 )
{
}
@@ -393,7 +382,6 @@ void XclExpNameManagerImpl::Initialize()
CreateBuiltInNames();
mnFirstUserIdx = maNameList.GetSize();
CreateUserNames();
- CreateDatabaseNames();
}
sal_uInt16 XclExpNameManagerImpl::InsertName( SCTAB nTab, sal_uInt16 nScNameIdx )
@@ -413,13 +401,15 @@ sal_uInt16 XclExpNameManagerImpl::InsertName( SCTAB nTab, sal_uInt16 nScNameIdx
return nNameIdx;
}
-sal_uInt16 XclExpNameManagerImpl::InsertDBRange( sal_uInt16 nScDBRangeIdx )
+sal_uInt16 XclExpNameManagerImpl::InsertBuiltInName( sal_Unicode cBuiltIn, XclTokenArrayRef xTokArr, const ScRange& aRange )
{
- sal_uInt16 nNameIdx = FindDBNameIdx( nScDBRangeIdx );
- if( nNameIdx == 0 )
- if( const ScDBData* pDBData = GetDatabaseRanges().FindIndex( nScDBRangeIdx ) )
- nNameIdx = CreateName( *pDBData );
- return nNameIdx;
+ XclExpNameRef xName( new XclExpName( GetRoot(), cBuiltIn ) );
+ xName->SetTokenArray( xTokArr );
+ xName->SetLocalTab( aRange.aStart.Tab() );
+ String sSymbol;
+ aRange.Format( sSymbol, SCR_ABS_3D, GetDocPtr(), ScAddress::Details( ::formula::FormulaGrammar::CONV_XL_A1 ) );
+ xName->SetSymbol( sSymbol );
+ return Append( xName );
}
sal_uInt16 XclExpNameManagerImpl::InsertBuiltInName( sal_Unicode cBuiltIn, XclTokenArrayRef xTokArr, SCTAB nScTab )
@@ -515,18 +505,12 @@ sal_uInt16 XclExpNameManagerImpl::FindNamedExpIndex( SCTAB nTab, sal_uInt16 nScI
return (itr == maNamedExpMap.end()) ? 0 : itr->second;
}
-sal_uInt16 XclExpNameManagerImpl::FindDBNameIdx( sal_uInt16 nScIdx ) const
-{
- XclExpIndexMap::const_iterator aIt = maDBRangeMap.find( nScIdx );
- return (aIt == maDBRangeMap.end()) ? 0 : aIt->second;
-}
-
sal_uInt16 XclExpNameManagerImpl::FindBuiltInNameIdx(
const String& rName, const XclTokenArray& rTokArr, bool bDBRange ) const
{
/* Get built-in index from the name. Special case: the database range
'unnamed' will be mapped to Excel's built-in '_FilterDatabase' name. */
- sal_Unicode cBuiltIn = (bDBRange && (rName == maUnnamedDBName)) ?
+ sal_Unicode cBuiltIn = (bDBRange && (rName == String(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME)))) ?
EXC_BUILTIN_FILTERDATABASE : XclTools::GetBuiltInDefNameIndex( rName );
if( cBuiltIn < EXC_BUILTIN_UNKNOWN )
@@ -622,29 +606,6 @@ sal_uInt16 XclExpNameManagerImpl::CreateName( SCTAB nTab, const ScRangeData& rRa
return nNameIdx;
}
-sal_uInt16 XclExpNameManagerImpl::CreateName( const ScDBData& rDBData )
-{
- // get name and source range, and create the definition formula
- const String& rName = rDBData.GetName();
- ScRange aRange;
- rDBData.GetArea( aRange );
- XclTokenArrayRef xTokArr = GetFormulaCompiler().CreateFormula( EXC_FMLATYPE_NAME, aRange );
-
- // try to use an existing built-in name
- sal_uInt16 nNameIdx = FindBuiltInNameIdx( rName, *xTokArr, true );
- if( nNameIdx == 0 )
- {
- // insert a new name into the list
- XclExpNameRef xName( new XclExpName( GetRoot(), GetUnusedName( rName ) ) );
- xName->SetTokenArray( xTokArr );
- nNameIdx = Append( xName );
- }
-
- // store the index of the NAME record in the lookup map
- maDBRangeMap[ rDBData.GetIndex() ] = nNameIdx;
- return nNameIdx;
-}
-
void XclExpNameManagerImpl::CreateBuiltInNames()
{
ScDocument& rDoc = GetDoc();
@@ -718,19 +679,6 @@ void XclExpNameManagerImpl::CreateUserNames()
}
}
-void XclExpNameManagerImpl::CreateDatabaseNames()
-{
- const ScDBCollection& rDBRanges = GetDatabaseRanges();
- for( sal_uInt16 nDBIdx = 0, nDBCount = rDBRanges.GetCount(); nDBIdx < nDBCount; ++nDBIdx )
- {
- const ScDBData* pDBData = rDBRanges[ nDBIdx ];
- DBG_ASSERT( pDBData, "XclExpNameManagerImpl::CreateDatabaseNames - missing database range" );
- // skip hidden "unnamed" range
- if( pDBData && (pDBData->GetName() != maUnnamedDBName) && !FindDBNameIdx( pDBData->GetIndex() ) )
- CreateName( *pDBData );
- }
-}
-
// ----------------------------------------------------------------------------
XclExpNameManager::XclExpNameManager( const XclExpRoot& rRoot ) :
@@ -753,15 +701,10 @@ sal_uInt16 XclExpNameManager::InsertName( SCTAB nTab, sal_uInt16 nScNameIdx )
return mxImpl->InsertName( nTab, nScNameIdx );
}
-sal_uInt16 XclExpNameManager::InsertDBRange( sal_uInt16 nScDBRangeIdx )
-{
- return mxImpl->InsertDBRange( nScDBRangeIdx );
-}
-
sal_uInt16 XclExpNameManager::InsertBuiltInName( sal_Unicode cBuiltIn, const ScRange& rRange )
{
XclTokenArrayRef xTokArr = GetFormulaCompiler().CreateFormula( EXC_FMLATYPE_NAME, rRange );
- return mxImpl->InsertBuiltInName( cBuiltIn, xTokArr, rRange.aStart.Tab() );
+ return mxImpl->InsertBuiltInName( cBuiltIn, xTokArr, rRange );
}
sal_uInt16 XclExpNameManager::InsertBuiltInName( sal_Unicode cBuiltIn, const ScRangeList& rRangeList )
diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx
index 8139a25b8b08..be8557eac430 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -538,7 +538,7 @@ void XclExpPCField::InsertNumDateGroupItems( const ScDPObject& rDPObj, const ScD
if( const ScSheetSourceDesc* pSrcDesc = rDPObj.GetSheetDesc() )
{
// get the string collection with original source elements
- ScDPCache* pCache = pSrcDesc->CreateCache();
+ const ScDPCache* pCache = pSrcDesc->CreateCache();
if (!pCache)
return;
diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx
index eeba8e356f9b..15bf618d8530 100644
--- a/sc/source/filter/excel/xiname.cxx
+++ b/sc/source/filter/excel/xiname.cxx
@@ -186,7 +186,7 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) :
switch( mcBuiltIn )
{
case EXC_BUILTIN_FILTERDATABASE:
- GetFilterManager().Insert( &GetOldRoot(), aRange, maScName );
+ GetFilterManager().Insert( &GetOldRoot(), aRange);
break;
case EXC_BUILTIN_CRITERIA:
GetFilterManager().AddAdvancedRange( aRange );
diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx
index 0bb694d2b29e..a26b132f198d 100644
--- a/sc/source/filter/excel/xipivot.cxx
+++ b/sc/source/filter/excel/xipivot.cxx
@@ -1010,8 +1010,12 @@ void XclImpPTField::ConvertPageField( ScDPSaveData& rSaveData ) const
DBG_ASSERT( maFieldInfo.mnAxes & EXC_SXVD_AXIS_PAGE, "XclImpPTField::ConvertPageField - no page field" );
if( ScDPSaveDimension* pSaveDim = ConvertRCPField( rSaveData ) )
{
- const rtl::OUString aName = *GetItemName( maPageInfo.mnSelItem );
- pSaveDim->SetCurrentPage( &aName );
+ const String* pName = GetItemName( maPageInfo.mnSelItem );
+ if (pName)
+ {
+ const OUString aName(*pName);
+ pSaveDim->SetCurrentPage(&aName);
+ }
}
}
diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx
index 062413de46f8..aba8b38fc340 100644
--- a/sc/source/filter/excel/xltools.cxx
+++ b/sc/source/filter/excel/xltools.cxx
@@ -469,6 +469,8 @@ String XclTools::GetXclFontName( const String& rFontName )
const String XclTools::maDefNamePrefix( RTL_CONSTASCII_USTRINGPARAM( "Excel_BuiltIn_" ) );
+const String XclTools::maDefNamePrefixXml ( RTL_CONSTASCII_USTRINGPARAM( "_xlnm." ) );
+
static const sal_Char* const ppcDefNames[] =
{
"Consolidate_Area",
@@ -504,6 +506,11 @@ String XclTools::GetBuiltInDefName( sal_Unicode cBuiltIn )
return String( maDefNamePrefix ).Append( GetXclBuiltInDefName( cBuiltIn ) );
}
+String XclTools::GetBuiltInDefNameXml( sal_Unicode cBuiltIn )
+{
+ return String( maDefNamePrefixXml ).Append( GetXclBuiltInDefName( cBuiltIn ) );
+}
+
sal_Unicode XclTools::GetBuiltInDefNameIndex( const String& rDefName )
{
xub_StrLen nPrefixLen = maDefNamePrefix.Len();
diff --git a/sc/source/filter/inc/excimp8.hxx b/sc/source/filter/inc/excimp8.hxx
index 65adb65b16e6..923bec596d88 100644
--- a/sc/source/filter/inc/excimp8.hxx
+++ b/sc/source/filter/inc/excimp8.hxx
@@ -103,7 +103,6 @@ private:
sal_Bool bCriteria;
sal_Bool bAutoOrAdvanced;
ScRange aCriteriaRange;
- String aFilterName;
void CreateFromDouble( String& rStr, double fVal );
void SetCellAttribs();
@@ -114,8 +113,7 @@ protected:
public:
XclImpAutoFilterData(
RootData* pRoot,
- const ScRange& rRange,
- const String& rName );
+ const ScRange& rRange);
inline bool IsActive() const { return bActive; }
inline bool IsFiltered() const { return bAutoOrAdvanced; }
@@ -131,8 +129,8 @@ public:
void SetAdvancedRange( const ScRange* pRange );
void SetExtractPos( const ScAddress& rAddr );
inline void SetAutoOrAdvanced() { bAutoOrAdvanced = sal_True; }
- void Apply( const sal_Bool bUseUnNamed = false );
- void CreateScDBData( const sal_Bool bUseUnNamed );
+ void Apply();
+ void CreateScDBData();
void EnableRemoveFilter();
};
@@ -142,8 +140,6 @@ class XclImpAutoFilterBuffer : private List
private:
using List::Insert;
- sal_uInt16 nAFActiveCount;
-
inline XclImpAutoFilterData* _First() { return (XclImpAutoFilterData*) List::First(); }
inline XclImpAutoFilterData* _Next() { return (XclImpAutoFilterData*) List::Next(); }
@@ -154,15 +150,12 @@ public:
XclImpAutoFilterBuffer();
virtual ~XclImpAutoFilterBuffer();
- void Insert( RootData* pRoot, const ScRange& rRange,
- const String& rName );
+ void Insert( RootData* pRoot, const ScRange& rRange);
void AddAdvancedRange( const ScRange& rRange );
void AddExtractPos( const ScRange& rRange );
void Apply();
XclImpAutoFilterData* GetByTab( SCTAB nTab );
- inline void IncrementActiveAF() { nAFActiveCount++; }
- inline sal_Bool UseUnNamed() { return nAFActiveCount == 1; }
};
#endif
diff --git a/sc/source/filter/inc/xltools.hxx b/sc/source/filter/inc/xltools.hxx
index bfe284f198da..e9e306e2f1c6 100644
--- a/sc/source/filter/inc/xltools.hxx
+++ b/sc/source/filter/inc/xltools.hxx
@@ -187,6 +187,10 @@ public:
@descr Adds a prefix to the representation returned by GetXclBuiltInDefName().
@param cBuiltIn Excel index of the built-in name. */
static String GetBuiltInDefName( sal_Unicode cBuiltIn );
+ /** Returns the Excel built-in name with OOXML prefix
+ @descr Adds the "_xlnm." prefix to the representation returned by GetXclBuiltInDefName()
+ @param cBuiltIn Excel index of the built in name.*/
+ static String GetBuiltInDefNameXml( sal_Unicode cBuiltIn );
/** Returns the Excel built-in name index of the passed defined name from Calc.
@descr Ignores any characters following a valid representation of a built-in name.
@param pcBuiltIn (out-param) If not 0, the index of the built-in name will be returned here.
@@ -245,6 +249,7 @@ public:
// ------------------------------------------------------------------------
private:
static const String maDefNamePrefix; /// Prefix for built-in defined names.
+ static const String maDefNamePrefixXml; /// Prefix for built-in defined names for OOX
static const String maStyleNamePrefix1; /// Prefix for built-in cell style names.
static const String maStyleNamePrefix2; /// Prefix for built-in cell style names from OOX filter.
static const String maCFStyleNamePrefix1; /// Prefix for cond. formatting style names.
diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx
index 968c37f0e1b5..d0071a9428b2 100644
--- a/sc/source/filter/xml/XMLExportDataPilot.cxx
+++ b/sc/source/filter/xml/XMLExportDataPilot.cxx
@@ -858,24 +858,24 @@ void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference <sheet::XSpreads
case sheet::DataImportMode_NONE : break;
case sheet::DataImportMode_QUERY :
{
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DATABASE_NAME, rtl::OUString(pImpSource->aDBName));
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_QUERY_NAME, rtl::OUString(pImpSource->aObject));
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DATABASE_NAME, pImpSource->aDBName);
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_QUERY_NAME, pImpSource->aObject);
SvXMLElementExport aElemID(rExport, XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_QUERY, sal_True, sal_True);
rExport.CheckAttrList();
}
break;
case sheet::DataImportMode_TABLE :
{
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DATABASE_NAME, rtl::OUString(pImpSource->aDBName));
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE_NAME, rtl::OUString(pImpSource->aObject));
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DATABASE_NAME, pImpSource->aDBName);
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE_NAME, pImpSource->aObject);
SvXMLElementExport aElemID(rExport, XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_TABLE, sal_True, sal_True);
rExport.CheckAttrList();
}
break;
case sheet::DataImportMode_SQL :
{
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DATABASE_NAME, rtl::OUString(pImpSource->aDBName));
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SQL_STATEMENT, rtl::OUString(pImpSource->aObject));
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DATABASE_NAME, pImpSource->aDBName);
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SQL_STATEMENT, pImpSource->aObject);
if (!pImpSource->bNative)
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_PARSE_SQL_STATEMENT, XML_TRUE);
SvXMLElementExport aElemID(rExport, XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_SQL, sal_True, sal_True);
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 06214774a91e..a7755b840bca 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -1089,7 +1089,7 @@ void ScXMLTableRowCellContext::EndElement()
pCellObj->SetFormulaWithGrammar( pOUFormula->first, pOUFormula->second, eGrammar);
if (bFormulaTextResult && pOUTextValue && pOUTextValue->getLength())
pCellObj->SetFormulaResultString( *pOUTextValue);
- else if (fValue != 0.0)
+ else
pCellObj->SetFormulaResultDouble( fValue);
}
}