summaryrefslogtreecommitdiff
path: root/sc/source/filter
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/filter')
-rw-r--r--sc/source/filter/excel/excdoc.cxx8
-rw-r--r--sc/source/filter/excel/excimp8.cxx29
-rw-r--r--sc/source/filter/excel/xiescher.cxx6
-rw-r--r--sc/source/filter/excel/xiname.cxx6
-rw-r--r--sc/source/filter/excel/xiroot.cxx2
-rw-r--r--sc/source/filter/excel/xlescher.cxx2
-rw-r--r--sc/source/filter/inc/excdoc.hxx6
-rw-r--r--sc/source/filter/inc/excimp8.hxx1
-rw-r--r--sc/source/filter/xml/XMLStylesExportHelper.cxx27
-rw-r--r--sc/source/filter/xml/XMLStylesExportHelper.hxx1
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx9
-rw-r--r--sc/source/filter/xml/xmlstyle.cxx18
-rw-r--r--sc/source/filter/xml/xmlstyle.hxx2
-rw-r--r--sc/source/filter/xml/xmlstyli.cxx19
14 files changed, 76 insertions, 60 deletions
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index 2cf2d8f580c0..458629979172 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -420,7 +420,7 @@ void ExcTable::FillAsHeader( ExcBoundsheetList& rBoundsheetList )
}
-void ExcTable::FillAsTable( size_t nCodeNameIdx )
+void ExcTable::FillAsTable( SCTAB nCodeNameIdx )
{
InitializeTable( mnScTab );
@@ -550,7 +550,7 @@ void ExcTable::FillAsTable( size_t nCodeNameIdx )
Add( new ExcEof );
}
-void ExcTable::FillAsXmlTable( size_t nCodeNameIdx )
+void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx )
{
RootData& rR = GetOldRoot();
@@ -640,7 +640,7 @@ void ExcTable::FillAsXmlTable( size_t nCodeNameIdx )
}
-void ExcTable::FillAsEmptyTable( size_t nCodeNameIdx )
+void ExcTable::FillAsEmptyTable( SCTAB nCodeNameIdx )
{
InitializeTable( mnScTab );
@@ -723,7 +723,7 @@ void ExcDocument::ReadDoc( void )
aHeader.FillAsHeader( maBoundsheetList );
SCTAB nScTab = 0, nScTabCount = GetTabInfo().GetScTabCount();
- size_t nCodeNameIdx = 0, nCodeNameCount = GetExtDocOptions().GetCodeNameCount();
+ SCTAB nCodeNameIdx = 0, nCodeNameCount = GetExtDocOptions().GetCodeNameCount();
for( ; nScTab < nScTabCount; ++nScTab )
{
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index 9608804da9f9..d75a0e669603 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -56,7 +56,6 @@
#include <svx/xflclit.hxx>
#include <filter/msfilter/svxmsbas.hxx>
#include <basic/basmgr.hxx>
-#include <oox/xls/excelvbaproject.hxx>
#include <vcl/graph.hxx>
#include <vcl/bmpacc.hxx>
@@ -243,17 +242,6 @@ void ImportExcel8::ReadBasic( void )
{
SvxImportMSVBasic aBasicImport( *pShell, *xRootStrg, bLoadCode, bLoadStrg );
bool bAsComment = !bLoadExecutable;
- if ( !bAsComment )
- {
- uno::Any aGlobs;
- uno::Sequence< uno::Any > aArgs(1);
- aArgs[ 0 ] <<= pShell->GetModel();
- aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.Globals" ) ), aArgs );
- pShell->GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs );
- BasicManager* pAppMgr = SFX_APP()->GetBasicManager();
- if ( pAppMgr )
- pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aArgs[ 0 ] );
- }
aBasicImport.Import( EXC_STORAGE_VBA_PROJECT, EXC_STORAGE_VBA, bAsComment );
}
}
@@ -292,8 +280,6 @@ void ImportExcel8::PostDocLoad( void )
// read doc info (no docshell while pasting from clipboard)
LoadDocumentProperties();
- // attach document events to VBA macros
- AttachDocumentEvents();
// #i45843# Pivot tables are now handled outside of PostDocLoad, so they are available
// when formula cells are calculated, for the GETPIVOTDATA function.
@@ -318,21 +304,6 @@ void ImportExcel8::LoadDocumentProperties()
}
}
-void ImportExcel8::AttachDocumentEvents()
-{
- SfxObjectShell* pShell = GetDocShell();
- if( HasBasic() && pShell )
- {
- uno::Reference< lang::XMultiServiceFactory > xGlobalFactory = ::comphelper::getProcessServiceFactory();
- uno::Reference< sheet::XSpreadsheetDocument > xDocument( pShell->GetModel(), uno::UNO_QUERY );
- if( xGlobalFactory.is() && xDocument.is() )
- {
- ::oox::xls::VbaProject aVbaProject( xGlobalFactory, xDocument );
- aVbaProject.attachToEvents();
- }
- }
-}
-
//___________________________________________________________________
// autofilter
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index dc87bba4c050..8d09cae60941 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -98,7 +98,6 @@
#include "convuno.hxx"
#include "postit.hxx"
#include "globstr.hrc"
-#include "chartlis.hxx"
#include "fprogressbar.hxx"
#include "xltracer.hxx"
@@ -4056,9 +4055,8 @@ void XclImpObjectManager::ConvertObjects()
for( XclImpSheetDrawingMap::iterator aIt = maSheetDrawings.begin(), aEnd = maSheetDrawings.end(); aIt != aEnd; ++aIt )
aIt->second->ConvertObjects( aDffConv );
- ScChartListenerCollection* pChartListeners = GetDoc().GetChartListenerCollection();
- if( pChartListeners && (pChartListeners->GetCount() > 0) )
- pChartListeners->SetDirty();
+ // #i112436# don't call ScChartListenerCollection::SetDirty here,
+ // instead use InterpretDirtyCells in ScDocument::CalcAfterLoad.
}
String XclImpObjectManager::GetDefaultObjName( const XclImpDrawObjBase& rDrawObj ) const
diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx
index 70ff46a0d741..5d21d91c9f53 100644
--- a/sc/source/filter/excel/xiname.cxx
+++ b/sc/source/filter/excel/xiname.cxx
@@ -132,7 +132,8 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) :
if( nXclTab != EXC_NAME_GLOBAL )
{
sal_uInt16 nUsedTab = (GetBiff() == EXC_BIFF8) ? nXclTab : nExtSheet;
- maScName.Append( '_' ).Append( String::CreateFromInt32( nUsedTab ) );
+ // #163146# do not rename sheet-local names by default, this breaks VBA scripts
+// maScName.Append( '_' ).Append( String::CreateFromInt32( nUsedTab ) );
// TODO: may not work for BIFF5, handle skipped sheets (all BIFF)
mnScTab = static_cast< SCTAB >( nUsedTab - 1 );
}
@@ -208,7 +209,8 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) :
// 4) *** create a defined name in the Calc document *** ------------------
- if( pTokArr && (bBuiltIn || !::get_flag( nFlags, EXC_NAME_HIDDEN )) && !mbVBName )
+ // #163146# do not ignore hidden names (may be regular names created by VBA scripts)
+ if( pTokArr /*&& (bBuiltIn || !::get_flag( nFlags, EXC_NAME_HIDDEN ))*/ && !mbVBName )
{
// create the Calc name data
ScRangeData* pData = new ScRangeData( GetDocPtr(), maScName, *pTokArr, ScAddress(), nNameType );
diff --git a/sc/source/filter/excel/xiroot.cxx b/sc/source/filter/excel/xiroot.cxx
index 3fd2650cf2ff..5f8bcbd481e5 100644
--- a/sc/source/filter/excel/xiroot.cxx
+++ b/sc/source/filter/excel/xiroot.cxx
@@ -289,7 +289,7 @@ void XclImpRoot::ReadCodeName( XclImpStream& rStrm, bool bGlobals )
}
else
{
- GetExtDocOptions().AppendCodeName( aName );
+ GetExtDocOptions().SetCodeName( GetCurrScTab(), aName );
GetDoc().SetCodeName( GetCurrScTab(), aName );
}
}
diff --git a/sc/source/filter/excel/xlescher.cxx b/sc/source/filter/excel/xlescher.cxx
index bb77fac2be73..153a5d5ed3cc 100644
--- a/sc/source/filter/excel/xlescher.cxx
+++ b/sc/source/filter/excel/xlescher.cxx
@@ -36,8 +36,8 @@
#include "document.hxx"
#include "xestream.hxx"
#include "xistream.hxx"
-#include "xltools.hxx"
#include "xlroot.hxx"
+#include "xltools.hxx"
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
diff --git a/sc/source/filter/inc/excdoc.hxx b/sc/source/filter/inc/excdoc.hxx
index f00e8d091590..5da6a5d38d83 100644
--- a/sc/source/filter/inc/excdoc.hxx
+++ b/sc/source/filter/inc/excdoc.hxx
@@ -69,7 +69,7 @@ private:
// pRec mit new anlegen und vergessen, delete macht ExcTable selber!
void Add( XclExpRecordBase* pRec );
- void FillAsXmlTable( size_t nCodeNameIdx );
+ void FillAsXmlTable( SCTAB nCodeNameIdx );
public:
ExcTable( const XclExpRoot& rRoot );
@@ -77,8 +77,8 @@ public:
~ExcTable();
void FillAsHeader( ExcBoundsheetList& rBoundsheetList );
- void FillAsTable( size_t nCodeNameIdx );
- void FillAsEmptyTable( size_t nCodeNameIdx );
+ void FillAsTable( SCTAB nCodeNameIdx );
+ void FillAsEmptyTable( SCTAB nCodeNameIdx );
void Write( XclExpStream& );
void WriteXml( XclExpXmlStream& );
diff --git a/sc/source/filter/inc/excimp8.hxx b/sc/source/filter/inc/excimp8.hxx
index 5b2bbe2e7b5d..7e4cca15dfe1 100644
--- a/sc/source/filter/inc/excimp8.hxx
+++ b/sc/source/filter/inc/excimp8.hxx
@@ -81,7 +81,6 @@ protected:
private:
void LoadDocumentProperties();
- void AttachDocumentEvents();
};
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index f8bafa32f205..66f3ea613a3a 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -1234,10 +1234,31 @@ void ScRowStyles::AddFieldStyleName(const sal_Int32 nTable, const sal_Int32 nFie
const sal_Int32 nStringIndex)
{
DBG_ASSERT(static_cast<size_t>(nTable) < aTables.size(), "wrong table");
- DBG_ASSERT(aTables[nTable].size() >= static_cast<sal_uInt32>(nField), "wrong field");
- if (aTables[nTable].size() == static_cast<sal_uInt32>(nField))
+ DBG_ASSERT(aTables[nTable].size() >= static_cast<size_t>(nField), "wrong field");
+ if (aTables[nTable].size() == static_cast<size_t>(nField))
aTables[nTable].push_back(nStringIndex);
- aTables[nTable][nField] = nStringIndex;
+ else
+ aTables[nTable][nField] = nStringIndex;
+}
+
+void ScRowStyles::AddFieldStyleName(const sal_Int32 nTable, const sal_Int32 nStartField,
+ const sal_Int32 nStringIndex, const sal_Int32 nEndField)
+{
+ DBG_ASSERT( nStartField <= nEndField, "bad field range");
+ DBG_ASSERT(static_cast<size_t>(nTable) < aTables.size(), "wrong table");
+ DBG_ASSERT(aTables[nTable].size() >= static_cast<size_t>(nStartField), "wrong field");
+ ScMysalInt32Vec& rTable = aTables[nTable];
+ size_t nSize = rTable.size();
+ if (nSize == static_cast<size_t>(nStartField))
+ rTable.insert( rTable.end(), static_cast<size_t>(nEndField - nStartField + 1), nStringIndex);
+ else
+ {
+ size_t nField = static_cast<size_t>(nStartField);
+ for ( ; nField < nSize && nField <= static_cast<size_t>(nEndField); ++nField)
+ rTable[nField] = nStringIndex;
+ if (nField <= static_cast<size_t>(nEndField))
+ rTable.insert( rTable.end(), static_cast<size_t>(nEndField - nField + 1), nStringIndex);
+ }
}
rtl::OUString* ScRowStyles::GetStyleName(const sal_Int32 nTable, const sal_Int32 nField)
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.hxx b/sc/source/filter/xml/XMLStylesExportHelper.hxx
index 34672aeef96e..79b19b7ce9ab 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.hxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.hxx
@@ -286,6 +286,7 @@ public:
virtual void AddNewTable(const sal_Int32 nTable, const sal_Int32 nFields);
sal_Int32 GetStyleNameIndex(const sal_Int32 nTable, const sal_Int32 nField);
void AddFieldStyleName(const sal_Int32 nTable, const sal_Int32 nField, const sal_Int32 nStringIndex);
+ void AddFieldStyleName(const sal_Int32 nTable, const sal_Int32 nStartField, const sal_Int32 nStringIndex, const sal_Int32 nEndField);
virtual rtl::OUString* GetStyleName(const sal_Int32 nTable, const sal_Int32 nField);
};
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 0563f6430063..ca5403e3b18d 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2576,14 +2576,13 @@ void ScXMLExport::_ExportAutoStyles()
}
sal_Int32 nOld(nRow);
nRow = pDoc->GetNextDifferentChangedRow(sal::static_int_cast<SCTAB>(nTable), static_cast<SCROW>(nRow), false);
- for (sal_Int32 i = nOld + 1; i < nRow; ++i)
- pRowStyles->AddFieldStyleName(nTable, i, nIndex);
+ if (nRow > nOld + 1)
+ pRowStyles->AddFieldStyleName(nTable, nOld + 1, nIndex, nRow - 1);
}
if (aCellAddress.EndRow > nRows)
{
sal_Int32 nIndex(pRowStyles->GetStyleNameIndex(nTable, nRows));
- for (sal_Int32 i = nRows + 1; i <= aCellAddress.EndRow; ++i)
- pRowStyles->AddFieldStyleName(nTable, i, nIndex);
+ pRowStyles->AddFieldStyleName(nTable, nRows + 1, nIndex, aCellAddress.EndRow);
}
}
}
@@ -4341,7 +4340,7 @@ void ScXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>&
uno::Reference <container::XNameAccess> xCodeNameAccess;
DBG_ASSERT( pDoc, "ScXMLExport::GetConfigurationSettings - no ScDocument!" );
- if( pDoc )
+ if( pDoc && pDoc->IsInVBAMode() )
{
xCodeNameAccess = new XMLCodeNameProvider( pDoc );
if( xCodeNameAccess.is() && xCodeNameAccess->hasElements() )
diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx
index 4127f5246428..d061ea24b194 100644
--- a/sc/source/filter/xml/xmlstyle.cxx
+++ b/sc/source/filter/xml/xmlstyle.cxx
@@ -81,9 +81,11 @@ const XMLPropertyMapEntry aXMLScCellStylesProperties[] =
MAP( "ConditionalFormatXML", XML_NAMESPACE_STYLE, XML_MAP, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM, CTF_SC_IMPORT_MAP ),
MAP( "ConditionalFormatXML", XML_NAMESPACE_STYLE, XML_MAP, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM, CTF_SC_MAP ),
MAP( "DiagonalBLTR", XML_NAMESPACE_STYLE, XML_DIAGONAL_BL_TR, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER, CTF_SC_DIAGONALBLTR ),
- MAP( "DiagonalBLTR", XML_NAMESPACE_STYLE, XML_DIAGONAL_BL_TR_WIDTH, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER_WIDTH, CTF_SC_DIAGONALBLTRWIDTH ),
+ MAP( "DiagonalBLTR", XML_NAMESPACE_STYLE, XML_DIAGONAL_BL_TR_WIDTH, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER_WIDTH, CTF_SC_DIAGONALBLTRWIDTH ), // #i102690# for old files
+ MAP( "DiagonalBLTR", XML_NAMESPACE_STYLE, XML_DIAGONAL_BL_TR_WIDTHS, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER_WIDTH, CTF_SC_DIAGONALBLTRWIDTHS ),
MAP( "DiagonalTLBR", XML_NAMESPACE_STYLE, XML_DIAGONAL_TL_BR, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER, CTF_SC_DIAGONALTLBR ),
- MAP( "DiagonalTLBR", XML_NAMESPACE_STYLE, XML_DIAGONAL_TL_BR_WIDTH, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER_WIDTH, CTF_SC_DIAGONALTLBRWIDTH ),
+ MAP( "DiagonalTLBR", XML_NAMESPACE_STYLE, XML_DIAGONAL_TL_BR_WIDTH, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER_WIDTH, CTF_SC_DIAGONALTLBRWIDTH ), // #i102690# for old files
+ MAP( "DiagonalTLBR", XML_NAMESPACE_STYLE, XML_DIAGONAL_TL_BR_WIDTHS, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER_WIDTH, CTF_SC_DIAGONALTLBRWIDTHS ),
MAP( "HoriJustify", XML_NAMESPACE_FO, XML_TEXT_ALIGN, XML_TYPE_PROP_PARAGRAPH|XML_SC_TYPE_HORIJUSTIFY|MID_FLAG_MERGE_PROPERTY, 0 ),
MAP( "HoriJustify", XML_NAMESPACE_STYLE, XML_TEXT_ALIGN_SOURCE, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_HORIJUSTIFYSOURCE|MID_FLAG_MERGE_PROPERTY, 0 ),
MAP( "HoriJustify", XML_NAMESPACE_STYLE, XML_REPEAT_CONTENT, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_HORIJUSTIFYREPEAT|MID_FLAG_MERGE_PROPERTY, 0 ),
@@ -490,6 +492,18 @@ void ScXMLCellExportPropertyMapper::ContextFilter(
pParaMarginBottomRel->maValue.clear();
}
+ // #i102690# old diagonal line attribute names without "s" are only read, not written
+ if (pDiagonalTLBRWidthState)
+ {
+ pDiagonalTLBRWidthState->mnIndex = -1;
+ pDiagonalTLBRWidthState->maValue.clear();
+ }
+ if (pDiagonalBLTRWidthState)
+ {
+ pDiagonalBLTRWidthState->mnIndex = -1;
+ pDiagonalBLTRWidthState->maValue.clear();
+ }
+
SvXMLExportPropertyMapper::ContextFilter(rProperties, rPropSet);
}
diff --git a/sc/source/filter/xml/xmlstyle.hxx b/sc/source/filter/xml/xmlstyle.hxx
index 07e7138afc71..f8abf5e6443d 100644
--- a/sc/source/filter/xml/xmlstyle.hxx
+++ b/sc/source/filter/xml/xmlstyle.hxx
@@ -90,6 +90,8 @@ extern const XMLPropertyMapEntry aXMLScTableStylesImportProperties[];
#define CTF_SC_DIAGONALTLBRWIDTH (XML_SC_CTF_START + 26)
#define CTF_SC_DIAGONALBLTR (XML_SC_CTF_START + 27)
#define CTF_SC_DIAGONALBLTRWIDTH (XML_SC_CTF_START + 28)
+#define CTF_SC_DIAGONALTLBRWIDTHS (XML_SC_CTF_START + 29)
+#define CTF_SC_DIAGONALBLTRWIDTHS (XML_SC_CTF_START + 30)
#define CTF_SC_ROWHEIGHT (XML_SC_CTF_START + 50)
#define CTF_SC_ROWOPTIMALHEIGHT (XML_SC_CTF_START + 51)
diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx
index 9a04e284bf45..3866bba63239 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -105,6 +105,7 @@ void ScXMLCellImportPropertyMapper::finished(::std::vector< XMLPropertyState >&
XMLPropertyState* pAllBorderWidthProperty = NULL;
XMLPropertyState* pBorderWidths[4] = { NULL, NULL, NULL, NULL };
XMLPropertyState* pDiagBorders[2] = { 0 };
+ XMLPropertyState* pOldDiagBorderWidths[2] = { 0 }; // old attribute names without "s"
XMLPropertyState* pDiagBorderWidths[2] = { 0 };
::std::vector< XMLPropertyState >::iterator endproperty(rProperties.end());
@@ -134,8 +135,10 @@ void ScXMLCellImportPropertyMapper::finished(::std::vector< XMLPropertyState >&
case CTF_SC_BOTTOMBORDERWIDTH : pBorderWidths[XML_LINE_BOTTOM] = &*property; break;
case CTF_SC_DIAGONALTLBR : pDiagBorders[XML_LINE_TLBR] = &*property; break;
case CTF_SC_DIAGONALBLTR : pDiagBorders[XML_LINE_BLTR] = &*property; break;
- case CTF_SC_DIAGONALTLBRWIDTH : pDiagBorderWidths[XML_LINE_TLBR] = &*property; break;
- case CTF_SC_DIAGONALBLTRWIDTH : pDiagBorderWidths[XML_LINE_BLTR] = &*property; break;
+ case CTF_SC_DIAGONALTLBRWIDTH : pOldDiagBorderWidths[XML_LINE_TLBR] = &*property; break;
+ case CTF_SC_DIAGONALTLBRWIDTHS : pDiagBorderWidths[XML_LINE_TLBR] = &*property; break;
+ case CTF_SC_DIAGONALBLTRWIDTH : pOldDiagBorderWidths[XML_LINE_BLTR] = &*property; break;
+ case CTF_SC_DIAGONALBLTRWIDTHS : pDiagBorderWidths[XML_LINE_BLTR] = &*property; break;
}
}
}
@@ -179,17 +182,23 @@ void ScXMLCellImportPropertyMapper::finished(::std::vector< XMLPropertyState >&
}
for( i = 0; i < 2; ++i )
{
- if( pDiagBorders[i] && pDiagBorderWidths[i] )
+ if( pDiagBorders[i] && ( pDiagBorderWidths[i] || pOldDiagBorderWidths[i] ) )
{
table::BorderLine aBorderLine;
pDiagBorders[i]->maValue >>= aBorderLine;
table::BorderLine aBorderLineWidth;
- pDiagBorderWidths[i]->maValue >>= aBorderLineWidth;
+ if (pDiagBorderWidths[i])
+ pDiagBorderWidths[i]->maValue >>= aBorderLineWidth; // prefer new attribute
+ else
+ pOldDiagBorderWidths[i]->maValue >>= aBorderLineWidth;
aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
pDiagBorders[i]->maValue <<= aBorderLine;
- pDiagBorderWidths[i]->mnIndex = -1;
+ if (pDiagBorderWidths[i])
+ pDiagBorderWidths[i]->mnIndex = -1;
+ if (pOldDiagBorderWidths[i])
+ pOldDiagBorderWidths[i]->mnIndex = -1; // reset mnIndex for old and new attribute if both are present
}
}