[Libreoffice-commits] .: 33 commits - formula/source oox/source scaddins/source sc/inc sc/qa sc/sdi sc/source sc/util
Eike Rathke
erack at kemper.freedesktop.org
Mon Nov 28 06:26:20 PST 2011
formula/source/core/resource/core_resource.src | 8
oox/source/token/properties.txt | 1
oox/source/xls/worksheethelper.cxx | 4
sc/inc/column.hxx | 1
sc/inc/dociter.hxx | 36 ++
sc/inc/document.hxx | 4
sc/inc/dpsave.hxx | 4
sc/inc/helpids.h | 4
sc/inc/table.hxx | 1
sc/inc/unonames.hxx | 2
sc/qa/unit/ucalc.cxx | 4
sc/sdi/scalc.sdi | 10
sc/source/core/data/column2.cxx | 27 +-
sc/source/core/data/dociter.cxx | 182 +++++++++++++
sc/source/core/data/documen2.cxx | 12
sc/source/core/data/documen9.cxx | 7
sc/source/core/data/document.cxx | 54 ++++
sc/source/core/data/drwlayer.cxx | 26 +
sc/source/core/data/table1.cxx | 10
sc/source/core/data/table5.cxx | 2
sc/source/core/inc/doubleref.hxx | 3
sc/source/core/inc/interpre.hxx | 4
sc/source/core/tool/doubleref.cxx | 58 ----
sc/source/core/tool/interpr1.cxx | 24 +
sc/source/core/tool/interpr2.cxx | 54 ++--
sc/source/core/tool/interpr4.cxx | 4
sc/source/core/tool/rangeseq.cxx | 30 +-
sc/source/filter/excel/colrowst.cxx | 5
sc/source/filter/excel/xechart.cxx | 2
sc/source/filter/excel/xeformula.cxx | 8
sc/source/filter/excel/xepivot.cxx | 10
sc/source/filter/excel/xichart.cxx | 54 ++--
sc/source/filter/excel/xlchart.cxx | 15 -
sc/source/filter/excel/xlformula.cxx | 4
sc/source/filter/inc/xichart.hxx | 16 -
sc/source/filter/inc/xlchart.hxx | 15 -
sc/source/filter/xml/XMLExportDataPilot.cxx | 2
sc/source/filter/xml/xmldpimp.cxx | 5
sc/source/filter/xml/xmlexprt.cxx | 20 -
sc/source/filter/xml/xmlexprt.hxx | 4
sc/source/filter/xml/xmlimprt.cxx | 1
sc/source/filter/xml/xmlimprt.hxx | 1
sc/source/ui/app/inputhdl.cxx | 11
sc/source/ui/app/typemap.cxx | 1
sc/source/ui/dbgui/pvlaydlg.cxx | 8
sc/source/ui/dbgui/scuiasciiopt.cxx | 8
sc/source/ui/docshell/dbdocfun.cxx | 37 +-
sc/source/ui/docshell/dbdocimp.cxx | 158 ++++--------
sc/source/ui/docshell/docsh.cxx | 4
sc/source/ui/docshell/docsh4.cxx | 52 ---
sc/source/ui/docshell/docsh5.cxx | 4
sc/source/ui/docshell/docsh8.cxx | 25 -
sc/source/ui/docshell/olinefun.cxx | 69 +++--
sc/source/ui/drawfunc/drawsh5.cxx | 9
sc/source/ui/drawfunc/drtxtob2.cxx | 3
sc/source/ui/inc/dbdocfun.hxx | 19 -
sc/source/ui/inc/output.hxx | 3
sc/source/ui/inc/preview.hxx | 3
sc/source/ui/inc/printfun.hxx | 14 -
sc/source/ui/inc/tabvwsh.hxx | 2
sc/source/ui/inc/undodraw.hxx | 2
sc/source/ui/src/scfuncs.src | 99 +++++++
sc/source/ui/undo/undodraw.cxx | 67 -----
sc/source/ui/unoobj/cellsuno.cxx | 9
sc/source/ui/unoobj/dapiuno.cxx | 22 -
sc/source/ui/unoobj/datauno.cxx | 3
sc/source/ui/unoobj/docuno.cxx | 23 +
sc/source/ui/view/dbfunc.cxx | 3
sc/source/ui/view/formatsh.cxx | 11
sc/source/ui/view/output2.cxx | 66 ++---
sc/source/ui/view/pfuncache.cxx | 9
sc/source/ui/view/preview.cxx | 328 +++++++++----------------
sc/source/ui/view/printfun.cxx | 86 ------
sc/source/ui/view/tabvwsh4.cxx | 9
sc/source/ui/view/viewfun5.cxx | 23 -
sc/util/hidother.src | 4
scaddins/source/analysis/bessel.cxx | 69 ++---
77 files changed, 1119 insertions(+), 882 deletions(-)
New commits:
commit b1f561627650feb273d8d86ec2d33f040f780222
Author: Eike Rathke <erack at redhat.com>
Date: Mon Nov 28 14:36:41 2011 +0100
added CSC,SEC,CSCH,SECH to testFunctionLists
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 21914d9..b287486 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -2160,6 +2160,8 @@ void Test::testFunctionLists()
"COTH",
"COUNTBLANK",
"COUNTIF",
+ "CSC",
+ "CSCH",
"DEGREES",
"EUROCONVERT",
"EVEN",
@@ -2184,6 +2186,8 @@ void Test::testFunctionLists()
"ROUND",
"ROUNDDOWN",
"ROUNDUP",
+ "SEC",
+ "SECH",
"SIGN",
"SIN",
"SINH",
commit 42e80ec68bc1f4d2dfd62b82116790687321d231
Author: Eike Rathke <erack at redhat.com>
Date: Mon Nov 28 12:41:50 2011 +0100
dr80: #i116460# performance of Excel file with many outlines
# HG changeset patch
# User Niklas Nebel <nn at openoffice.org>
# Date 1300438660 -3600
# Node ID aa7d08a12d7ee60c71eb4f2dc1241197e009c443
# Parent 49c53fbe0cd4d663f419b659c82618bd106282ef
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 1469c82..d071a22 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -494,6 +494,7 @@ VerticalSplitMode
VerticalSplitPositionTwips
ViewBox
Visible
+VisibleFlag
VisibleSize
VisualArea
VisualEffect
diff --git a/oox/source/xls/worksheethelper.cxx b/oox/source/xls/worksheethelper.cxx
index 02802a3..ba5014f 100644
--- a/oox/source/xls/worksheethelper.cxx
+++ b/oox/source/xls/worksheethelper.cxx
@@ -1243,7 +1243,9 @@ void WorksheetGlobals::convertRows( OutlineLevelVec& orRowLevels,
if( rModel.mbHidden )
{
PropertySet aPropSet( getRows( rRowRange ) );
- aPropSet.setProperty( PROP_IsVisible, false );
+ // #i116460# Use VisibleFlag instead of IsVisible: directly set the flag,
+ // without drawing layer update etc. (only possible before shapes are inserted)
+ aPropSet.setProperty( PROP_VisibleFlag, false );
}
// outline settings for this row range
diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index 72070af..a4417ec 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -179,6 +179,8 @@
#define SC_UNONAME_AUTOPRINT "AutomaticPrintArea"
#define SC_UNONAME_TABCOLOR "TabColor"
+#define SC_UNONAME_VISFLAG "VisibleFlag"
+
// LinkTarget
#define SC_UNO_LINKDISPBIT "LinkDisplayBitmap"
#define SC_UNO_LINKDISPNAME "LinkDisplayName"
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 997e516..58b591c 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -959,6 +959,15 @@ void ScDrawLayer::MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCR
if (!bAdjustEnabled)
return;
+ SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab));
+ OSL_ENSURE(pPage,"Page not found");
+ if (!pPage)
+ return;
+
+ // for an empty page, there's no need to calculate the row heights
+ if (!pPage->GetObjCount())
+ return;
+
sal_Bool bNegativePage = pDoc->IsNegativePage( nTab );
Rectangle aRect = pDoc->GetMMRect( nCol1, nRow1, nCol2, nRow2, nTab );
@@ -1003,6 +1012,15 @@ sal_Bool ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndR
if ( !pDoc )
return false;
+ SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab));
+ OSL_ENSURE(pPage,"Page not found");
+ if (!pPage)
+ return sal_False;
+
+ // for an empty page, there's no need to calculate the row heights
+ if (!pPage->GetObjCount())
+ return sal_False;
+
Rectangle aTestRect;
aTestRect.Top() += pDoc->GetRowHeight( 0, nStartRow-1, nTab);
@@ -1025,11 +1043,6 @@ sal_Bool ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndR
if ( bNegativePage )
MirrorRectRTL( aTestRect );
- SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab));
- OSL_ENSURE(pPage,"Page nicht gefunden");
- if (!pPage)
- return false;
-
sal_Bool bFound = false;
Rectangle aObjRect;
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 52b83b1..e03c285 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -161,10 +161,12 @@ struct SetRowHeightRangeFunc : public OptimalHeightsFuncObjBase
}
};
-bool SetOptimalHeightsToRows(OptimalHeightsFuncObjBase& rFuncObj,
+bool SetOptimalHeightsToRows( OptimalHeightsFuncObjBase& rFuncObj, ScTable* pTab,
ScBitMaskCompressedArray<SCROW, sal_uInt8>* pRowFlags, SCROW nStartRow, SCROW nEndRow, sal_uInt16 nExtra,
const vector<sal_uInt16>& aHeights, bool bForce)
{
+ pTab->IncRecalcLevel(); // #i116460# avoid problems with Excel files
+
SCSIZE nCount = static_cast<SCSIZE>(nEndRow-nStartRow+1);
bool bChanged = false;
SCROW nRngStart = 0;
@@ -221,6 +223,8 @@ bool SetOptimalHeightsToRows(OptimalHeightsFuncObjBase& rFuncObj,
if (nLast)
bChanged |= rFuncObj(nRngStart, nRngEnd, nLast);
+ pTab->DecRecalcLevel(); // #i116460# avoid problems with Excel files
+
return bChanged;
}
@@ -478,7 +482,7 @@ bool ScTable::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16 nExtr
SetRowHeightRangeFunc aFunc(this, nPPTX, nPPTY);
bool bChanged = SetOptimalHeightsToRows(
- aFunc, pRowFlags, nStartRow, nEndRow, nExtra, aHeights, bForce);
+ aFunc, this, pRowFlags, nStartRow, nEndRow, nExtra, aHeights, bForce);
if ( pProgress != pOuterProgress )
delete pProgress;
@@ -509,7 +513,7 @@ void ScTable::SetOptimalHeightOnly( SCROW nStartRow, SCROW nEndRow, sal_uInt16 n
SetRowHeightOnlyFunc aFunc(this);
SetOptimalHeightsToRows(
- aFunc, pRowFlags, nStartRow, nEndRow, nExtra, aHeights, bForce);
+ aFunc, this, pRowFlags, nStartRow, nEndRow, nExtra, aHeights, bForce);
if ( pProgress != pOuterProgress )
delete pProgress;
diff --git a/sc/source/filter/excel/colrowst.cxx b/sc/source/filter/excel/colrowst.cxx
index bc6ca42..8da41c9 100644
--- a/sc/source/filter/excel/colrowst.cxx
+++ b/sc/source/filter/excel/colrowst.cxx
@@ -297,6 +297,7 @@ void XclImpColRowSettings::Convert( SCTAB nScTab )
void XclImpColRowSettings::ConvertHiddenFlags( SCTAB nScTab )
{
ScDocument& rDoc = GetDoc();
+ rDoc.IncSizeRecalcLevel( nScTab ); // #i116460# performance with many hidden rows
// hide the columns
for( SCCOL nScCol = 0; nScCol <= MAXCOL; ++nScCol )
@@ -340,7 +341,7 @@ void XclImpColRowSettings::ConvertHiddenFlags( SCTAB nScTab )
{
if (bPrevHidden)
{
- rDoc.ShowRows(nPrevRow, nRow-1, nScTab, false);
+ rDoc.SetRowHidden(nPrevRow, nRow-1, nScTab, true); // #i116460# SetRowHidden instead of ShowRow
// #i38093# rows hidden by filter need extra flag
if (nFirstFilterScRow <= nPrevRow && nPrevRow <= nLastFilterScRow)
{
@@ -357,6 +358,8 @@ void XclImpColRowSettings::ConvertHiddenFlags( SCTAB nScTab )
// #i47438# if default row format is hidden, hide remaining rows
if( ::get_flag( mnDefRowFlags, EXC_DEFROW_HIDDEN ) && (mnLastScRow < MAXROW) )
rDoc.ShowRows( mnLastScRow + 1, MAXROW, nScTab, false );
+
+ rDoc.DecSizeRecalcLevel( nScTab ); // #i116460# performance with many hidden rows
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx
index 3f0a3a1..92dc97f 100644
--- a/sc/source/ui/docshell/olinefun.cxx
+++ b/sc/source/ui/docshell/olinefun.cxx
@@ -391,6 +391,8 @@ sal_Bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, sal_Bool bColumns, sal_uInt1
bColumns, nLevel ) );
}
+ pDoc->IncSizeRecalcLevel( nTab );
+
pDoc->InitializeNoteCaptions(nTab);
ScSubOutlineIterator aIter( pArray ); // alle Eintraege
ScOutlineEntry* pEntry;
@@ -420,11 +422,19 @@ sal_Bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, sal_Bool bColumns, sal_uInt1
if ( bColumns )
pDoc->ShowCol( static_cast<SCCOL>(i), nTab, bShow );
else
- if ( !bShow || !pDoc->RowFiltered( i,nTab ) )
- pDoc->ShowRow( i, nTab, bShow );
+ {
+ // show several rows together, don't show filtered rows
+ SCROW nFilterEnd = i;
+ bool bFiltered = pDoc->RowFiltered( i, nTab, NULL, &nFilterEnd );
+ nFilterEnd = std::min( nThisEnd, nFilterEnd );
+ if ( !bShow || !bFiltered )
+ pDoc->ShowRows( i, nFilterEnd, nTab, bShow );
+ i = nFilterEnd;
+ }
}
}
+ pDoc->DecSizeRecalcLevel( nTab );
pDoc->SetDrawPageSize(nTab);
pDoc->UpdatePageBreaks( nTab );
@@ -479,6 +489,8 @@ sal_Bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, sal_Bool b
pUndoDoc, pUndoTab, sal_True ) );
}
+ pDoc->IncSizeRecalcLevel( nTab );
+
// Spalten
nMin=MAXCOL;
@@ -520,9 +532,17 @@ sal_Bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, sal_Bool b
}
}
for ( i=nMin; i<=nMax; i++ )
- if ( !pDoc->RowFiltered( i,nTab ) ) // weggefilterte nicht einblenden
- pDoc->ShowRow( i, nTab, sal_True );
+ {
+ // show several rows together, don't show filtered rows
+ SCROW nFilterEnd = i;
+ bool bFiltered = pDoc->RowFiltered( i, nTab, NULL, &nFilterEnd );
+ nFilterEnd = std::min( nMax, nFilterEnd );
+ if ( !bFiltered )
+ pDoc->ShowRows( i, nFilterEnd, nTab, sal_True );
+ i = nFilterEnd;
+ }
+ pDoc->DecSizeRecalcLevel( nTab );
pDoc->SetDrawPageSize(nTab);
pDoc->UpdatePageBreaks( nTab );
@@ -592,6 +612,8 @@ sal_Bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, sal_Bool b
pUndoDoc, pUndoTab, false ) );
}
+ pDoc->IncSizeRecalcLevel( nTab );
+
// Spalten
nCount = pColArray->GetCount(nColLevel);
@@ -618,6 +640,7 @@ sal_Bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, sal_Bool b
HideOutline( nTab, false, nRowLevel, i, false, false, bApi );
}
+ pDoc->DecSizeRecalcLevel( nTab );
pDoc->UpdatePageBreaks( nTab );
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_GRID | PAINT_LEFT | PAINT_TOP );
@@ -673,6 +696,8 @@ sal_Bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt1
//! HideCursor();
+ pDoc->IncSizeRecalcLevel( nTab );
+
pDoc->InitializeNoteCaptions(nTab);
pEntry->SetHidden(false);
SCCOLROW i;
@@ -681,8 +706,15 @@ sal_Bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt1
if ( bColumns )
pDoc->ShowCol( static_cast<SCCOL>(i), nTab, sal_True );
else
- if ( !pDoc->RowFiltered( i,nTab ) ) // weggefilterte nicht einblenden
- pDoc->ShowRow( i, nTab, sal_True );
+ {
+ // show several rows together, don't show filtered rows
+ SCROW nFilterEnd = i;
+ bool bFiltered = pDoc->RowFiltered( i, nTab, NULL, &nFilterEnd );
+ nFilterEnd = std::min( nEnd, nFilterEnd );
+ if ( !bFiltered )
+ pDoc->ShowRows( i, nFilterEnd, nTab, sal_True );
+ i = nFilterEnd;
+ }
}
ScSubOutlineIterator aIter( pArray, nLevel, nEntry );
@@ -692,13 +724,11 @@ sal_Bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt1
{
SCCOLROW nSubStart = pEntry->GetStart();
SCCOLROW nSubEnd = pEntry->GetEnd();
- for ( i = nSubStart; i <= nSubEnd; i++ )
- {
- if ( bColumns )
+ if ( bColumns )
+ for ( i = nSubStart; i <= nSubEnd; i++ )
pDoc->ShowCol( static_cast<SCCOL>(i), nTab, false );
- else
- pDoc->ShowRow( i, nTab, false );
- }
+ else
+ pDoc->ShowRows( nSubStart, nSubEnd, nTab, sal_False );
}
}
@@ -759,19 +789,20 @@ sal_Bool ScOutlineDocFunc::HideOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt1
//! HideCursor();
+ pDoc->IncSizeRecalcLevel( nTab );
+
pDoc->InitializeNoteCaptions(nTab);
pEntry->SetHidden(true);
SCCOLROW i;
- for ( i = nStart; i <= nEnd; i++ )
- {
- if ( bColumns )
- pDoc->ShowCol( static_cast<SCCOL>(i), nTab, false );
- else
- pDoc->ShowRow( i, nTab, false );
- }
+ if ( bColumns )
+ for ( i = nStart; i <= nEnd; i++ )
+ pDoc->ShowCol( static_cast<SCCOL>(i), nTab, sal_False );
+ else
+ pDoc->ShowRows( nStart, nEnd, nTab, sal_False );
pArray->SetVisibleBelow( nLevel, nEntry, false );
+ pDoc->DecSizeRecalcLevel( nTab );
pDoc->SetDrawPageSize(nTab);
pDoc->InvalidatePageBreaks(nTab);
pDoc->UpdatePageBreaks( nTab );
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 31bb2e3..affcb56 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -3267,6 +3267,12 @@ void SAL_CALL ScTableRowsObj::setPropertyValue(
aFunc.SetWidthOrHeight( false, 1, nRowArr, nTab, eMode, 0, sal_True, sal_True );
// SC_SIZE_DIRECT with size 0: hide
}
+ else if ( aNameString.EqualsAscii( SC_UNONAME_VISFLAG ) )
+ {
+ // #i116460# Shortcut to only set the flag, without drawing layer update etc.
+ // Should only be used from import filters.
+ pDoc->SetRowHidden(nStartRow, nEndRow, nTab, !ScUnoHelpFunctions::GetBoolFromAny( aValue ));
+ }
else if ( aNameString.EqualsAscii( SC_UNONAME_CELLFILT ) )
{
//! undo etc.
commit 62e8e2a31a9344ee40a5ebde6fe7559290efb300
Author: Eike Rathke <erack at redhat.com>
Date: Mon Nov 28 03:37:41 2011 +0100
dr80: #i164410# optimized cell allocation in XCellRangeData::setDataArray() to improve performance of import filters
# HG changeset patch
# User Daniel Rentz [dr] <daniel.rentz at oracle.com>
# Date 1300094581 -3600
# Node ID 05c6b55810889860d2002614b870484de6581ccb
# Parent 564e24baaaae5e18c8bfa76811993fbefa571b5c
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index fc90a3a..e26ae90 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1109,6 +1109,11 @@ sal_Bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
pDoc->DeleteAreaTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, IDF_CONTENTS );
+ /* #164410# Use double allocation, which will speed up import filters
+ using XCellRangeData::setDataArray() significantly. */
+ bool bDoubleAlloc = ScColumn::bDoubleAlloc;
+ ScColumn::bDoubleAlloc = true;
+
sal_Bool bError = false;
SCROW nDocRow = nStartRow;
for (long nRow=0; nRow<nRows; nRow++)
@@ -1159,6 +1164,7 @@ sal_Bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
++nDocRow;
}
+ ScColumn::bDoubleAlloc = bDoubleAlloc;
sal_Bool bHeight = rDocShell.AdjustRowHeight( nStartRow, nEndRow, nTab );
commit 0afc3190deb3cc77eb2149104925a5daadf6ded1
Author: Eike Rathke <erack at redhat.com>
Date: Mon Nov 28 03:24:36 2011 +0100
#i111413# re-added translation relevant strings for SEC, CSC, SECH and CSCH.
Functions' UI name strings weren't marked for translation, added that now.
diff --git a/formula/source/core/resource/core_resource.src b/formula/source/core/resource/core_resource.src
index e42a06d..aab02c6 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -848,19 +848,19 @@ Resource RID_STRLIST_FUNCTION_NAMES
};
String SC_OPCODE_COSECANT
{
- Text = "CSC" ;
+ Text [ en-US ] = "CSC" ;
};
String SC_OPCODE_SECANT
{
- Text = "SEC" ;
+ Text [ en-US ] = "SEC" ;
};
String SC_OPCODE_COSECANT_HYP
{
- Text = "CSCH" ;
+ Text [ en-US ] = "CSCH" ;
};
String SC_OPCODE_SECANT_HYP
{
- Text = "SECH" ;
+ Text [ en-US ] = "SECH" ;
};
String SC_OPCODE_EXP
{
commit 2c326f35eb72b7e28cdeb20536c7969f9b5e5400
Author: Eike Rathke <erack at redhat.com>
Date: Mon Nov 28 03:07:35 2011 +0100
dr78: #i104716# don't include SC_LAYER_HIDDEN in ScDrawLayer::GetPrintArea
# HG changeset patch
# User Niklas Nebel <nn at openoffice.org>
# Date 1297677053 -3600
# Node ID 93ac285b632c93ef8bf61c69789a33eac25bcedf
# Parent 95b9bc73220ec07d91ac8a99daab107417705b33
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 0994180..997e516 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -846,7 +846,8 @@ sal_Bool ScDrawLayer::GetPrintArea( ScRange& rRange, sal_Bool bSetHor, sal_Bool
bFit = false;
if ( !bSetVer && ( aObjRect.Bottom() < nStartY || aObjRect.Top() > nEndY ) )
bFit = false;
- if ( bFit )
+ // #i104716# don't include hidden note objects
+ if ( bFit && pObject->GetLayer() != SC_LAYER_HIDDEN )
{
if (bSetHor)
{
commit 549df99fdc19ad5a67e9f76f379804051656b019
Author: Eike Rathke <erack at redhat.com>
Date: Mon Nov 28 03:03:42 2011 +0100
dr78: #i106580# handle SvxTextLineItem, base class of SvxUnderlineItem
# HG changeset patch
# User Niklas Nebel <nn at openoffice.org>
# Date 1297360398 -3600
# Node ID eef10dfbe87ed2caa242bea5bb505276d760cd34
# Parent bbb6341ff7ab28ffdfbd712ae51248f98a1f208c
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 7b66556..dd619fe 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1238,13 +1238,22 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
if( pSet )
{
- const SvxUnderlineItem& rUnderline = (const SvxUnderlineItem&)pSet->Get( ATTR_FONT_UNDERLINE );
+ const SfxPoolItem& rUnderline = pSet->Get( ATTR_FONT_UNDERLINE );
if( rUnderline.ISA(SvxUnderlineItem) )
{
pTabViewShell->ApplyAttr( rUnderline );
pNewSet->Put( rUnderline,rUnderline.Which() );
}
+ else if ( rUnderline.ISA(SvxTextLineItem) )
+ {
+ // #i106580# also allow SvxTextLineItem (base class of SvxUnderlineItem)
+ const SvxTextLineItem& rTextLineItem = static_cast<const SvxTextLineItem&>(rUnderline);
+ SvxUnderlineItem aNewItem( rTextLineItem.GetLineStyle(), rTextLineItem.Which() );
+ aNewItem.SetColor( rTextLineItem.GetColor() );
+ pTabViewShell->ApplyAttr( aNewItem );
+ pNewSet->Put( aNewItem, aNewItem.Which() );
+ }
}
else
{
commit d8a85d728f45826c485eb3d250a394e3462e37a1
Author: Eike Rathke <erack at redhat.com>
Date: Mon Nov 28 03:01:52 2011 +0100
dr78: #i116881# correct handling of cached page breaks for user-defined cell range, remove unused parameter in DoPrint
# HG changeset patch
# User Niklas Nebel <nn at openoffice.org>
# Date 1297188469 -3600
# Node ID be5ffcd423c49c0045ddeaf11702d44fbde8a8f1
# Parent 3157cd9d60c35f1bcb4c8f56e86cf76ab364e7ee
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx
index 7c64917..f5a2abe 100644
--- a/sc/source/core/data/table5.cxx
+++ b/sc/source/core/data/table5.cxx
@@ -317,7 +317,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea )
if (nEndRow+2 <= MAXROW)
RemoveRowPageBreaks(nEndRow+2, MAXROW);
}
- mbPageBreaksValid = true;
+ mbPageBreaksValid = !pUserArea; // #i116881# the valid flag can only apply to the "no user area" case
}
void ScTable::RemoveManualBreaks()
diff --git a/sc/source/ui/inc/printfun.hxx b/sc/source/ui/inc/printfun.hxx
index 0c84978..1b0a4b4 100644
--- a/sc/source/ui/inc/printfun.hxx
+++ b/sc/source/ui/inc/printfun.hxx
@@ -268,7 +268,7 @@ public:
void ApplyPrintSettings(); // aus DoPrint() schon gerufen
long DoPrint( const MultiSelection& rPageRanges,
long nStartPage, long nDisplayStart, bool bDoPrint,
- SfxProgress* pProgress, ScPreviewLocationData* pLocationData );
+ ScPreviewLocationData* pLocationData );
// Werte abfragen - sofort
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 667bb4c..31bb2e3 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1063,7 +1063,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
long nDisplayStart = pPrintFuncCache->GetDisplayStart( nTab );
long nTabStart = pPrintFuncCache->GetTabStart( nTab );
- (void)aFunc.DoPrint( aPage, nTabStart, nDisplayStart, false, NULL, NULL );
+ (void)aFunc.DoPrint( aPage, nTabStart, nDisplayStart, false, NULL );
ScRange aCellRange;
sal_Bool bWasCellRange = aFunc.GetLastSourceRange( aCellRange );
@@ -1193,7 +1193,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
}
}
- (void)aFunc.DoPrint( aPage, nTabStart, nDisplayStart, sal_True, NULL, NULL );
+ (void)aFunc.DoPrint( aPage, nTabStart, nDisplayStart, true, NULL );
// resolve the hyperlinks for PDF export
diff --git a/sc/source/ui/view/pfuncache.cxx b/sc/source/ui/view/pfuncache.cxx
index f13b293..cbc2068 100644
--- a/sc/source/ui/view/pfuncache.cxx
+++ b/sc/source/ui/view/pfuncache.cxx
@@ -78,8 +78,6 @@ ScPrintFuncCache::ScPrintFuncCache( ScDocShell* pD, const ScMarkData& rMark,
long nThisTab = 0;
if ( rMark.GetTableSelect( nTab ) )
{
- pDoc->InvalidatePageBreaks( nTab ); // user print area (selection) may be different
-
ScPrintFunc aFunc( pDocSh, pPrinter, nTab, nAttrPage, 0, pSelRange, &aSelection.GetOptions() );
nThisTab = aFunc.GetTotalPages();
nFirstAttr.push_back( aFunc.GetFirstPageNo() ); // from page style or previous sheet
@@ -131,7 +129,7 @@ void ScPrintFuncCache::InitLocations( const ScMarkData& rMark, OutputDevice* pDe
aPage.Select( aPageRange );
ScPreviewLocationData aLocData( pDoc, pDev );
- aFunc.DoPrint( aPage, nTabStart, nDisplayStart, false, NULL, &aLocData );
+ aFunc.DoPrint( aPage, nTabStart, nDisplayStart, false, &aLocData );
ScRange aCellRange;
Rectangle aPixRect;
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 7e018e6..269b637 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -415,7 +415,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
aPage.SetTotalRange( Range(0,RANGE_MAX) );
aPage.Select( aPageRange );
- long nPrinted = pPrintFunc->DoPrint( aPage, nTabStart, nDisplayStart, bDoPrint, NULL, pFillLocation );
+ long nPrinted = pPrintFunc->DoPrint( aPage, nTabStart, nDisplayStart, bDoPrint, pFillLocation );
OSL_ENSURE(nPrinted<=1, "was'n nu los?");
SetMapMode(aMMMode);
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index c844fd9..b6af96a 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -51,7 +51,6 @@
#include <editeng/ulspitem.hxx>
#include <sfx2/app.hxx>
#include <sfx2/printer.hxx>
-#include <sfx2/progress.hxx>
#include <tools/multisel.hxx>
#include <sfx2/docfile.hxx>
#include <tools/urlobj.hxx>
@@ -2609,7 +2608,7 @@ void ScPrintFunc::ApplyPrintSettings()
long ScPrintFunc::DoPrint( const MultiSelection& rPageRanges,
long nStartPage, long nDisplayStart, bool bDoPrint,
- SfxProgress* pProgress, ScPreviewLocationData* pLocationData )
+ ScPreviewLocationData* pLocationData )
{
OSL_ENSURE(pDev,"Device == NULL");
if (!pParamSet)
@@ -2629,9 +2628,6 @@ long ScPrintFunc::DoPrint( const MultiSelection& rPageRanges,
MakeTableString();
- if ( pProgress )
- pProgress->SetText( String( ScResId( SCSTR_STAT_PRINT ) ) );
-
//--------------------------------------------------------------------
long nPageNo = 0;
@@ -2672,12 +2668,6 @@ long ScPrintFunc::DoPrint( const MultiSelection& rPageRanges,
{
PrintPage( nPageNo+nDisplayStart, nX1, nY1, nX2, nY2,
bDoPrint, pLocationData );
-
- if ( pProgress )
- {
- pProgress->SetState( nPageNo+nStartPage+1, nEndPage );
- pProgress->Reschedule(); //does the user want to continue
- }
++nPrinted;
}
++nPageNo;
@@ -2702,13 +2692,6 @@ long ScPrintFunc::DoPrint( const MultiSelection& rPageRanges,
{
PrintPage( nPageNo+nDisplayStart, nX1, nY1, nX2, nY2,
bDoPrint, pLocationData );
-
- if ( pProgress )
- {
- pProgress->SetState( nPageNo+nStartPage+1, nEndPage );
- pProgress->Reschedule(); //does the user want to continue
-
- }
++nPrinted;
}
++nPageNo;
@@ -2733,11 +2716,6 @@ long ScPrintFunc::DoPrint( const MultiSelection& rPageRanges,
if ( nNoteAdd )
{
nNoteNr += nNoteAdd;
- if ( pProgress && bPageSelected )
- {
- pProgress->SetState( nPageNo+nStartPage+1, nEndPage );
- pProgress->Reschedule(); //does the user want to continue
- }
if (bPageSelected)
{
++nPrinted;
commit b66fb4c3c5c7d1bb6543d84d425b6c4bd654fae3
Author: Eike Rathke <erack at redhat.com>
Date: Mon Nov 28 02:51:49 2011 +0100
dr78: #i115009# broadcast BCA_BRDCST_ALWAYS if paint is locked
# HG changeset patch
# User Niklas Nebel <nn at openoffice.org>
# Date 1297094234 -3600
# Node ID 9c8756a321d727b8e1bf441876ebca00f38a932f
# Parent de0464b37fb34e7b7e5735306536d9d9116cf14a
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 24daab7..9fa5769 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2647,7 +2647,9 @@ void ScDocShell::SetDocumentModified( sal_Bool bIsModified /* = sal_True */ )
if ( pPaintLockData && bIsModified )
{
- //! BCA_BRDCST_ALWAYS etc. also needed here?
+ // #i115009# broadcast BCA_BRDCST_ALWAYS, so a component can read recalculated results
+ // of RecalcModeAlways formulas (like OFFSET) after modifying cells
+ aDocument.Broadcast( SC_HINT_DATACHANGED, BCA_BRDCST_ALWAYS, NULL );
aDocument.InvalidateTableArea(); // #i105279# needed here
aDocument.BroadcastUno( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
commit 16252e44a3a1bf2414ea64455e6bf016ec5b7d04
Author: Eike Rathke <erack at redhat.com>
Date: Mon Nov 28 02:49:11 2011 +0100
dr78: #i116691# don't reduce decimals if formula is shown
# HG changeset patch
# User Niklas Nebel <nn at openoffice.org>
# Date 1297087576 -3600
# Node ID 37cf78c63d8ec7609c254e58316902d5bdb48618
# Parent 4e7aa2262f3ae26e6082f475ef06bbabf39b3e93
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 5f1e109..de1506a 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -551,9 +551,9 @@ void ScDrawStringsVars::SetTextToWidthOrHash( ScBaseCell* pCell, long nWidth )
if (eType == CELLTYPE_FORMULA)
{
ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell);
- if (pFCell->GetErrCode() != 0)
+ if (pFCell->GetErrCode() != 0 || pOutput->bShowFormulas)
{
- SetHashText(); // If the error string doesn't fit, always use "###"
+ SetHashText(); // If the error string doesn't fit, always use "###". Also for "display formulas" (#i116691#)
return;
}
// If it's formula, the result must be a value.
commit 0c428b052fa0599637497f289e57858fcca4c4e2
Author: Eike Rathke <erack at redhat.com>
Date: Mon Nov 28 02:44:36 2011 +0100
dr78: #i43040# removed german umlauts and utf8 bom accidentially added by too smart editor
# HG changeset patch
# User Daniel Rentz [dr] <daniel.rentz at oracle.com>
# Date 1295613905 -3600
# Node ID 65540563b0d1ba68bd3a9d6e3e8111c6c0e1a71d
# Parent 7c526a3a4dfa801f59eaeeea99e7b7a032bc6fe4
diff --git a/scaddins/source/analysis/bessel.cxx b/scaddins/source/analysis/bessel.cxx
index f28fa51..759008b 100644
--- a/scaddins/source/analysis/bessel.cxx
+++ b/scaddins/source/analysis/bessel.cxx
@@ -57,10 +57,10 @@ const sal_Int32 MAXITER = 100; // Maximum number of iterations.
The algorithm follows
http://www.reference-global.com/isbn/978-3-11-020354-7
Numerical Mathematics 1 / Numerische Mathematik 1,
- An algorithm-based introduction / Eine algorithmisch orientierte Einführung
+ An algorithm-based introduction / Eine algorithmisch orientierte Einfuehrung
Deuflhard, Peter; Hohmann, Andreas
Berlin, New York (Walter de Gruyter) 2008
- 4. überarb. u. erw. Aufl. 2008
+ 4. ueberarb. u. erw. Aufl. 2008
eBook ISBN: 978-3-11-020355-4
Chapter 6.3.2 , algorithm 6.24
The source is in German.
@@ -332,10 +332,10 @@ double BesselK( double fNum, sal_Int32 nOrder ) throw( IllegalArgumentException,
The algorithm for order 0 and for order 1 follows
http://www.reference-global.com/isbn/978-3-11-020354-7
Numerical Mathematics 1 / Numerische Mathematik 1,
- An algorithm-based introduction / Eine algorithmisch orientierte Einführung
+ An algorithm-based introduction / Eine algorithmisch orientierte Einfuehrung
Deuflhard, Peter; Hohmann, Andreas
Berlin, New York (Walter de Gruyter) 2008
- 4. überarb. u. erw. Aufl. 2008
+ 4. ueberarb. u. erw. Aufl. 2008
eBook ISBN: 978-3-11-020355-4
Chapter 6.3.2 , algorithm 6.24
The source is in German.
commit 5f357f97ef1539f8dab8af69e1644af6b9c4fc0a
Author: Eike Rathke <erack at redhat.com>
Date: Mon Nov 28 02:42:55 2011 +0100
dr78: #i43040# correction for BesselI, patch from Regina
# HG changeset patch
# User Daniel Rentz [dr] <daniel.rentz at oracle.com>
# Date 1295613474 -3600
# Node ID 7c526a3a4dfa801f59eaeeea99e7b7a032bc6fe4
# Parent 77c9f7fb9f061730dc584e18425f6645df14b648
diff --git a/scaddins/source/analysis/bessel.cxx b/scaddins/source/analysis/bessel.cxx
index 49ec7c3..f28fa51 100644
--- a/scaddins/source/analysis/bessel.cxx
+++ b/scaddins/source/analysis/bessel.cxx
@@ -182,31 +182,36 @@ double BesselJ( double x, sal_Int32 N ) throw (IllegalArgumentException, NoConve
I_n(x) = SUM TERM(n,k) with TERM(n,k) := --------------
k=0 k! (n+k)!
- Approximation for the BESSEL function, first kind, modified, for great x:
-
- I_n(x) ~ e^x / sqrt( 2 PI x ) for x>=0.
+ No asymptotic approximation used, see issue 43040.
*/
// ----------------------------------------------------------------------------
double BesselI( double x, sal_Int32 n ) throw( IllegalArgumentException, NoConvergenceException )
{
+ const double fEpsilon = 1.0E-15;
+ const sal_Int32 nMaxIteration = 2000;
+ const double fXHalf = x / 2.0;
if( n < 0 )
throw IllegalArgumentException();
double fResult = 0.0;
- if( fabs( x ) <= THRESHOLD )
- {
- /* Start the iteration without TERM(n,0), which is set here.
- TERM(n,0) = (x/2)^n / n!
- */
- double fTerm = pow( x / 2.0, (double)n ) / Fak( n );
- sal_Int32 nK = 1; // Start the iteration with k=1.
- fResult = fTerm; // Start result with TERM(n,0).
-
- const double fSqrX = x * x / 4.0;
+ /* Start the iteration without TERM(n,0), which is set here.
+ TERM(n,0) = (x/2)^n / n!
+ */
+ sal_Int32 nK = 0;
+ double fTerm = 1.0;
+ // avoid overflow in Fak(n)
+ for( nK = 1; nK <= n; ++nK )
+ {
+ fTerm = fTerm / static_cast< double >( nK ) * fXHalf;
+ }
+ fResult = fTerm; // Start result with TERM(n,0).
+ if( fTerm != 0.0 )
+ {
+ nK = 1;
do
{
/* Calculation of TERM(n,k) from TERM(n,k-1):
@@ -226,33 +231,13 @@ double BesselI( double x, sal_Int32 n ) throw( IllegalArgumentException, NoConve
x^2/4
= -------- TERM(n,k-1)
k(n+k)
- */
- fTerm *= fSqrX; // defined above as x^2/4
- fTerm /= (nK * (nK + n));
- fResult += fTerm;
+ */
+ fTerm = fTerm * fXHalf / static_cast<double>(nK) * fXHalf / static_cast<double>(nK+n);
+ fResult += fTerm;
+ nK++;
}
- while( (fabs( fTerm ) > MAXEPSILON) && (++nK < MAXITER) );
- }
- else
- {
- /* Approximation for the BESSEL function, first kind, modified:
-
- I_n(x) ~ e^x / sqrt( 2 PI x ) for x>=0.
-
- The BESSEL function I_n with n IN {0,2,4,...} is axially symmetric at
- x=0, means I_n(x) = I_n(-x). Therefore the approximation for x<0 is:
-
- I_n(x) = I_n(|x|) for x<0 and n IN {0,2,4,...}.
-
- The BESSEL function I_n with n IN {1,3,5,...} is point-symmetric at
- x=0, means I_n(x) = -I_n(-x). Therefore the approximation for x<0 is:
+ while( (fabs( fTerm ) > fabs(fResult) * fEpsilon) && (nK < nMaxIteration) );
- I_n(x) = -I_n(|x|) for x<0 and n IN {1,3,5,...}.
- */
- double fXAbs = fabs( x );
- fResult = exp( fXAbs ) / sqrt( f_2_PI * fXAbs );
- if( (n & 1) && (x < 0.0) )
- fResult = -fResult;
}
return fResult;
}
commit 7e8eb75aea745146d7d12df70c4f5ca8f3648ed3
Author: Eike Rathke <erack at redhat.com>
Date: Mon Nov 28 02:40:30 2011 +0100
dr78: #i116426# use ODataAccessDescriptor for database import parameters, support bookmarks for selection
# HG changeset patch
# User Niklas Nebel <nn at openoffice.org>
# Date 1294842009 -3600
# Node ID e25621ed7fd31753eea52ee5ff3f0a6d170db9a9
# Parent 5ea5624904a5aa39bb40ce197c80a0a41f40b873
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index 489b93f..b030a95 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -5438,7 +5438,7 @@ SfxUInt16Item RowHeight FID_ROW_HEIGHT
//--------------------------------------------------------------------------
SfxVoidItem SbaImport SID_SBA_IMPORT
-(SfxStringItem Query SID_SBA_IMPORT,SfxStringItem Target FN_PARAM_1)
+(SfxUsrAnyItem Query SID_SBA_IMPORT,SfxStringItem Target FN_PARAM_1)
[
/* flags: */
AutoUpdate = FALSE,
diff --git a/sc/source/ui/app/typemap.cxx b/sc/source/ui/app/typemap.cxx
index e250fec..1d4c3a0 100644
--- a/sc/source/ui/app/typemap.cxx
+++ b/sc/source/ui/app/typemap.cxx
@@ -124,6 +124,7 @@
#include <svl/aeitem.hxx>
#include <avmedia/mediaitem.hxx>
+#include <sfx2/frame.hxx>
#include "attrib.hxx"
#define SvxDrawToolItem SfxAllEnumItem
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index 623ecce..0461d2b 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -34,8 +34,9 @@
#include <sfx2/app.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/waitobj.hxx>
+#include <svx/dataaccessdescriptor.hxx>
-#include <com/sun/star/sdbc/XResultSet.hpp>
+#include <com/sun/star/sdb/CommandType.hpp>
#include "dbdocfun.hxx"
#include "sc.hrc"
@@ -60,6 +61,8 @@
#include "queryentry.hxx"
#include "markdata.hxx"
+using namespace ::com::sun::star;
+
// -----------------------------------------------------------------
bool ScDBDocFunc::AddDBRange( const ::rtl::OUString& rName, const ScRange& rRange, sal_Bool /* bApi */ )
@@ -1450,15 +1453,11 @@ sal_Bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pN
//==================================================================
//
-// Datenbank-Import...
+// database import
-void ScDBDocFunc::UpdateImport( const String& rTarget, const String& rDBName,
- const String& rTableName, const String& rStatement, bool bNative,
- sal_uInt8 nType, const ::com::sun::star::uno::Reference<
- ::com::sun::star::sdbc::XResultSet >& xResultSet,
- const std::vector<sal_Int32> *pSelection )
+void ScDBDocFunc::UpdateImport( const String& rTarget, const svx::ODataAccessDescriptor& rDescriptor )
{
- // Target ist jetzt einfach der Bereichsname
+ // rTarget is the name of a database range
ScDocument* pDoc = rDocShell.GetDocument();
ScDBCollection& rDBColl = *pDoc->GetDBCollection();
@@ -1479,15 +1478,21 @@ void ScDBDocFunc::UpdateImport( const String& rTarget, const String& rDBName,
ScImportParam aImportParam;
pData->GetImportParam( aImportParam );
- bool bSql = (rStatement.Len() != 0);
-
- aImportParam.aDBName = rDBName;
- aImportParam.bSql = bSql;
- aImportParam.aStatement = bSql ? rStatement : rTableName;
- aImportParam.bNative = bNative;
- aImportParam.nType = nType;
+ rtl::OUString sDBName;
+ rtl::OUString sDBTable;
+ sal_Int32 nCommandType = 0;
+ rDescriptor[svx::daDataSource] >>= sDBName;
+ rDescriptor[svx::daCommand] >>= sDBTable;
+ rDescriptor[svx::daCommandType] >>= nCommandType;
+
+ aImportParam.aDBName = sDBName;
+ aImportParam.bSql = ( nCommandType == sdb::CommandType::COMMAND );
+ aImportParam.aStatement = sDBTable;
+ aImportParam.bNative = false;
+ aImportParam.nType = static_cast<sal_uInt8>( ( nCommandType == sdb::CommandType::QUERY ) ? ScDbQuery : ScDbTable );
aImportParam.bImport = true;
- bool bContinue = DoImport( nTab, aImportParam, xResultSet, pSelection, sal_True );
+
+ bool bContinue = DoImport( nTab, aImportParam, &rDescriptor, true );
// DB-Operationen wiederholen
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index 5ccd9ef..829d36e 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -42,6 +42,7 @@
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XRowSet.hpp>
#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
+#include <com/sun/star/sdbcx/XRowLocate.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
@@ -63,6 +64,7 @@
#include "dbdocutl.hxx"
#include "editable.hxx"
#include "hints.hxx"
+#include "miscuno.hxx"
#include "chgtrack.hxx"
using namespace com::sun::star;
@@ -119,99 +121,22 @@ void ScDBDocFunc::ShowInBeamer( const ScImportParam& rParam, SfxViewFrame* pFram
bool ScDBDocFunc::DoImportUno( const ScAddress& rPos,
const uno::Sequence<beans::PropertyValue>& aArgs )
{
- bool bDone = false;
+ svx::ODataAccessDescriptor aDesc( aArgs ); // includes selection and result set
- ScImportParam aImParam;
- aImParam.nCol1 = aImParam.nCol2 = rPos.Col();
- aImParam.nRow1 = aImParam.nRow2 = rPos.Row();
- aImParam.bImport = true;
+ // create database range
+ ScDBData* pDBData = rDocShell.GetDBData( ScRange(rPos), SC_DB_IMPORT, SC_DBSEL_KEEP );
+ DBG_ASSERT(pDBData, "can't create DB data");
+ String sTarget = pDBData->GetName();
- uno::Reference<sdbc::XResultSet> xResSet;
- uno::Sequence<uno::Any> aSelection;
-
- rtl::OUString aStrVal;
- const beans::PropertyValue* pPropArray = aArgs.getConstArray();
- long nPropCount = aArgs.getLength();
- long i;
- for (i = 0; i < nPropCount; i++)
- {
- const beans::PropertyValue& rProp = pPropArray[i];
- String aPropName = rProp.Name;
-
- if ( aPropName.EqualsAscii( SC_DBPROP_DATASOURCENAME ))
- {
- if ( rProp.Value >>= aStrVal )
- aImParam.aDBName = aStrVal;
- }
- else if ( aPropName.EqualsAscii( SC_DBPROP_COMMAND ))
- {
- if ( rProp.Value >>= aStrVal )
- aImParam.aStatement = aStrVal;
- }
- else if ( aPropName.EqualsAscii( SC_DBPROP_COMMANDTYPE ))
- {
- sal_Int32 nType = 0;
- if ( rProp.Value >>= nType )
- {
- aImParam.bSql = ( nType == sdb::CommandType::COMMAND );
- aImParam.nType = sal::static_int_cast<sal_uInt8>( ( nType == sdb::CommandType::QUERY ) ? ScDbQuery : ScDbTable );
- // nType is ignored if bSql is set
- }
- }
- else if ( aPropName.EqualsAscii( SC_DBPROP_SELECTION ))
- {
- rProp.Value >>= aSelection;
- }
- else if ( aPropName.EqualsAscii( SC_DBPROP_CURSOR ))
- {
- rProp.Value >>= xResSet;
- }
- }
-
- std::vector<sal_Int32> aList;
- long nSelLen = aSelection.getLength();
- for (i = 0; i < nSelLen; i++)
- {
- sal_Int32 nEntry = 0;
- if ( aSelection[i] >>= nEntry )
- aList.push_back( nEntry );
- }
-
- bool bAddrInsert = false; //!???
- if ( bAddrInsert )
- {
- bDone = DoImport( rPos.Tab(), aImParam, xResSet, &aList, sal_True, bAddrInsert );
- }
- else
- {
- // create database range
- //! merge this with SID_SBA_IMPORT execute in docsh4.cxx
-
- ScDBData* pDBData = rDocShell.GetDBData( ScRange(rPos), SC_DB_IMPORT, SC_DBSEL_KEEP );
- OSL_ENSURE(pDBData, "can't create DB data");
- String sTarget = pDBData->GetName();
-
- //! change UpdateImport to use only one of rTableName, rStatement
-
- String aTableName, aStatement;
- if ( aImParam.bSql )
- aStatement = aImParam.aStatement;
- else
- aTableName = aImParam.aStatement;
+ UpdateImport( sTarget, aDesc );
- UpdateImport( sTarget, aImParam.aDBName, aTableName, aStatement,
- aImParam.bNative, aImParam.nType, xResSet, &aList );
- bDone = true;
- }
-
- return bDone;
+ return true;
}
// -----------------------------------------------------------------
bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
- const uno::Reference< sdbc::XResultSet >& xResultSet,
- const std::vector<sal_Int32> *pSelection, bool bRecord, bool bAddrInsert )
+ const svx::ODataAccessDescriptor* pDescriptor, bool bRecord, bool bAddrInsert )
{
ScDocument* pDoc = rDocShell.GetDocument();
ScChangeTrack *pChangeTrack = NULL;
@@ -251,17 +176,34 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
sal_Bool bDoSelection = false;
sal_Bool bRealSelection = false; // sal_True if not everything is selected
- sal_uLong nListPos = 0;
- sal_uLong nRowsRead = 0;
- sal_uLong nListCount = 0;
+ sal_Bool bBookmarkSelection = sal_False;
+ sal_Int32 nListPos = 0;
+ sal_Int32 nRowsRead = 0;
+ sal_Int32 nListCount = 0;
- // -1 is special
- if ( !pSelection->empty() && (*pSelection)[0] != -1 )
+ uno::Sequence<uno::Any> aSelection;
+ if ( pDescriptor && pDescriptor->has(svx::daSelection) )
{
- bDoSelection = sal_True;
- nListCount = pSelection->size();
+ (*pDescriptor)[svx::daSelection] >>= aSelection;
+ nListCount = aSelection.getLength();
+ if ( nListCount > 0 )
+ {
+ bDoSelection = true;
+ if ( pDescriptor->has(svx::daBookmarkSelection) )
+ bBookmarkSelection = ScUnoHelpFunctions::GetBoolFromAny( (*pDescriptor)[svx::daBookmarkSelection] );
+ if ( bBookmarkSelection )
+ {
+ // From bookmarks, there's no way to detect if all records are selected.
+ // Rely on base to pass no selection in that case.
+ bRealSelection = true;
+ }
+ }
}
+ uno::Reference<sdbc::XResultSet> xResultSet;
+ if ( pDescriptor && pDescriptor->has(svx::daCursor) )
+ xResultSet.set((*pDescriptor)[svx::daCursor], uno::UNO_QUERY);
+
// ImportDoc - also used for Redo
ScDocument* pImportDoc = new ScDocument( SCDOCMODE_UNDO );
pImportDoc->InitUndo( pDoc, nTab, nTab );
@@ -345,6 +287,17 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
//! error message
}
+ uno::Reference<sdbcx::XRowLocate> xLocate;
+ if ( bBookmarkSelection )
+ {
+ xLocate.set( xRowSet, uno::UNO_QUERY );
+ if ( !xLocate.is() )
+ {
+ DBG_ERRORFILE("can't get XRowLocate");
+ bDoSelection = bRealSelection = bBookmarkSelection = sal_False;
+ }
+ }
+
uno::Reference<sdbc::XRow> xRow( xRowSet, uno::UNO_QUERY );
if ( nColCount > 0 && xRow.is() )
{
@@ -388,16 +341,25 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
{
if (nListPos < nListCount)
{
- sal_uInt32 nNextRow = (*pSelection)[nListPos];
- if ( nRowsRead+1 < nNextRow )
- bRealSelection = sal_True;
- bEnd = !xRowSet->absolute(nRowsRead = nNextRow);
+ if ( bBookmarkSelection )
+ {
+ bEnd = !xLocate->moveToBookmark(aSelection[nListPos]);
+ }
+ else // use record numbers
+ {
+ sal_Int32 nNextRow = 0;
+ aSelection[nListPos] >>= nNextRow;
+ if ( nRowsRead+1 < nNextRow )
+ bRealSelection = true;
+ bEnd = !xRowSet->absolute(nRowsRead = nNextRow);
+ }
++nListPos;
}
else
{
- bRealSelection = xRowSet->next();
- bEnd = sal_True; // more data available but not used
+ if ( !bBookmarkSelection && xRowSet->next() )
+ bRealSelection = true; // more data available but not used
+ bEnd = true;
}
}
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 39fae9c..1fbaa78 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -30,7 +30,7 @@
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
-
+
using namespace ::com::sun::star;
@@ -56,6 +56,7 @@ using namespace ::com::sun::star;
#include <vcl/msgbox.hxx>
#include <vcl/waitobj.hxx>
#include <tools/multisel.hxx>
+#include <svx/dataaccessdescriptor.hxx>
#include <svx/drawitem.hxx>
#include <svx/fmview.hxx>
#include <svx/pageitem.hxx>
@@ -193,19 +194,21 @@ void ScDocShell::Execute( SfxRequest& rReq )
}
break;
-
- // SID_SBA_QRY_CHANGETARGET gibts nicht mehr - auch in idl raus
-
case SID_SBA_IMPORT:
{
if (pReqArgs)
{
- const sal_Unicode cSbaSep = 11; // Trennzeichen
-
const SfxPoolItem* pItem;
- String sSbaData, sTarget;
- if ( pReqArgs->GetItemState( nSlot, sal_True, &pItem ) == SFX_ITEM_SET )
- sSbaData = ((const SfxStringItem*)pItem)->GetValue();
+ svx::ODataAccessDescriptor aDesc;
+ if ( pReqArgs->GetItemState( nSlot, true, &pItem ) == SFX_ITEM_SET )
+ {
+ uno::Any aAny = static_cast<const SfxUsrAnyItem*>(pItem)->GetValue();
+ uno::Sequence<beans::PropertyValue> aProperties;
+ if ( aAny >>= aProperties )
+ aDesc.initializeFrom( aProperties );
+ }
+
+ String sTarget;
if ( pReqArgs->GetItemState( FN_PARAM_1, sal_True, &pItem ) == SFX_ITEM_SET )
sTarget = ((const SfxStringItem*)pItem)->GetValue();
@@ -213,33 +216,6 @@ void ScDocShell::Execute( SfxRequest& rReq )
if ( pReqArgs->GetItemState( FN_PARAM_2, sal_True, &pItem ) == SFX_ITEM_SET )
bIsNewArea = ((const SfxBoolItem*)pItem)->GetValue();
- ::com::sun::star::uno::Reference<
- ::com::sun::star::sdbc::XResultSet > xResultSet;
- if ( pReqArgs->GetItemState( FN_PARAM_3, false, &pItem ) == SFX_ITEM_SET && pItem )
- xResultSet.set(((const SfxUsrAnyItem*)pItem)->GetValue(),::com::sun::star::uno::UNO_QUERY);
-
- String sDBName = sSbaData.GetToken(0,cSbaSep); // Datenbankname
- String sDBTable = sSbaData.GetToken(1,cSbaSep); // Tabellen- oder Query-Name
- String sTabFlag = sSbaData.GetToken(2,cSbaSep);
- String sDBSql = sSbaData.GetToken(3,cSbaSep); // SQL im Klartext
-
- sal_uInt8 nType = ScDbTable; // "0" oder "1"
- if ( sTabFlag.EqualsAscii("0") ) // "0" = Query, "1" = Table (Default)
- nType = ScDbQuery;
-
- std::vector<sal_Int32> aSelectionList;
- xub_StrLen nCount = sSbaData.GetTokenCount(cSbaSep);
-
- for (xub_StrLen i = 4; i < nCount; i++)
- {
- String aSelItem = sSbaData.GetToken(i,cSbaSep);
- if (aSelItem.Len())
- {
- sal_uInt32 nValue = aSelItem.ToInt32();
- aSelectionList.push_back(nValue);
- }
- }
-
// bei Bedarf neuen Datenbankbereich anlegen
bool bMakeArea = false;
if (bIsNewArea)
@@ -279,9 +255,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
if (bDo)
{
- ScDBDocFunc(*this).UpdateImport( sTarget, sDBName,
- sDBTable, sDBSql, true, nType, xResultSet,
- &aSelectionList );
+ ScDBDocFunc(*this).UpdateImport( sTarget, aDesc );
rReq.Done();
// UpdateImport aktualisiert auch die internen Operationen
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index 28948b9..d053561 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -40,7 +40,6 @@
#include <sfx2/bindings.hxx>
#include <svl/smplhint.hxx>
-#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/script/vba/XVBACompatibility.hpp>
// INCLUDE ---------------------------------------------------------------
@@ -1014,8 +1013,7 @@ IMPL_LINK( ScDocShell, RefreshDBDataHdl, ScRefreshTimer*, pRefreshTimer )
{
ScRange aRange;
pDBData->GetArea( aRange );
- Reference< ::com::sun::star::sdbc::XResultSet> xResultSet;
- bContinue = aFunc.DoImport( aRange.aStart.Tab(), aImportParam, xResultSet, NULL, true, false ); //! Api-Flag as parameter
+ bContinue = aFunc.DoImport( aRange.aStart.Tab(), aImportParam, NULL, true, false ); //! Api-Flag as parameter
// internal operations (sort, query, subtotal) only if no error
if (bContinue)
{
diff --git a/sc/source/ui/inc/dbdocfun.hxx b/sc/source/ui/inc/dbdocfun.hxx
index ac0ed58..83996cc 100644
--- a/sc/source/ui/inc/dbdocfun.hxx
+++ b/sc/source/ui/inc/dbdocfun.hxx
@@ -41,7 +41,6 @@ struct ScSortParam;
struct ScSubTotalParam;
class SfxViewFrame;
-class SbaSelectionList;
class ScDBData;
class ScDocShell;
class ScAddress;
@@ -52,11 +51,12 @@ namespace com { namespace sun { namespace star {
namespace beans {
struct PropertyValue;
}
- namespace sdbc {
- class XResultSet;
- }
} } }
+namespace svx {
+ class ODataAccessDescriptor;
+}
+
class ScDBDocFunc
{
friend class ScDBFunc;
@@ -68,16 +68,11 @@ public:
ScDBDocFunc( ScDocShell& rDocSh ): rDocShell(rDocSh) {}
~ScDBDocFunc() {}
- void UpdateImport( const String& rTarget, const String& rDBName,
- const String& rTableName, const String& rStatement,
- bool bNative, sal_uInt8 nType,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::sdbc::XResultSet >& xResultSet,
- const std::vector<sal_Int32> *pSelection );
+ void UpdateImport( const String& rTarget, const svx::ODataAccessDescriptor& rDescriptor );
bool DoImport( SCTAB nTab, const ScImportParam& rParam,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& xResultSet,
- const std::vector<sal_Int32> *pSelection, bool bRecord,
+ const svx::ODataAccessDescriptor* pDescriptor, // used for selection and existing ResultSet
+ bool bRecord,
bool bAddrInsert = false );
bool DoImportUno( const ScAddress& rPos,
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 4c21708..fc90a3a 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -5911,12 +5911,11 @@ void SAL_CALL ScCellRangeObj::doImport( const uno::Sequence<beans::PropertyValue
aParam.nRow2 = aRange.aEnd.Row();
//! TODO: could we get passed a valid result set by any means?
- uno::Reference< sdbc::XResultSet > xResultSet;
pDocSh->GetDBData( aRange, SC_DB_MAKE, SC_DBSEL_FORCE_MARK ); // ggf. Bereich anlegen
ScDBDocFunc aFunc(*pDocSh); // Bereich muss angelegt sein
- aFunc.DoImport( nTab, aParam, xResultSet, NULL, sal_True, false ); //! Api-Flag als Parameter
+ aFunc.DoImport( nTab, aParam, NULL, true ); //! Api-Flag as parameter
}
}
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 3172d26..5b10f13 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -1850,8 +1850,7 @@ void SAL_CALL ScDatabaseRangeObj::refresh() throw(uno::RuntimeException)
SCCOL nDummyCol;
SCROW nDummyRow;
pData->GetArea( nTab, nDummyCol,nDummyRow,nDummyCol,nDummyRow );
- uno::Reference< sdbc::XResultSet > xResultSet;
- bContinue = aFunc.DoImport( nTab, aImportParam, xResultSet, NULL, sal_True, false ); //! Api-Flag als Parameter
+ bContinue = aFunc.DoImport( nTab, aImportParam, NULL, true ); //! Api-Flag as parameter
}
// interne Operationen (sort, query, subtotal) nur, wenn kein Fehler
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index b401465..5979ea0 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -517,8 +517,7 @@ sal_Bool ScDBFunc::ImportData( const ScImportParam& rParam, sal_Bool bRecord )
}
ScDBDocFunc aDBDocFunc( *GetViewData()->GetDocShell() );
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > xResultSet;
- return aDBDocFunc.DoImport( GetViewData()->GetTabNo(), rParam, xResultSet, NULL, bRecord );
+ return aDBDocFunc.DoImport( GetViewData()->GetTabNo(), rParam, NULL, bRecord );
}
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index 89f00c8..eae1329 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -373,10 +373,15 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
{
// import of database data into table
- String sDataDesc;
- if ( aDataHelper.GetString( nFormatId, sDataDesc ) )
+ const DataFlavorExVector& rVector = aDataHelper.GetDataFlavorExVector();
+ if ( svx::ODataAccessObjectTransferable::canExtractObjectDescriptor(rVector) )
{
- SfxStringItem aDataDesc(SID_SBA_IMPORT, sDataDesc);
+ // transport the whole ODataAccessDescriptor as slot parameter
+ svx::ODataAccessDescriptor aDesc = svx::ODataAccessObjectTransferable::extractObjectDescriptor(aDataHelper);
+ uno::Any aDescAny;
+ uno::Sequence<beans::PropertyValue> aProperties = aDesc.createPropertyValueSequence();
+ aDescAny <<= aProperties;
+ SfxUsrAnyItem aDataDesc(SID_SBA_IMPORT, aDescAny);
ScDocShell* pDocSh = GetViewData()->GetDocShell();
SCTAB nTab = GetViewData()->GetTabNo();
@@ -400,20 +405,10 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
sal_Bool bAreaIsNew = !pDBData;
SfxBoolItem aAreaNew(FN_PARAM_2, bAreaIsNew);
- ::svx::ODataAccessDescriptor aDesc;
- DataFlavorExVector& rVector = aDataHelper.GetDataFlavorExVector();
- ::std::auto_ptr<SfxUsrAnyItem> pCursorItem;
- if ( ::svx::ODataAccessObjectTransferable::canExtractObjectDescriptor(rVector) )
- {
- aDesc = ::svx::ODataAccessObjectTransferable::extractObjectDescriptor(aDataHelper);
- if ( aDesc.has(::svx::daCursor) )
- pCursorItem.reset(new SfxUsrAnyItem(FN_PARAM_3, aDesc[::svx::daCursor]));
- }
-
// asynchronous, to avoid doing the whole import in drop handler
SfxDispatcher& rDisp = GetViewData()->GetDispatcher();
rDisp.Execute(SID_SBA_IMPORT, SFX_CALLMODE_ASYNCHRON,
- &aDataDesc, &aTarget, &aAreaNew, pCursorItem.get(), (void*)0 );
+ &aDataDesc, &aTarget, &aAreaNew, (void*)0 );
bRet = sal_True;
}
commit 6b0c4cd205ee5134765955024cd727f1a23f2c24
Author: Eike Rathke <erack at redhat.com>
Date: Mon Nov 28 00:32:54 2011 +0100
dr78: #i71810# rework import of fill bitmap mode: ignore CHPICFORMAT record except for bar chart series/points and for 3D walls/floor
# HG changeset patch
# User Daniel Rentz [dr] <daniel.rentz at oracle.com>
# Date 1292431407 -3600
# Node ID bfc09856a08ece3043973bdb484f0fd51bbc91f2
# Parent 90e08c2834a1fd8b5b783240a9d181749871bd7a
diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index 41f8fac..bebe08c 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -718,7 +718,7 @@ bool XclExpChEscherFormat::HasSubRecords() const
void XclExpChEscherFormat::WriteSubRecords( XclExpStream& rStrm )
{
rStrm.StartRecord( EXC_ID_CHPICFORMAT, 14 );
- rStrm << maPicFmt.mnBmpMode << maPicFmt.mnFormat << maPicFmt.mnFlags << maPicFmt.mfScale;
+ rStrm << maPicFmt.mnBmpMode << sal_uInt16( 0 ) << maPicFmt.mnFlags << maPicFmt.mfScale;
rStrm.EndRecord();
}
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index a568ef2..5ae9215 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -375,12 +375,12 @@ void XclImpChRoot::ConvertAreaFormat( ScfPropertySet& rPropSet,
}
void XclImpChRoot::ConvertEscherFormat( ScfPropertySet& rPropSet,
- const XclChEscherFormat& rEscherFmt, const XclChPicFormat& rPicFmt,
- XclChPropertyMode ePropMode ) const
+ const XclChEscherFormat& rEscherFmt, const XclChPicFormat* pPicFmt,
+ sal_uInt32 nDffFillType, XclChPropertyMode ePropMode ) const
{
GetChartPropSetHelper().WriteEscherProperties( rPropSet,
*mxChData->mxGradientTable, *mxChData->mxHatchTable, *mxChData->mxBitmapTable,
- rEscherFmt, rPicFmt, ePropMode );
+ rEscherFmt, pPicFmt, nDffFillType, ePropMode );
}
void XclImpChRoot::ConvertFont( ScfPropertySet& rPropSet,
@@ -528,7 +528,8 @@ void XclImpChAreaFormat::Convert( const XclImpChRoot& rRoot,
// ----------------------------------------------------------------------------
-XclImpChEscherFormat::XclImpChEscherFormat( const XclImpRoot& rRoot )
+XclImpChEscherFormat::XclImpChEscherFormat( const XclImpRoot& rRoot ) :
+ mnDffFillType( mso_fillSolid )
{
maData.mxItemSet.reset(
new SfxItemSet( rRoot.GetDoc().GetDrawLayer()->GetItemPool() ) );
@@ -542,9 +543,8 @@ void XclImpChEscherFormat::ReadHeaderRecord( XclImpStream& rStrm )
rStrm >> aPropSet;
// get the data
aPropSet.FillToItemSet( *maData.mxItemSet );
- // get bitmap mode from DFF item set
- sal_uInt32 nType = aPropSet.GetPropertyValue( DFF_Prop_fillType, mso_fillSolid );
- maPicFmt.mnBmpMode = (nType == mso_fillPicture) ? EXC_CHPICFORMAT_STRETCH : EXC_CHPICFORMAT_STACK;
+ // get fill type from DFF property set
+ mnDffFillType = aPropSet.GetPropertyValue( DFF_Prop_fillType, mso_fillSolid );
}
void XclImpChEscherFormat::ReadSubRecord( XclImpStream& rStrm )
@@ -552,16 +552,18 @@ void XclImpChEscherFormat::ReadSubRecord( XclImpStream& rStrm )
switch( rStrm.GetRecId() )
{
case EXC_ID_CHPICFORMAT:
- rStrm >> maPicFmt.mnBmpMode >> maPicFmt.mnFormat >> maPicFmt.mnFlags >> maPicFmt.mfScale;
+ rStrm >> maPicFmt.mnBmpMode;
+ rStrm.Ignore( 2 );
+ rStrm >> maPicFmt.mnFlags >> maPicFmt.mfScale;
break;
}
}
void XclImpChEscherFormat::Convert( const XclImpChRoot& rRoot,
- ScfPropertySet& rPropSet, XclChObjectType eObjType ) const
+ ScfPropertySet& rPropSet, XclChObjectType eObjType, bool bUsePicFmt ) const
{
const XclChFormatInfo& rFmtInfo = rRoot.GetFormatInfo( eObjType );
- rRoot.ConvertEscherFormat( rPropSet, maData, maPicFmt, rFmtInfo.mePropMode );
+ rRoot.ConvertEscherFormat( rPropSet, maData, bUsePicFmt ? &maPicFmt : 0, mnDffFillType, rFmtInfo.mePropMode );
}
// ----------------------------------------------------------------------------
@@ -622,23 +624,23 @@ void XclImpChFrameBase::ConvertLineBase( const XclImpChRoot& rRoot,
}
void XclImpChFrameBase::ConvertAreaBase( const XclImpChRoot& rRoot,
- ScfPropertySet& rPropSet, XclChObjectType eObjType, sal_uInt16 nFormatIdx ) const
+ ScfPropertySet& rPropSet, XclChObjectType eObjType, sal_uInt16 nFormatIdx, bool bUsePicFmt ) const
{
if( rRoot.GetFormatInfo( eObjType ).mbIsFrame )
{
// CHESCHERFORMAT overrides CHAREAFORMAT (even if it is auto)
if( mxEscherFmt )
- mxEscherFmt->Convert( rRoot, rPropSet, eObjType );
+ mxEscherFmt->Convert( rRoot, rPropSet, eObjType, bUsePicFmt );
else if( mxAreaFmt )
mxAreaFmt->Convert( rRoot, rPropSet, eObjType, nFormatIdx );
}
}
void XclImpChFrameBase::ConvertFrameBase( const XclImpChRoot& rRoot,
- ScfPropertySet& rPropSet, XclChObjectType eObjType, sal_uInt16 nFormatIdx ) const
+ ScfPropertySet& rPropSet, XclChObjectType eObjType, sal_uInt16 nFormatIdx, bool bUsePicFmt ) const
{
ConvertLineBase( rRoot, rPropSet, eObjType, nFormatIdx );
- ConvertAreaBase( rRoot, rPropSet, eObjType, nFormatIdx );
+ ConvertAreaBase( rRoot, rPropSet, eObjType, nFormatIdx, bUsePicFmt );
}
// ----------------------------------------------------------------------------
@@ -701,9 +703,9 @@ void XclImpChFrame::UpdateObjFrame( const XclObjLineData& rLineData, const XclOb
}
}
-void XclImpChFrame::Convert( ScfPropertySet& rPropSet ) const
+void XclImpChFrame::Convert( ScfPropertySet& rPropSet, bool bUsePicFmt ) const
{
- ConvertFrameBase( GetChRoot(), rPropSet, meObjType );
+ ConvertFrameBase( GetChRoot(), rPropSet, meObjType, EXC_CHDATAFORMAT_UNKNOWN, bUsePicFmt );
}
// Source links ===============================================================
@@ -1537,8 +1539,15 @@ void XclImpChDataFormat::UpdateTrendLineFormat()
void XclImpChDataFormat::Convert( ScfPropertySet& rPropSet, const XclChExtTypeInfo& rTypeInfo ) const
{
- // line and area format
- ConvertFrameBase( GetChRoot(), rPropSet, rTypeInfo.GetSeriesObjectType(), maData.mnFormatIdx );
+ /* Line and area format.
+ #i71810# If the data points are filled with bitmaps, textures, or
+ patterns, then only bar charts will use the CHPICFORMAT record to
+ determine stacking/streching mode. All other chart types ignore this
+ record and always use the property 'fill-type' from the DFF property
+ set (streched for bitmaps, and stacked for textures and patterns). */
+ bool bUsePicFmt = rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_BAR;
+ ConvertFrameBase( GetChRoot(), rPropSet, rTypeInfo.GetSeriesObjectType(), maData.mnFormatIdx, bUsePicFmt );
+
#if EXC_CHART2_3DBAR_HAIRLINES_ONLY
// #i83151# only hair lines in 3D charts with filled data points
if( rTypeInfo.mb3dChart && rTypeInfo.IsSeriesFrameFormat() && mxLineFmt && mxLineFmt->HasLine() )
@@ -1570,9 +1579,9 @@ void XclImpChDataFormat::ConvertLine( ScfPropertySet& rPropSet, XclChObjectType
ConvertLineBase( GetChRoot(), rPropSet, eObjType );
}
-void XclImpChDataFormat::ConvertArea( ScfPropertySet& rPropSet, sal_uInt16 nFormatIdx ) const
+void XclImpChDataFormat::ConvertArea( ScfPropertySet& rPropSet, sal_uInt16 nFormatIdx, bool bUsePicFmt ) const
{
- ConvertAreaBase( GetChRoot(), rPropSet, EXC_CHOBJTYPE_FILLEDSERIES, nFormatIdx );
+ ConvertAreaBase( GetChRoot(), rPropSet, EXC_CHOBJTYPE_FILLEDSERIES, nFormatIdx, bUsePicFmt );
}
void XclImpChDataFormat::RemoveUnusedFormats( const XclChExtTypeInfo& rTypeInfo )
@@ -2020,7 +2029,7 @@ Reference< XDataSeries > XclImpChSeries::CreateDataSeries() const
for( sal_uInt16 nPointIdx = 0, nPointCount = mxValueLink->GetCellCount(); nPointIdx < nPointCount; ++nPointIdx )
{
ScfPropertySet aPointProp = lclGetPointPropSet( xDataSeries, nPointIdx );
- mxSeriesFmt->ConvertArea( aPointProp, bVarPointFmt ? nPointIdx : mnSeriesIdx );
+ mxSeriesFmt->ConvertArea( aPointProp, bVarPointFmt ? nPointIdx : mnSeriesIdx, false );
}
}
@@ -3394,8 +3403,9 @@ Reference< XAxis > XclImpChAxis::CreateAxis( const XclImpChTypeGroup& rTypeGroup
void XclImpChAxis::ConvertWall( ScfPropertySet& rPropSet ) const
{
+ // #i71810# walls and floor in 3D charts use the CHPICFORMAT record for bitmap mode
if( mxWallFrame )
- mxWallFrame->Convert( rPropSet );
+ mxWallFrame->Convert( rPropSet, true );
}
void XclImpChAxis::ConvertAxisPosition( ScfPropertySet& rPropSet, const XclImpChTypeGroup& rTypeGroup ) const
diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx
index 6eb00bf..26edb4d 100644
--- a/sc/source/filter/excel/xlchart.cxx
+++ b/sc/source/filter/excel/xlchart.cxx
@@ -147,8 +147,7 @@ XclChEscherFormat::~XclChEscherFormat()
XclChPicFormat::XclChPicFormat() :
mnBmpMode( EXC_CHPICFORMAT_NONE ),
- mnFormat( EXC_CHPICFORMAT_DEFAULT ),
- mnFlags( EXC_CHPICFORMAT_DEFAULTFLAGS ),
+ mnFlags( EXC_CHPICFORMAT_TOPBOTTOM | EXC_CHPICFORMAT_FRONTBACK | EXC_CHPICFORMAT_LEFTRIGHT ),
mfScale( 0.5 )
{
}
@@ -548,7 +547,7 @@ static const XclChTypeInfo spTypeInfos[] =
{ EXC_CHTYPEID_RADARLINE, EXC_CHTYPECATEG_RADAR, EXC_ID_CHRADARLINE, SERVICE_CHART2_NET, EXC_CHVARPOINT_SINGLE, csscd::TOP, false, false, true, false, true, false, true, false, false, false, false },
{ EXC_CHTYPEID_RADARAREA, EXC_CHTYPECATEG_RADAR, EXC_ID_CHRADARAREA, SERVICE_CHART2_FILLEDNET, EXC_CHVARPOINT_NONE, csscd::TOP, false, false, true, true, true, false, true, false, false, true, false },
{ EXC_CHTYPEID_PIE, EXC_CHTYPECATEG_PIE, EXC_ID_CHPIE, SERVICE_CHART2_PIE, EXC_CHVARPOINT_MULTI, csscd::AVOID_OVERLAP, false, true, true, true, true, true, true, false, false, false, false },
- { EXC_CHTYPEID_DONUT, EXC_CHTYPECATEG_PIE, EXC_ID_CHPIE, SERVICE_CHART2_PIE, EXC_CHVARPOINT_MULTI, csscd::AVOID_OVERLAP, false, true, true, true, true, false, true, false, false, true, false },
+ { EXC_CHTYPEID_DONUT, EXC_CHTYPECATEG_PIE, EXC_ID_CHPIE, SERVICE_CHART2_PIE, EXC_CHVARPOINT_MULTI, csscd::AVOID_OVERLAP, false, true, true, true, true, false, true, false, false, false, false },
{ EXC_CHTYPEID_PIEEXT, EXC_CHTYPECATEG_PIE, EXC_ID_CHPIEEXT, SERVICE_CHART2_PIE, EXC_CHVARPOINT_MULTI, csscd::AVOID_OVERLAP, false, false, true, true, true, true, true, false, false, false, false },
{ EXC_CHTYPEID_SCATTER, EXC_CHTYPECATEG_SCATTER, EXC_ID_CHSCATTER, SERVICE_CHART2_SCATTER, EXC_CHVARPOINT_SINGLE, csscd::RIGHT, true, false, false, false, true, false, false, false, false, false, false },
{ EXC_CHTYPEID_BUBBLES, EXC_CHTYPECATEG_SCATTER, EXC_ID_CHSCATTER, SERVICE_CHART2_BUBBLE, EXC_CHVARPOINT_SINGLE, csscd::RIGHT, false, false, false, true, true, false, false, false, false, false, false },
@@ -1076,8 +1075,8 @@ void XclChPropSetHelper::WriteAreaProperties( ScfPropertySet& rPropSet,
void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet,
XclChObjectTable& rGradientTable, XclChObjectTable& /*rHatchTable*/, XclChObjectTable& rBitmapTable,
- const XclChEscherFormat& rEscherFmt, const XclChPicFormat& rPicFmt,
- XclChPropertyMode ePropMode )
+ const XclChEscherFormat& rEscherFmt, const XclChPicFormat* pPicFmt,
+ sal_uInt32 nDffFillType, XclChPropertyMode ePropMode )
{
if( rEscherFmt.mxItemSet )
{
@@ -1127,8 +1126,10 @@ void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet,
if( aBmpName.getLength() )
{
namespace cssd = ::com::sun::star::drawing;
- cssd::BitmapMode eApiBmpMode = (rPicFmt.mnBmpMode == EXC_CHPICFORMAT_STRETCH) ?
- cssd::BitmapMode_STRETCH : cssd::BitmapMode_REPEAT;
+ /* #i71810# Caller decides whether to use a CHPICFORMAT record for bitmap mode.
+ If not passed, detect fill mode from the DFF property 'fill-type'. */
+ bool bStretch = pPicFmt ? (pPicFmt->mnBmpMode == EXC_CHPICFORMAT_STRETCH) : (nDffFillType == mso_fillPicture);
+ cssd::BitmapMode eApiBmpMode = bStretch ? cssd::BitmapMode_STRETCH : cssd::BitmapMode_REPEAT;
maBitmapHlp.InitializeWrite();
maBitmapHlp << cssd::FillStyle_BITMAP << aBmpName << eApiBmpMode;
maBitmapHlp.WriteToPropertySet( rPropSet );
diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx
index 83716c4..08f7813 100644
--- a/sc/source/filter/inc/xichart.hxx
+++ b/sc/source/filter/inc/xichart.hxx
@@ -161,7 +161,8 @@ public:
void ConvertEscherFormat(
ScfPropertySet& rPropSet,
const XclChEscherFormat& rEscherFmt,
- const XclChPicFormat& rPicFmt,
+ const XclChPicFormat* pPicFmt,
+ sal_uInt32 nDffFillType,
XclChPropertyMode ePropMode ) const;
/** Writes font properties to the passed property set. */
void ConvertFont(
@@ -302,12 +303,13 @@ public:
virtual void ReadSubRecord( XclImpStream& rStrm );
/** Converts and writes the contained data to the passed property set. */
- void Convert( const XclImpChRoot& rRoot,
- ScfPropertySet& rPropSet, XclChObjectType eObjType ) const;
+ void Convert( const XclImpChRoot& rRoot, ScfPropertySet& rPropSet,
+ XclChObjectType eObjType, bool bUsePicFmt ) const;
private:
XclChEscherFormat maData; /// Fill properties for complex areas (CHESCHERFORMAT record).
XclChPicFormat maPicFmt; /// Image options, e.g. stretched, stacked (CHPICFORMAT record).
+ sal_uInt32 mnDffFillType; /// Fill type imported from the DFF property set.
};
typedef boost::shared_ptr< XclImpChEscherFormat > XclImpChEscherFormatRef;
@@ -351,11 +353,11 @@ protected:
/** Converts and writes the contained area formatting to the passed property set. */
void ConvertAreaBase( const XclImpChRoot& rRoot,
ScfPropertySet& rPropSet, XclChObjectType eObjType,
- sal_uInt16 nFormatIdx = EXC_CHDATAFORMAT_UNKNOWN ) const;
+ sal_uInt16 nFormatIdx = EXC_CHDATAFORMAT_UNKNOWN, bool bUsePicFmt = false ) const;
/** Converts and writes the contained data to the passed property set. */
void ConvertFrameBase( const XclImpChRoot& rRoot,
ScfPropertySet& rPropSet, XclChObjectType eObjType,
- sal_uInt16 nFormatIdx = EXC_CHDATAFORMAT_UNKNOWN ) const;
+ sal_uInt16 nFormatIdx = EXC_CHDATAFORMAT_UNKNOWN, bool bUsePicFmt = false ) const;
protected:
XclImpChLineFormatRef mxLineFmt; /// Line format (CHLINEFORMAT record).
@@ -385,7 +387,7 @@ public:
void UpdateObjFrame( const XclObjLineData& rLineData, const XclObjFillData& rFillData );
/** Converts and writes the contained data to the passed property set. */
- void Convert( ScfPropertySet& rPropSet ) const;
+ void Convert( ScfPropertySet& rPropSet, bool bUsePicFmt = false ) const;
private:
XclChFrame maData; /// Contents of the CHFRAME record.
@@ -708,7 +710,7 @@ public:
/** Writes the line format only, e.g. for trend lines or error bars. */
void ConvertLine( ScfPropertySet& rPropSet, XclChObjectType eObjType ) const;
/** Writes the area format only for the series or a data point. */
- void ConvertArea( ScfPropertySet& rPropSet, sal_uInt16 nFormatIdx ) const;
+ void ConvertArea( ScfPropertySet& rPropSet, sal_uInt16 nFormatIdx, bool bUsePicFmt ) const;
private:
/** Removes unused formatting (e.g. pie distance in a bar chart). */
diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx
index 51fe688..ba12fa6 100644
--- a/sc/source/filter/inc/xlchart.hxx
+++ b/sc/source/filter/inc/xlchart.hxx
@@ -571,14 +571,9 @@ const sal_uInt16 EXC_CHPICFORMAT_STRETCH = 1; /// Bitmap stretched
const sal_uInt16 EXC_CHPICFORMAT_STACK = 2; /// Bitmap stacked.
const sal_uInt16 EXC_CHPICFORMAT_SCALE = 3; /// Bitmap scaled to axis scale.
-const sal_uInt16 EXC_CHPICFORMAT_WMF = 2;
-const sal_uInt16 EXC_CHPICFORMAT_BMP = 9;
-const sal_uInt16 EXC_CHPICFORMAT_DEFAULT = 19;
-
-const sal_uInt16 EXC_CHPICFORMAT_WINDOWS = 0x0001;
-const sal_uInt16 EXC_CHPICFORMAT_MACOS = 0x0002;
-const sal_uInt16 EXC_CHPICFORMAT_FORMATONLY = 0x0100;
-const sal_uInt16 EXC_CHPICFORMAT_DEFAULTFLAGS = 0x0E00; /// Default flags for export.
+const sal_uInt16 EXC_CHPICFORMAT_TOPBOTTOM = 0x0200;
+const sal_uInt16 EXC_CHPICFORMAT_FRONTBACK = 0x0400;
+const sal_uInt16 EXC_CHPICFORMAT_LEFTRIGHT = 0x0800;
// (0x103D) CHDROPBAR ---------------------------------------------------------
@@ -858,7 +853,6 @@ struct XclChEscherFormat
struct XclChPicFormat
{
sal_uInt16 mnBmpMode; /// Bitmap mode, e.g. stretched, stacked.
- sal_uInt16 mnFormat; /// Image data format (WMF, BMP).
sal_uInt16 mnFlags; /// Additional flags.
double mfScale; /// Picture scaling (units).
@@ -1442,7 +1436,8 @@ public:
XclChObjectTable& rHatchTable,
XclChObjectTable& rBitmapTable,
const XclChEscherFormat& rEscherFmt,
- const XclChPicFormat& rPicFmt,
+ const XclChPicFormat* pPicFmt,
+ sal_uInt32 nDffFillType,
XclChPropertyMode ePropMode );
/** Writes all marker properties to the passed property set. */
void WriteMarkerProperties(
commit e55541cbf0170acfcb62001c8584da3a48c8ecc8
Author: Eike Rathke <erack at redhat.com>
Date: Mon Nov 28 00:26:59 2011 +0100
dr78: #i115659# fix borked boolean logic
# HG changeset patch
# User Daniel Rentz [dr] <daniel.rentz at oracle.com>
# Date 1292346375 -3600
# Node ID 18e64e5db5d0d57b724ef390a7c2dea54b2253be
# Parent 8ec1023e8658320deb61a5b3cdc40aeb9c3d34b1
diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx
index ba0899e..72ce8c5 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -991,10 +991,10 @@ const String& XclExpPTItem::GetItemName() const
void XclExpPTItem::SetPropertiesFromMember( const ScDPSaveMember& rSaveMem )
{
- // #i115659# GetIsVisible() is not valid if HasIsVisible() returns false, default is true then
- ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDDEN, !rSaveMem.HasIsVisible() || !rSaveMem.GetIsVisible() );
- // #i115659# GetShowDetails() is not valid if HasShowDetails() returns false, default is true then
- ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDEDETAIL, !rSaveMem.HasShowDetails() || !rSaveMem.GetShowDetails() );
+ // #i115659# GetIsVisible() is not valid if HasIsVisible() returns false, default is 'visible' then
+ ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDDEN, rSaveMem.HasIsVisible() && !rSaveMem.GetIsVisible() );
+ // #i115659# GetShowDetails() is not valid if HasShowDetails() returns false, default is 'show detail' then
+ ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDEDETAIL, rSaveMem.HasShowDetails() && !rSaveMem.GetShowDetails() );
// visible name
const OUString* pVisName = rSaveMem.GetLayoutName();
commit 22029818cb204cb6b56b6f7d3fc4d14754f2a1cf
Author: Eike Rathke <erack at redhat.com>
Date: Mon Nov 28 00:25:47 2011 +0100
dr78: #i115659# check validity of member and dimension settings
# HG changeset patch
# User Daniel Rentz [dr] <daniel.rentz at oracle.com>
# Date 1292344724 -3600
# Node ID 8ec1023e8658320deb61a5b3cdc40aeb9c3d34b1
# Parent 838c2fed9f13c5884d7cbc72c0239d1ec564dcb0
diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx
index e17c5c3..5e3c7c9 100644
--- a/sc/inc/dpsave.hxx
+++ b/sc/inc/dpsave.hxx
@@ -78,12 +78,12 @@ public:
const ::rtl::OUString& GetName() const
{ return aName; }
- bool HasIsVisible() const;
+ SC_DLLPUBLIC bool HasIsVisible() const;
SC_DLLPUBLIC void SetIsVisible(bool bSet);
bool GetIsVisible() const
{ return bool(nVisibleMode); }
- bool HasShowDetails() const;
+ SC_DLLPUBLIC bool HasShowDetails() const;
SC_DLLPUBLIC void SetShowDetails(bool bSet);
bool GetShowDetails() const
{ return bool(nShowDetailsMode); }
diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx
index 1ff9d80..ba0899e 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -991,8 +991,10 @@ const String& XclExpPTItem::GetItemName() const
void XclExpPTItem::SetPropertiesFromMember( const ScDPSaveMember& rSaveMem )
{
- ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDDEN, !rSaveMem.GetIsVisible() );
- ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDEDETAIL, !rSaveMem.GetShowDetails() );
+ // #i115659# GetIsVisible() is not valid if HasIsVisible() returns false, default is true then
+ ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDDEN, !rSaveMem.HasIsVisible() || !rSaveMem.GetIsVisible() );
+ // #i115659# GetShowDetails() is not valid if HasShowDetails() returns false, default is true then
+ ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDEDETAIL, !rSaveMem.HasShowDetails() || !rSaveMem.GetShowDetails() );
// visible name
const OUString* pVisName = rSaveMem.GetLayoutName();
@@ -1082,8 +1084,8 @@ void XclExpPTField::SetPropertiesFromDim( const ScDPSaveDimension& rSaveDim )
OSL_ENSURE( eOrient != DataPilotFieldOrientation_DATA, "XclExpPTField::SetPropertiesFromDim - called for data field" );
maFieldInfo.AddApiOrient( eOrient );
- // show empty items
- ::set_flag( maFieldExtInfo.mnFlags, EXC_SXVDEX_SHOWALL, rSaveDim.GetShowEmpty() );
+ // show empty items (#i115659# GetShowEmpty() is not valid if HasShowEmpty() returns false, default is false then)
+ ::set_flag( maFieldExtInfo.mnFlags, EXC_SXVDEX_SHOWALL, rSaveDim.HasShowEmpty() && rSaveDim.GetShowEmpty() );
// visible name
const OUString* pLayoutName = rSaveDim.GetLayoutName();
commit 078796d28653118a5b225a6871e8392df1458e11
Author: Eike Rathke <erack at redhat.com>
Date: Mon Nov 28 00:19:12 2011 +0100
dr78: #i115474# use correct defaults for clipboard text import options
# HG changeset patch
# User Niklas Nebel <nn at openoffice.org>
# Date 1292252971 -3600
# Node ID bd03086b10d4f378b4495aba27f524e1798a7cff
# Parent 31b53a2ec7e32f9560464f8a3b9f6c3e07b29083
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index f13fffc..2d7fded 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -200,7 +200,7 @@ static void save_Separators(
// ----------------------------------------------------------------------------
ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName,
- SvStream* pInStream, sal_Unicode /*cSep*/ ) :
+ SvStream* pInStream, sal_Unicode cSep ) :
ModalDialog ( pParent, ScResId( RID_SCDLG_ASCII ) ),
mpDatStream ( pInStream ),
mnStreamPos( pInStream ? pInStream->Tell() : 0 ),
@@ -281,6 +281,12 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName,
// load separators only when importing csv files.
load_Separators (sFieldSeparators, sTextSeparators, bMergeDelimiters,
bQuotedFieldAsText, bDetectSpecialNum, bFixedWidth, nFromRow, nCharSet, nLanguage);
+ else
+ {
+ // #i115474# otherwise use sensible defaults
+ sFieldSeparators = OUString( cSep );
+ sTextSeparators = OUString( ScAsciiOptions::cDefaultTextSep );
+ }
maFieldSeparators = String(sFieldSeparators);
if( bMergeDelimiters )
commit 885c328ba59b1bc70123997e22536f15f74536d0
Author: Eike Rathke <erack at redhat.com>
Date: Mon Nov 28 00:08:23 2011 +0100
dr78: #i116044# correct handling of DataPilot grand total name
# HG changeset patch
# User Niklas Nebel <nn at openoffice.org>
# Date 1292000347 -3600
# Node ID 984bd7503f69a7ecc5d9e916b45b15c5f95c4a5b
# Parent 3462fe872c2af31b7276ef28a7b011f40369e2eb
diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx
index 5158ca1..e91a4af 100644
--- a/sc/source/filter/xml/XMLExportDataPilot.cxx
+++ b/sc/source/filter/xml/XMLExportDataPilot.cxx
@@ -735,7 +735,7 @@ void ScXMLExportDataPilot::WriteGrandTotal(::xmloff::token::XMLTokenEnum eOrient
if (pGrandTotal)
rExport.AddAttribute(XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, *pGrandTotal);
- SvXMLElementExport aElemGrandTotal(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_GRAND_TOTAL, true, true);
+ SvXMLElementExport aElemGrandTotal(rExport, XML_NAMESPACE_TABLE_EXT, XML_DATA_PILOT_GRAND_TOTAL, true, true);
}
void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference <sheet::XSpreadsheetDocument>& /* xSpreadDoc */)
diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx
index 869b71d..f1a7a20 100644
--- a/sc/source/filter/xml/xmldpimp.cxx
+++ b/sc/source/filter/xml/xmldpimp.cxx
@@ -273,6 +273,7 @@ SvXMLImportContext *ScXMLDataPilotTableContext::CreateChildContext( sal_uInt16 n
}
break;
case XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL:
+ case XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL_EXT:
{
pContext = new ScXMLDataPilotGrandTotalContext(GetScImport(), nPrefix, rLName, xAttrList, this);
}
@@ -806,9 +807,9 @@ ScXMLDataPilotGrandTotalContext::~ScXMLDataPilotGrandTotalContext()
}
SvXMLImportContext* ScXMLDataPilotGrandTotalContext::CreateChildContext(
- sal_uInt16 /*nPrefix*/, const ::rtl::OUString& /*rLocalName*/, const Reference<XAttributeList>& /*xAttrList*/ )
+ sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const Reference<XAttributeList>& /*xAttrList*/ )
{
- return NULL;
+ return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
}
void ScXMLDataPilotGrandTotalContext::EndElement()
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 4ccc932..bf4d651 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1407,6 +1407,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotTableElemTokenMap()
{ XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_SQL, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SQL },
{ XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_TABLE, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_TABLE },
{ XML_NAMESPACE_TABLE, XML_DATA_PILOT_GRAND_TOTAL, XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL },
+ { XML_NAMESPACE_TABLE_EXT, XML_DATA_PILOT_GRAND_TOTAL, XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL_EXT },
{ XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_QUERY, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_QUERY },
{ XML_NAMESPACE_TABLE, XML_SOURCE_SERVICE, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SERVICE },
{ XML_NAMESPACE_TABLE, XML_SOURCE_CELL_RANGE, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_CELL_RANGE },
diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx
index a3a3e2a..a90500b 100644
--- a/sc/source/filter/xml/xmlimprt.hxx
+++ b/sc/source/filter/xml/xmlimprt.hxx
@@ -513,6 +513,7 @@ enum ScXMLDataPilotTableElemTokens
XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SQL,
XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_TABLE,
XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL,
+ XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL_EXT,
XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_QUERY,
XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SERVICE,
XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_CELL_RANGE,
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index 06de01b..bbd30e7 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -1856,6 +1856,14 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG )
}
}
+ // also transfer grand total name
+ if (pOldSaveData)
+ {
+ const OUString* pGrandTotalName = pOldSaveData->GetGrandTotalName();
+ if (pGrandTotalName)
+ aSaveData.SetGrandTotalName(*pGrandTotalName);
+ }
+
sal_uInt16 nWhichPivot = SC_MOD()->GetPool().GetWhich( SID_PIVOT_TABLE );
ScPivotItem aOutItem( nWhichPivot, &aSaveData, &aOutRange, bToNewTable );
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 6479bdc..b0f2a8d 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -107,6 +107,7 @@ const SfxItemPropertyMapEntry* lcl_GetDataPilotDescriptorBaseMap()
{
{MAP_CHAR_LEN(SC_UNO_COLGRAND), 0, &getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNO_DRILLDOWN), 0, &getBooleanCppuType(), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNO_GRANDTOTAL_NAME),0,&getCppuType((rtl::OUString*)0), beans::PropertyAttribute::MAYBEVOID, 0 },
{MAP_CHAR_LEN(SC_UNO_IGNEMPROWS), 0, &getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNO_IMPORTDESC), 0, &getCppuType((uno::Sequence<beans::PropertyValue>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNO_RPTEMPTY), 0, &getBooleanCppuType(), 0, 0 },
@@ -342,8 +343,6 @@ ScDataPilotTableObj* ScDataPilotTablesObj::GetObjectByIndex_Impl( sal_Int32 nInd
if ( pColl )
{
// count tables on this sheet
- // api only handles sheet data at this time
- //! allow all data sources!!!
sal_Int32 nFound = 0;
size_t nCount = pColl->GetCount();
for (size_t i=0; i<nCount; ++i)
@@ -493,8 +492,6 @@ sal_Int32 SAL_CALL ScDataPilotTablesObj::getCount() throw(RuntimeException)
if ( pColl )
{
// count tables on this sheet
- // api only handles sheet data at this time
- //! allow all data sources!!!
sal_uInt16 nFound = 0;
size_t nCount = pColl->GetCount();
@@ -556,8 +553,6 @@ Sequence<OUString> SAL_CALL ScDataPilotTablesObj::getElementNames()
if ( pColl )
{
// count tables on this sheet
- // api only handles sheet data at this time
- //! allow all data sources!!!
sal_uInt16 nFound = 0;
size_t nCount = pColl->GetCount();
@@ -598,9 +593,6 @@ sal_Bool SAL_CALL ScDataPilotTablesObj::hasByName( const OUString& aName )
size_t nCount = pColl->GetCount();
for (size_t i=0; i<nCount; ++i)
{
- // api only handles sheet data at this time
- //! allow all data sources!!!
-
ScDPObject* pDPObj = (*pColl)[i];
if ( pDPObj->GetOutRange().aStart.Tab() == nTab &&
pDPObj->GetName() == aName )
@@ -824,6 +816,12 @@ void SAL_CALL ScDataPilotDescriptorBase::setPropertyValue( const OUString& aProp
{
aNewData.SetDrillDown(::cppu::any2bool( aValue ));
}
+ else if ( aNameString.EqualsAscii( SC_UNO_GRANDTOTAL_NAME ) )
+ {
+ rtl::OUString aStrVal;
+ if ( aValue >>= aStrVal )
+ aNewData.SetGrandTotalName(aStrVal);
+ }
else if ( aNameString.EqualsAscii( SC_UNO_IMPORTDESC ) )
{
uno::Sequence<beans::PropertyValue> aArgSeq;
@@ -967,6 +965,12 @@ Any SAL_CALL ScDataPilotDescriptorBase::getPropertyValue( const OUString& aPrope
{
aRet = ::cppu::bool2any( aNewData.GetDrillDown() );
}
+ else if ( aNameString.EqualsAscii( SC_UNO_GRANDTOTAL_NAME ) )
+ {
+ const rtl::OUString* pGrandTotalName = aNewData.GetGrandTotalName();
+ if (pGrandTotalName)
+ aRet <<= *pGrandTotalName; // same behavior as in ScDPSource
+ }
else if ( aNameString.EqualsAscii( SC_UNO_IMPORTDESC ) )
{
const ScImportSourceDesc* pImportDesc = pDPObject->GetImportSourceDesc();
commit 6341603c295a984321a420c99481a0d3aef4c4b5
Author: Eike Rathke <erack at redhat.com>
Date: Sun Nov 27 23:54:05 2011 +0100
dr78: #i111413# export secant functions to BIFF
# HG changeset patch
# User Daniel Rentz [dr] <daniel.rentz at oracle.com>
# Date 1291819312 -3600
# Node ID 5a17ebde41ab8db491a4fe4dae6245230dbd1c1d
# Parent 679f0bf9b2ad463ba7cc1855cf54769b3877b971
diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx
index f8a2a9c..a63c9c5 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -1420,7 +1420,11 @@ void XclExpFmlaCompImpl::PrepareFunction( XclExpFuncData& rFuncData )
{
switch( rFuncData.GetOpCode() )
{
+ case ocCosecant: // simulate CSC(x) by (1/SIN(x))
+ case ocSecant: // simulate SEC(x) by (1/COS(x))
case ocCot: // simulate COT(x) by (1/TAN(x))
+ case ocCosecantHyp: // simulate CSCH(x) by (1/SINH(x))
+ case ocSecantHyp: // simulate SECH(x) by (1/COSH(x))
case ocCotHyp: // simulate COTH(x) by (1/TANH(x))
AppendIntToken( 1 );
break;
@@ -1470,7 +1474,11 @@ void XclExpFmlaCompImpl::FinishFunction( XclExpFuncData& rFuncData, sal_uInt8 nC
FinishChooseFunction( rFuncData );
break;
+ case ocCosecant: // simulate CSC(x) by (1/SIN(x))
+ case ocSecant: // simulate SEC(x) by (1/COS(x))
case ocCot: // simulate COT(x) by (1/TAN(x))
+ case ocCosecantHyp: // simulate CSCH(x) by (1/SINH(x))
+ case ocSecantHyp: // simulate SECH(x) by (1/COSH(x))
case ocCotHyp: // simulate COTH(x) by (1/TANH(x))
AppendBinaryOperatorToken( EXC_TOKID_DIV, true );
AppendParenToken();
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index ea3d321..04f2105 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -92,7 +92,9 @@ static const XclFunctionInfo saFuncTable_2[] =
{ ocCurrency, 13, 1, 2, V, { VR }, 0, 0 },
{ ocFixed, 14, 1, 2, V, { VR, VR, C }, 0, 0 },
{ ocSin, 15, 1, 1, V, { VR }, 0, 0 },
+ { ocCosecant, 15, 1, 1, V, { VR }, EXC_FUNCFLAG_EXPORTONLY, 0 },
{ ocCos, 16, 1, 1, V, { VR }, 0, 0 },
+ { ocSecant, 16, 1, 1, V, { VR }, EXC_FUNCFLAG_EXPORTONLY, 0 },
{ ocTan, 17, 1, 1, V, { VR }, 0, 0 },
{ ocCot, 17, 1, 1, V, { VR }, EXC_FUNCFLAG_EXPORTONLY, 0 },
{ ocArcTan, 18, 1, 1, V, { VR }, 0, 0 },
@@ -229,7 +231,9 @@ static const XclFunctionInfo saFuncTable_3[] =
{ ocMedian, 227, 1, MX, V, { RX }, 0, 0 },
{ ocSumProduct, 228, 1, MX, V, { VA }, 0, 0 },
{ ocSinHyp, 229, 1, 1, V, { VR }, 0, 0 },
+ { ocCosecantHyp, 229, 1, 1, V, { VR }, EXC_FUNCFLAG_EXPORTONLY, 0 },
{ ocCosHyp, 230, 1, 1, V, { VR }, 0, 0 },
+ { ocSecantHyp, 230, 1, 1, V, { VR }, EXC_FUNCFLAG_EXPORTONLY, 0 },
{ ocTanHyp, 231, 1, 1, V, { VR }, 0, 0 },
{ ocCotHyp, 231, 1, 1, V, { VR }, EXC_FUNCFLAG_EXPORTONLY, 0 },
{ ocArcSinHyp, 232, 1, 1, V, { VR }, 0, 0 },
commit f62028b2fa9906a14dff577255ebceb70829f092
Author: Eike Rathke <erack at redhat.com>
Date: Sun Nov 27 23:50:10 2011 +0100
dr78: #i115951# set ScColumn::bDoubleAlloc in DBaseImport
# HG changeset patch
# User Niklas Nebel <nn at openoffice.org>
# Date 1291736714 -3600
# Node ID c1cd4ae7c46490b2f199afd9c889f138ffa06a9e
# Parent d7e6b1b9f73647c4be281748bc9d68a8773d1056
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index c1f69d2..5529579 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -307,6 +307,7 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
sal_uLong nErr = eERR_OK;
long i;
+ long nColCount = 0;
try
{
@@ -318,14 +319,7 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
return nRet;
::utl::DisposableComponent aConnectionHelper(xConnection);
- long nRowCount = 0;
- if ( nRowCount < 0 )
- {
- OSL_FAIL("can't get row count");
- nRowCount = 0;
- }
-
- ScProgress aProgress( this, ScGlobal::GetRscString( STR_LOAD_DOC ), nRowCount );
+ ScProgress aProgress( this, ScGlobal::GetRscString( STR_LOAD_DOC ), 0 );
uno::Reference<lang::XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory();
uno::Reference<sdbc::XRowSet> xRowSet( xFactory->createInstance(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_ROWSET )) ),
@@ -356,7 +350,6 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
xRowSet->execute();
- long nColCount = 0;
uno::Reference<sdbc::XResultSetMetaData> xMeta;
uno::Reference<sdbc::XResultSetMetaDataSupplier> xMetaSupp( xRowSet, uno::UNO_QUERY );
if ( xMetaSupp.is() )
@@ -370,10 +363,6 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
nErr = SCWARN_IMPORT_RANGE_OVERFLOW; // warning
}
- if ( nColCount > 0 )
- aDocument.DoColResize( 0, 0, static_cast<SCCOL>(nColCount) - 1,
- static_cast<SCSIZE>(nRowCount) + 1 );
-
uno::Reference<sdbc::XRow> xRow( xRowSet, uno::UNO_QUERY );
OSL_ENSURE( xRow.is(), "can't get Row" );
if (!xRow.is()) return SCERR_IMPORT_CONNECT;
@@ -387,6 +376,9 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
// read column names
//! add type descriptions
+ aProgress.SetState( 0 );
+ ScColumn::bDoubleAlloc = true; // row count isn't readily available in advance
+
vector<long> aScales(nColCount, -1);
for (i=0; i<nColCount; i++)
{
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list