[Libreoffice-commits] .: sc/source
sc/source/ui/unoobj/chart2uno.cxx |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) New commits: commit 28b7359e00fec9fd3bfab3c9105cf250c4320a24 Author: Kohei Yoshida Date: Fri Feb 1 18:38:05 2013 -0500 bnc#801152: Scan all columns to determine the first data row. When scanning the entire data range in an attempt to determine where the first data row is, we shouldn't stop at the first column. We should scan all data columns to make sure we pick the lowest value row position among all columns. Change-Id: I693ec169857b181c6b4237efcba3fa6a46eaa531 diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 3ace857..5840837 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -295,13 +295,14 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount, bool bFoundValues = false; bool bFoundAnything = false; FormulaTokenMapMap::const_iterator it1 = rCols.begin(); -for (SCCOL nCol = 0; !bFoundValues && nCol < nAllColCount; ++nCol) +for (SCCOL nCol = 0; nCol < nAllColCount; ++nCol) { if (it1 != rCols.end() && nCol>=nHeaderColCount) { +bool bFoundValuesInRow = false; FormulaTokenMap* pCol = it1->second; FormulaTokenMap::const_iterator it2 = pCol->begin(); -for (SCROW nRow = 0; !bFoundValues && nRow < nSmallestValueRowIndex && it2 != pCol->end(); ++nRow) +for (SCROW nRow = 0; !bFoundValuesInRow && nRow < nSmallestValueRowIndex && it2 != pCol->end(); ++nRow) { FormulaToken* pToken = it2->second; if (pToken && nRow>=nHeaderRowCount) @@ -319,7 +320,7 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount, aRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 ); if (pDoc && pDoc->HasValueData( nCol1, nRow1, nTab1 )) { -bFoundValues = bFoundAnything = true; +bFoundValuesInRow = bFoundValues = bFoundAnything = true; nSmallestValueRowIndex = std::min( nSmallestValueRowIndex, nRow ); } if( !bFoundAnything ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/xml/xmlexprt.cxx | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) New commits: commit 3a17d0b3fba7b5eb9f604baa96abcca2b929ee67 Author: Markus Mohrhard Date: Thu Jan 31 00:19:00 2013 +0100 Hyperlink is an optional property, fdo#58858 Change-Id: I30f2b0cdb72951a47cfd8d0091b5418fd59efe83 Reviewed-on: https://gerrit.libreoffice.org/1930 Reviewed-by: Noel Power Tested-by: Noel Power diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 5782dbc..2a595b0 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -3095,9 +3095,16 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape, { // #i66550 HLINK_FOR_SHAPES rtl::OUString sHlink; -uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY ); -if ( xProps.is() ) -xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_HYPERLINK ) ) ) >>= sHlink; +try +{ +uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY ); +if ( xProps.is() ) +xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_HYPERLINK ) ) ) >>= sHlink; +} +catch ( const beans::UnknownPropertyException& ) +{ +// no hyperlink property +} std::auto_ptr< SvXMLElementExport > pDrawA; // enlose shapes with element only if sHlink contains something ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/tool/typedstrdata.cxx | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit 338140e5201bc23625eacd1a4740622e6241cbc2 Author: Kohei Yoshida Date: Wed Jan 30 22:32:28 2013 -0500 bnc#492440: Sort autofilter popup items correctly. Use locale-aware collator to sort strings, instead of using the transliterator. The actual sorting algorithm for cell sort uses collator. Let's be consistent with it. Change-Id: I6729553ce92d50e45fa1ea6e1c35581fd791807d diff --git a/sc/source/core/tool/typedstrdata.cxx b/sc/source/core/tool/typedstrdata.cxx index 811c5d8..71cf0fa 100644 --- a/sc/source/core/tool/typedstrdata.cxx +++ b/sc/source/core/tool/typedstrdata.cxx @@ -29,7 +29,7 @@ #include "typedstrdata.hxx" #include "global.hxx" -#include "unotools/transliterationwrapper.hxx" +#include "unotools/collatorwrapper.hxx" bool ScTypedStrData::LessCaseSensitive::operator() (const ScTypedStrData& left, const ScTypedStrData& right) const { @@ -39,7 +39,7 @@ bool ScTypedStrData::LessCaseSensitive::operator() (const ScTypedStrData& left, if (left.meStrType == Value) return left.mfValue < right.mfValue; -return ScGlobal::GetCaseTransliteration()->compareString( +return ScGlobal::GetCaseCollator()->compareString( left.maStrValue, right.maStrValue) < 0; } @@ -51,7 +51,7 @@ bool ScTypedStrData::LessCaseInsensitive::operator() (const ScTypedStrData& left if (left.meStrType == Value) return left.mfValue < right.mfValue; -return ScGlobal::GetpTransliteration()->compareString( +return ScGlobal::GetCollator()->compareString( left.maStrValue, right.maStrValue) < 0; } @@ -63,7 +63,7 @@ bool ScTypedStrData::EqualCaseSensitive::operator() (const ScTypedStrData& left, if (left.meStrType == Value && left.mfValue != right.mfValue) return false; -return ScGlobal::GetCaseTransliteration()->compareString( +return ScGlobal::GetCaseCollator()->compareString( left.maStrValue, right.maStrValue) == 0; } @@ -75,7 +75,7 @@ bool ScTypedStrData::EqualCaseInsensitive::operator() (const ScTypedStrData& lef if (left.meStrType == Value && left.mfValue != right.mfValue) return false; -return ScGlobal::GetpTransliteration()->compareString( +return ScGlobal::GetCollator()->compareString( left.maStrValue, right.maStrValue) == 0; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/data/column.cxx |1 - sc/source/ui/app/scmod.cxx |3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit 11cfcf401a68cbaf5dfe0a309fd482d3a3fbdff6 Author: Kohei Yoshida Date: Wed Jan 30 20:49:15 2013 -0500 Don't overwrite bCalcAll when it's already set & remove SetCompile(). Change-Id: Ieaf84e8d36efa8314729903be029f83c31bcbdf3 diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index b74d325..f29dc2d 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -2160,7 +2160,6 @@ bool ScColumn::CompileErrorCells(sal_uInt16 nErrCode) continue; pFCell->GetCode()->SetCodeError(0); -pFCell->SetCompile(true); OUStringBuffer aBuf; pFCell->GetFormula(aBuf, pDocument->GetGrammar()); pFCell->Compile(aBuf.makeStringAndClear(), false, pDocument->GetGrammar()); diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 38fc9ec..8506f12 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -1327,7 +1327,8 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet ) // Re-compile cells with name error, and recalc if at least one cell // has been re-compiled. In the future we may want to find a way to // recalc only those that are affected. -bCalcAll = pDoc->CompileErrorCells(ScErrorCodes::errNoName); +if (pDoc->CompileErrorCells(ScErrorCodes::errNoName)) +bCalcAll = true; } if ( pDoc && bCalcAll ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/excel/xlformula.cxx | 128 +-- sc/source/filter/oox/formulabase.cxx | 98 +- 2 files changed, 158 insertions(+), 68 deletions(-) New commits: commit 24bce470788aa34e5e1bb001250bfa14cee1c75e Author: Eike Rathke Date: Thu Jan 31 00:53:05 2013 +0100 import/export new Excel 2013 ODF functions, fdo#60032 Change-Id: I8cf726ce5132f0cb712b30a76a76b152a681f4da diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx index 0cee777..27cbab0 100644 --- a/sc/source/filter/excel/xlformula.cxx +++ b/sc/source/filter/excel/xlformula.cxx @@ -370,13 +370,103 @@ static const XclFunctionInfo saFuncTable_Oox[] = { ocIfError,255,3, 3, V, { RO_E, VO, RO }, EXC_FUNCFLAG_EXPORTONLY, EXC_FUNCNAME( "IFERROR" ) } }; -/** Functions new in Excel 2013. */ + +#define EXC_FUNCENTRY_V_VR( opcode, minparam, maxparam, flags, asciiname ) \ +{ opcode, NOID, minparam, maxparam, V, { VR }, EXC_FUNCFLAG_IMPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }, \ +{ opcode, 255, (minparam)+1, (maxparam)+1, V, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY|(flags), EXC_FUNCNAME( asciiname ) } + +#define EXC_FUNCENTRY_V_VR_IMPORT( opcode, minparam, maxparam, flags, asciiname ) \ +{ opcode, NOID, minparam, maxparam, V, { VR }, EXC_FUNCFLAG_IMPORTONLY|(flags), EXC_FUNCNAME( asciiname ) } + +#define EXC_FUNCENTRY_A_VR( opcode, minparam, maxparam, flags, asciiname ) \ +{ opcode, NOID, minparam, maxparam, A, { VR }, EXC_FUNCFLAG_IMPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }, \ +{ opcode, 255, (minparam)+1, (maxparam)+1, A, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY|(flags), EXC_FUNCNAME( asciiname ) } + +#define EXC_FUNCENTRY_V_RO( opcode, minparam, maxparam, flags, asciiname ) \ +{ opcode, NOID, minparam, maxparam, V, { RO }, EXC_FUNCFLAG_IMPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }, \ +{ opcode, 255, (minparam)+1, (maxparam)+1, V, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY|(flags), EXC_FUNCNAME( asciiname ) } + +// implicit maxparam=MX +#define EXC_FUNCENTRY_V_RX( opcode, minparam, maxparam, flags, asciiname ) \ +{ opcode, NOID, minparam, MX, V, { RX }, EXC_FUNCFLAG_IMPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }, \ +{ opcode, 255, (minparam)+1, MX, V, { RO_E, RX }, EXC_FUNCFLAG_EXPORTONLY|(flags), EXC_FUNCNAME( asciiname ) } + +/** Functions new in Excel 2013. + +See http://office.microsoft.com/en-us/excel-help/new-functions-in-excel-2013-HA103980604.aspx +Most functions apparently were added for ODF1.2 ODFF / OpenFormula +compatibility. + +Functions with EXC_FUNCENTRY_V_VR_IMPORT are rewritten in +sc/source/filter/excel/xeformula.cxx during export for BIFF, OOXML export +uses a different mapping but still uses this mapping here to determine the +feature set. + +FIXME: either have the exporter determine the feature set from the active +mapping, preferred, or enhance this mapping here such that for OOXML the +rewrite can be overridden. + +@See sc/source/filter/oox/formulabase.cxx saFuncTable2013 for V,VR,RO,... + */ static const XclFunctionInfo saFuncTable_2013[] = { -{ ocIfNA, NOID, 2, 2, V, { VO, RO }, EXC_FUNCFLAG_IMPORTONLY, EXC_FUNCNAME( "IFNA" ) }, -{ ocIfNA, 255,3, 3, V, { RO_E, VO, RO }, EXC_FUNCFLAG_EXPORTONLY, EXC_FUNCNAME( "IFNA" ) } +EXC_FUNCENTRY_V_VR_IMPORT( ocArcCot,1, 1, 0, "ACOT" ), +EXC_FUNCENTRY_V_VR_IMPORT( ocArcCotHyp, 1, 1, 0, "ACOTH" ), +EXC_FUNCENTRY_V_VR( ocArabic,1, 1, 0, "ARABIC" ), +EXC_FUNCENTRY_V_VR( ocBase, 2, 3, 0, "BASE" ), +EXC_FUNCENTRY_V_VR( ocB, 3, 4, 0, "BINOM.DIST.RANGE" ), +EXC_FUNCENTRY_V_VR( ocBitAnd,2, 2, 0, "BITAND" ), +EXC_FUNCENTRY_V_VR( ocBitLshift, 2, 2, 0, "BITLSHIFT" ), +EXC_FUNCENTRY_V_VR( ocBitOr, 2, 2, 0, "BITOR" ), +EXC_FUNCENTRY_V_VR( ocBitRshift, 2, 2, 0, "BITRSHIFT" ), +EXC_FUNCENTRY_V_VR( ocBitXor,2, 2, 0, "BITXOR" ), +/* FIXME: CEILING.MATH is our/ODFF CEILING, but we have special handling + * for the weird Excel CEILING behavior, check that and unify or diversify. + * */ +EXC_FUNCENTRY_V_VR( ocNoName,1, 3, 0, "CEILING.MATH" ), +EXC_FUNCENTRY_V_VR( ocKombin2, 2, 2, 0, "COMBINA" ), +EXC_FUNCENTRY_V_VR_IMPORT( ocCot, 1, 1, 0, "COT" ), +EXC_FUNCENTRY_V_VR_IMPORT( ocCotHyp,1, 1, 0, "COTH" ), +EXC_FUNCENTRY_V_VR_IMPORT( ocCosecant, 1, 1, 0, "CSC" ), +EXC_FUNCENTRY_V_VR_IMPORT( ocCosecantHyp, 1, 1, 0, "CSCH" ), +EXC_FUNCENTRY_V_VR( ocGetDiffDate, 2, 2, 0, "DAYS" ), +EXC_FUNCENTRY_V_VR( ocDecimal,
[Libreoffice-commits] .: sc/source
sc/source/filter/excel/xeformula.cxx | 46 +++- sc/source/filter/oox/formulabase.cxx | 66 ++- 2 files changed, 71 insertions(+), 41 deletions(-) New commits: commit 0c7a1b6e10011930b703897073b8d41e94f7d827 Author: Eike Rathke Date: Wed Jan 30 22:28:48 2013 +0100 resolved fdo#60087 corrected .xlsx export of functions Change-Id: I6c7ba47dde88a73d035b1db5f7f4cede78b262db diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx index 603ee9d..893321b 100644 --- a/sc/source/filter/excel/xeformula.cxx +++ b/sc/source/filter/excel/xeformula.cxx @@ -1406,20 +1406,24 @@ void XclExpFmlaCompImpl::ProcessFunction( const XclExpScToken& rTokData ) void XclExpFmlaCompImpl::PrepareFunction( XclExpFuncData& rFuncData ) { -switch( rFuncData.GetOpCode() ) +// For OOXML these are not rewritten anymore. +if (GetOutput() != EXC_OUTPUT_XML_2007) { -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; -case ocArcCot: // simulate ACOT(x) by (PI/2-ATAN(x)) -AppendNumToken( F_PI2 ); -break; -default:; +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; +case ocArcCot: // simulate ACOT(x) by (PI/2-ATAN(x)) +AppendNumToken( F_PI2 ); +break; +default:; +} } } @@ -1468,12 +1472,20 @@ void XclExpFmlaCompImpl::FinishFunction( XclExpFuncData& rFuncData, sal_uInt8 nC 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(); +// For OOXML not rewritten anymore. +if (GetOutput() != EXC_OUTPUT_XML_2007) +{ +AppendBinaryOperatorToken( EXC_TOKID_DIV, true ); +AppendParenToken(); +} break; case ocArcCot: // simulate ACOT(x) by (PI/2-ATAN(x)) -AppendBinaryOperatorToken( EXC_TOKID_SUB, true ); -AppendParenToken(); +// For OOXML not rewritten anymore. +if (GetOutput() != EXC_OUTPUT_XML_2007) +{ +AppendBinaryOperatorToken( EXC_TOKID_SUB, true ); +AppendParenToken(); +} break; default:; diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx index 8aff106..a98e58a 100644 --- a/sc/source/filter/oox/formulabase.cxx +++ b/sc/source/filter/oox/formulabase.cxx @@ -216,6 +216,8 @@ const sal_uInt16 FUNCFLAG_MACROCALL_FN = 0x0400; /** Function is stored a const sal_uInt16 FUNCFLAG_MACROCALL_NEW = FUNCFLAG_MACROCALL | FUNCFLAG_MACROCALL_FN; /** New Excel functions not defined in OOXML, _xlfn. prefix in all formats. OOXML name must exist. */ +const sal_uInt16 FUNCFLAG_BIFFIMPORTONLY= 0x0800; /// Only used in BIFF binary import filter. +const sal_uInt16 FUNCFLAG_BIFFEXPORTONLY= 0x1000; /// Only used in BIFF binary export filter. /// Converts a function library index (value of enum FunctionLibraryType) to function flags. #define FUNCLIB_TO_FUNCFLAGS( funclib_index ) static_cast< sal_uInt16 >( static_cast< sal_uInt8 >( funclib_index ) << 12 ) @@ -236,14 +238,21 @@ struct FunctionData FunctionParamInfo mpParamInfos[ FUNCINFO_PARAMINFOCOUNT ]; /// Information about all parameters. sal_uInt16 mnFlags;/// Additional flags. -inline bool isSupported( bool bImportFilter ) const; +inline bool isSupported
[Libreoffice-commits] .: sc/source
sc/source/filter/oox/formulabase.cxx |8 1 file changed, 8 insertions(+) New commits: commit d701e808782f5849f22c112311a9553f08c8d553 Author: Eike Rathke Date: Wed Jan 30 00:55:19 2013 +0100 resolved fdo#60043 write correct IM* function names Prefixed with _xlfn. instead of programmatic Add-In name. Change-Id: I4f119f92096329432488503f36df670a4ce19b42 diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx index 3a01e0c..8aff106 100644 --- a/sc/source/filter/oox/formulabase.cxx +++ b/sc/source/filter/oox/formulabase.cxx @@ -730,6 +730,14 @@ static const FunctionData saFuncTableOox[] = static const FunctionData saFuncTable2013[] = { { "IFNA", "IFNA", NOID, NOID, 2, 2, V, { VO, RO }, FUNCFLAG_MACROCALL_NEW }, +{ "IMCOSH", "IMCOSH", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALL_NEW | FUNCFLAG_EXTERNAL }, +{ "IMCOT", "IMCOT",NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALL_NEW | FUNCFLAG_EXTERNAL }, +{ "IMCSC", "IMCSC",NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALL_NEW | FUNCFLAG_EXTERNAL }, +{ "IMCSCH", "IMCSCH", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALL_NEW | FUNCFLAG_EXTERNAL }, +{ "IMSEC", "IMSEC",NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALL_NEW | FUNCFLAG_EXTERNAL }, +{ "IMSECH", "IMSECH", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALL_NEW | FUNCFLAG_EXTERNAL }, +{ "IMSINH", "IMSINH", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALL_NEW | FUNCFLAG_EXTERNAL }, +{ "IMTAN", "IMTAN",NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALL_NEW | FUNCFLAG_EXTERNAL }, }; /** Functions defined by OpenFormula, but not supported by Calc or by Excel. */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/excel/xeroot.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 53e28cba18bfc1210f119c899e7559e70de360ac Author: Eike Rathke Date: Tue Jan 29 00:20:54 2013 +0100 osl ensure on the correct member ... Change-Id: Ic41f95431203409b8412733870a4d8ec0fc93192 diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx index 785a620..6016d7d 100644 --- a/sc/source/filter/excel/xeroot.cxx +++ b/sc/source/filter/excel/xeroot.cxx @@ -169,7 +169,7 @@ XclExpPivotTableManager& XclExpRoot::GetPivotTableManager() const ScCompiler::OpCodeMapPtr XclExpRoot::GetOpCodeMap() const { -OSL_ENSURE( mrExpData.mxPTableMgr, "XclExpRoot::GetOpCodeMap - missing object (wrong BIFF?)" ); +OSL_ENSURE( mrExpData.mxOpCodeMap, "XclExpRoot::GetOpCodeMap - missing object (wrong BIFF?)" ); return mrExpData.mxOpCodeMap; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source xmloff/inc xmloff/source
sc/source/filter/xml/xmlcondformat.cxx | 75 + sc/source/filter/xml/xmlcondformat.hxx | 14 ++ sc/source/filter/xml/xmlexprt.cxx | 43 ++ sc/source/filter/xml/xmlimprt.cxx | 20 sc/source/filter/xml/xmlimprt.hxx | 11 xmloff/inc/xmloff/xmltoken.hxx |1 xmloff/source/core/xmltoken.cxx|1 7 files changed, 164 insertions(+), 1 deletion(-) New commits: commit e820c249a4280fb38cf0ef7664006707382a687e Author: Markus Mohrhard Date: Fri Nov 16 15:08:40 2012 +0100 implement conditional date format import/export for ODF Change-Id: I11d5583c994d84fe1163c6158c0794ea1d879f2e diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx index 571426c..64e9d2a 100644 --- a/sc/source/filter/xml/xmlcondformat.cxx +++ b/sc/source/filter/xml/xmlcondformat.cxx @@ -131,6 +131,9 @@ SvXMLImportContext* ScXMLConditionalFormatContext::CreateChildContext( sal_uInt1 case XML_TOK_CONDFORMAT_ICONSET: pContext = new ScXMLIconSetFormatContext( GetScImport(), nPrefix, rLocalName, xAttrList, mpFormat ); break; +case XML_TOK_CONDFORMAT_DATE: +pContext = new ScXMLDateContext( GetScImport(), nPrefix, rLocalName, xAttrList, mpFormat ); +break; default: break; } @@ -703,4 +706,76 @@ ScXMLFormattingEntryContext::ScXMLFormattingEntryContext( ScXMLImport& rImport, setColorEntryType(sType, pColorScaleEntry, sVal, GetScImport()); } +namespace { + +condformat::ScCondFormatDateType getDateFromString(const rtl::OUString& rString) +{ +if(rString == "today") +return condformat::TODAY; +else if(rString == "yesterday") +return condformat::YESTERDAY; +else if(rString == "tomorrow") +return condformat::TOMORROW; +else if(rString == "last-7-days") +return condformat::LAST7DAYS; +else if(rString == "this-week") +return condformat::THISWEEK; +else if(rString == "last-week") +return condformat::LASTWEEK; +else if(rString == "next-week") +return condformat::NEXTWEEK; +else if(rString == "this-month") +return condformat::THISMONTH; +else if(rString == "last-month") +return condformat::LASTMONTH; +else if(rString == "next-month") +return condformat::NEXTMONTH; +else if(rString == "this-year") +return condformat::THISYEAR; +else if(rString == "last-year") +return condformat::LASTYEAR; +else if(rString == "next-year") +return condformat::NEXTYEAR; + +SAL_WARN("sc", "unknown date type: " << rString); +return condformat::TODAY; +} + +} + +ScXMLDateContext::ScXMLDateContext( ScXMLImport& rImport, sal_uInt16 nPrfx, +const ::rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList, +ScConditionalFormat* pFormat ): +SvXMLImportContext( rImport, nPrfx, rLName ) +{ +rtl::OUString sDateType, sStyle; +sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0); +const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetCondDateAttrMap(); +for( sal_Int16 i=0; i < nAttrCount; ++i ) +{ +const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i )); +rtl::OUString aLocalName; +sal_uInt16 nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName( +sAttrName, &aLocalName )); +const rtl::OUString& sValue(xAttrList->getValueByIndex( i )); + +switch( rAttrTokenMap.Get( nPrefix, aLocalName ) ) +{ +case XML_TOK_COND_DATE_VALUE: +sDateType = sValue; +break; +case XML_TOK_COND_DATE_STYLE: +sStyle = sValue; +default: +break; +} +} + +ScCondDateFormatEntry* pFormatEntry = new ScCondDateFormatEntry(GetScImport().GetDocument()); +pFormatEntry->SetStyleName(sStyle); +pFormatEntry->SetDateType(getDateFromString(sDateType)); +pFormat->AddEntry(pFormatEntry); + +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlcondformat.hxx b/sc/source/filter/xml/xmlcondformat.hxx index 0ace1eb..1b64cd5 100644 --- a/sc/source/filter/xml/xmlcondformat.hxx +++ b/sc/source/filter/xml/xmlcondformat.hxx @@ -194,4 +194,18 @@ public: virtual ~ScXMLCondContext() {} }; +class ScXMLDateContext : public SvXMLImportContext +{ +const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); } +ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); } +public: +ScXMLDateContext( ScXMLImport& rImport, sal_uInt16 nPrfx, +const ::rtl::OUString& rLName, +const ::com::sun::star::uno::Reference< +
[Libreoffice-commits] .: sc/source sc/uiconfig sw/inc sw/source sw/uiconfig
sc/source/ui/dbgui/tpsort.cxx |3 - sc/uiconfig/scalc/ui/sortoptionspage.ui | 36 ++ sw/inc/helpid.h |1 sw/source/ui/frmdlg/column.cxx | 14 --- sw/source/ui/misc/srtdlg.cxx|8 sw/uiconfig/swriter/ui/columnpage.ui| 61 +--- sw/uiconfig/swriter/ui/sortdialog.ui| 38 +++ 7 files changed, 107 insertions(+), 54 deletions(-) New commits: commit 6b642358640fcb060d14105991f83172e06723a4 Author: Caolán McNamara Date: Sun Jan 27 08:28:34 2013 + move SetAccessibleRelationLabeledBy relations into .ui and out of code Change-Id: Ieb43e08519b72d4baebd5d004e4c9fd60daa40d4 diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index 78d04ac..d458597 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -530,11 +530,8 @@ ScTabPageSortOptions::ScTabPageSortOptions( Window* pParent, Init(); SetExchangeSupport(); -m_pLbOutPos->SetAccessibleRelationLabeledBy(m_pBtnCopyResult); m_pLbOutPos->SetAccessibleName(m_pBtnCopyResult->GetText()); -m_pEdOutPos->SetAccessibleRelationLabeledBy(m_pBtnCopyResult); m_pEdOutPos->SetAccessibleName(m_pBtnCopyResult->GetText()); -m_pLbSortUser->SetAccessibleRelationLabeledBy(m_pBtnSortUser); m_pLbSortUser->SetAccessibleName(m_pBtnSortUser->GetText()); } diff --git a/sc/uiconfig/scalc/ui/sortoptionspage.ui b/sc/uiconfig/scalc/ui/sortoptionspage.ui index ded61ac..0276e29 100644 --- a/sc/uiconfig/scalc/ui/sortoptionspage.ui +++ b/sc/uiconfig/scalc/ui/sortoptionspage.ui @@ -20,11 +20,9 @@ Case _sensitive -False True True False -False True 0 True @@ -39,11 +37,9 @@ Range contains... -False True True False -False 0 True @@ -57,11 +53,9 @@ Include formats -False True True False -False 0 True @@ -75,11 +69,9 @@ Enable natural sort -False True True False -False 0 True @@ -93,13 +85,14 @@ Copy sort results to: -False True True False -False 0 True + + + 0 @@ -113,6 +106,10 @@ True False 20 + + + + 0 @@ -128,6 +125,9 @@ True ⢠True + + + 1 @@ -139,13 +139,14 @@ Custom sort order -False True True False -False 0 True + + + 0 @@ -159,6 +160,9 @@ True False 20 + + + 0 @@ -173,6 +177,8 @@ False start Language +True +language 0 @@ -187,6 +193,8 @@ False start Options +True +algorithmlb 1 @@ -264,11 +272,9 @@ _Top to bottom (sort rows) -False True True False -False True 0 True @@ -285,11 +291,9 @@ L_eft to right (sort columns) -False True True False -False True 0
[Libreoffice-commits] .: sc/source
sc/source/core/data/markdata.cxx | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) New commits: commit aac5cb1d3203a52966a539df729716c51d874ea4 Author: Markus Mohrhard Date: Sat Jan 26 02:20:13 2013 +0100 remove unnecessary calls to copy c'tor Change-Id: I78ef9901a42e65c5d7fb6f8048a114ba23f9ce98 diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx index f87e24d..9cb84ae 100644 --- a/sc/source/core/data/markdata.cxx +++ b/sc/source/core/data/markdata.cxx @@ -355,17 +355,17 @@ void ScMarkData::MarkFromRangeList( const ScRangeList& rList, bool bReset ) size_t nCount = rList.size(); if ( nCount == 1 && !bMarked && !bMultiMarked ) { -ScRange aRange = *rList[ 0 ]; -SetMarkArea( aRange ); -SelectTable( aRange.aStart.Tab(), true ); +const ScRange& rRange = *rList[ 0 ]; +SetMarkArea( rRange ); +SelectTable( rRange.aStart.Tab(), true ); } else { for (size_t i=0; i < nCount; i++) { -ScRange aRange = *rList[ i ]; -SetMultiMarkArea( aRange, true ); -SelectTable( aRange.aStart.Tab(), true ); +const ScRange& rRange = *rList[ i ]; +SetMultiMarkArea( rRange, true ); +SelectTable( rRange.aStart.Tab(), true ); } } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/oox/stylesbuffer.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 32ad991fd4f12f03120e8f3a416ee06fb7c3 Author: Marcos Paulo de Souza Date: Fri Jan 25 07:12:44 2013 -0200 Only call getScDocument when needed Change-Id: I2dca76af46e63b5dd833f5a60549d4b1a7b03d84 Reviewed-on: https://gerrit.libreoffice.org/1861 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index bb3672d..3657f9b 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -2715,11 +2715,11 @@ void CellStyle::createCellStyle() if( !mbCreated ) mbCreated = maFinalName.isEmpty(); -::ScDocument& rDoc = getScDocument(); if( !mbCreated && !mpStyleSheet ) { bool bCreatePattern = false; Xf* pXF = getStyles().getStyleXf( maModel.mnXfId ).get(); +::ScDocument& rDoc = getScDocument(); bool bDefStyle = maModel.isDefaultStyle(); if( bDefStyle ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/oox/formulabase.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 0adb958c451660ec0eea012480b6327dd2aefeb4 Author: Eike Rathke Date: Fri Jan 25 00:31:03 2013 +0100 non-dbgutil build [-Werror=unused-parameter], fdo#59819 Change-Id: I8eaa67bc2ab609bb6483cb307bf4bbc0ca654671 diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx index 562c166..3a01e0c 100644 --- a/sc/source/filter/oox/formulabase.cxx +++ b/sc/source/filter/oox/formulabase.cxx @@ -856,6 +856,7 @@ FunctionProviderImpl::FunctionProviderImpl( FilterType eFilter, BiffType eBiff, // bCallerKnowsAboutMacroExport, to suppress this warning then. OSL_ENSURE( bImportFilter || bCallerKnowsAboutMacroExport, "FunctionProviderImpl::FunctionProviderImpl - need special handling for macro call functions" ); +(void)bCallerKnowsAboutMacroExport; sal_uInt8 nMaxParam = 0; switch( eFilter ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/excel/xecontent.cxx | 18 ++--- sc/source/filter/excel/xeextlst.cxx |3 + sc/source/filter/excel/xeformula.cxx |9 sc/source/filter/excel/xeroot.cxx| 51 +++ sc/source/filter/excel/xestream.cxx | 24 ++-- sc/source/filter/excel/xetable.cxx |3 + sc/source/filter/inc/formulabase.hxx |6 ++- sc/source/filter/inc/xeroot.hxx |5 ++ sc/source/filter/inc/xestream.hxx|4 +- sc/source/filter/oox/formulabase.cxx | 35 ++ sc/source/filter/xcl97/XclExpChangeTrack.cxx |3 + 11 files changed, 135 insertions(+), 26 deletions(-) New commits: commit 1162738c6fbd8505ffa27b28118318cc522a5368 Author: Eike Rathke Date: Thu Jan 24 23:17:00 2013 +0100 resolved fdo#59819 write correct OOXML function name mapping OOXML export so far used the internal English PODF symbols that worked only by accident. As soon as function names or operators differed it was plain wrong. Use the existing OOXML mapping instead that also the import uses. For example, in OOXML the IFNA function is stored as _xlfn.IFNA, Excel 2013 could not read the IFNA that we wrote. Also, do not write a element in OOXML for new functions that in the binary format are written as macro calls and need a defined name entry. Change-Id: Ib6de1f8b65d0634c2d78229ddb4922778a33923b diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index f416f58..3f35f5e 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -931,12 +931,14 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm ) if(!IsTextRule(eOperation) && !IsTopBottomRule(eOperation)) { rWorksheet->startElement( XML_formula, FSEND ); -rWorksheet->write(XclXmlUtils::ToOUString( GetRoot().GetDoc(), mrFormatEntry.GetValidSrcPos(), mrFormatEntry.CreateTokenArry( 0 ) )); +rWorksheet->write(XclXmlUtils::ToOUString( GetRoot().GetDoc(), mrFormatEntry.GetValidSrcPos(), +mrFormatEntry.CreateTokenArry( 0 ), GetRoot().GetOpCodeMap() )); rWorksheet->endElement( XML_formula ); if (bFmla2) { rWorksheet->startElement( XML_formula, FSEND ); -rWorksheet->write(XclXmlUtils::ToOUString( GetRoot().GetDoc(), mrFormatEntry.GetValidSrcPos(), mrFormatEntry.CreateTokenArry( 1 ) )); +rWorksheet->write(XclXmlUtils::ToOUString( GetRoot().GetDoc(), mrFormatEntry.GetValidSrcPos(), +mrFormatEntry.CreateTokenArry( 1 ), GetRoot().GetOpCodeMap() )); rWorksheet->endElement( XML_formula ); } } @@ -1076,7 +1078,8 @@ void XclExpCfvo::SaveXml( XclExpXmlStream& rStrm ) rtl::OString aValue; if(mrEntry.GetType() == COLORSCALE_FORMULA) { -rtl::OUString aFormula = XclXmlUtils::ToOUString( GetRoot().GetDoc(), maSrcPos, mrEntry.GetFormula()->Clone() ); +rtl::OUString aFormula = XclXmlUtils::ToOUString( GetRoot().GetDoc(), maSrcPos, +mrEntry.GetFormula()->Clone(), GetRoot().GetOpCodeMap() ); aValue = rtl::OUStringToOString(aFormula, RTL_TEXTENCODING_UTF8 ); } else @@ -1584,14 +1587,16 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) : Formula compiler supports this by offering two different functions CreateDataValFormula() and CreateListValFormula(). */ mxTokArr1 = rFmlaComp.CreateFormula( EXC_FMLATYPE_LISTVAL, *xScTokArr ); -msFormula1 = XclXmlUtils::ToOUString( GetDoc(), pValData->GetSrcPos(), xScTokArr.get() ); +msFormula1 = XclXmlUtils::ToOUString( GetDoc(), pValData->GetSrcPos(), +xScTokArr.get(), GetRoot().GetOpCodeMap() ); } } else { // no list validation -> convert the formula mxTokArr1 = rFmlaComp.CreateFormula( EXC_FMLATYPE_DATAVAL, *xScTokArr ); -msFormula1 = XclXmlUtils::ToOUString( GetDoc(), pValData->GetSrcPos(), xScTokArr.get() ); +msFormula1 = XclXmlUtils::ToOUString( GetDoc(), pValData->GetSrcPos(), +xScTokArr.get(), GetRoot().GetOpCodeMap() ); } } @@ -1600,7 +1605,8 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) : if( xScTokArr.get() ) { mxTokArr2 = rFmlaComp.CreateFormula( EXC_FMLATYPE_DATAVAL, *xScTokArr ); -msFormula2 = XclXmlUtils::ToOUString( GetDoc(), pValData->GetSrcPos(), xScTokArr.get() ); +msFormula2 = XclXmlUtils::ToOUString( GetDoc(), pValData->GetSrcPos(), +xScTokArr.get(), GetRoot().GetOpCodeMap() ); } }
[Libreoffice-commits] .: sc/source
sc/source/core/data/cell.cxx | 52 +-- sc/source/core/data/cell2.cxx | 79 -- 2 files changed, 56 insertions(+), 75 deletions(-) New commits: commit 5af61a8bb6fa890349334b6a22eb02a0dd79a90a Author: Philipp Weissenbacher Date: Wed Jan 23 00:32:36 2013 +0100 Translate German comments, fix some ws Change-Id: I962077a8c7d533c7eaf6d5ba68ec18966e5760a1 Reviewed-on: https://gerrit.libreoffice.org/1817 Reviewed-by: Radek DoulÃk Tested-by: Radek DoulÃk diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx index 2b0366c..8df14f1 100644 --- a/sc/source/core/data/cell.cxx +++ b/sc/source/core/data/cell.cxx @@ -1143,25 +1143,18 @@ void ScFormulaCell::CalcAfterLoad() pDocument->AddSubTotalCell(this); } -// irgendwie koennen unter os/2 mit rotter FPU-Exception /0 ohne Err503 gespeichert -// werden, woraufhin spaeter im NumberFormatter die BLC Lib bei einem fabs(-NAN) abstuerzt -//(#32739#) hier fuer alle Systeme ausbuegeln, damit da auch Err503 steht - -// somehow we can under os / 2 store without Err503 with rotter FPU / 0, followed later -// in the BLC Lib NumberFormatter a fabs (NAN) is crashing (# 32739 #) iron out here for all -// the systems, so there is also Err503 - +// On OS/2 with broken FPU exception, we can somehow store /0 without Err503. Later on in +// the BLC Lib NumberFormatter crashes when doing a fabs (NAN) (# 32739 #). +// We iron this out here for all systems, such that we also have an Err503 here. if ( aResult.IsValue() && !::rtl::math::isFinite( aResult.GetDouble() ) ) { -OSL_FAIL("Formelzelle INFINITY !!! Woher kommt das Dokument?"); +OSL_FAIL("Formula cell INFINITY!!! Where does this document come from?"); aResult.SetResultError( errIllegalFPOperation ); bDirty = true; } -// DoubleRefs bei binaeren Operatoren waren vor v5.0 immer Matrix, -// jetzt nur noch wenn in Matrixformel, sonst implizite Schnittmenge -// Double Refs in binary operators were always in front of Matrix v5.0, now only when in an -// array formula, otherwise an implicit intersection +// DoubleRefs for binary operators were always a Matrix before version v5.0. +// Now this is only the case when when in an array formula, otherwise it's an implicit intersection if ( pDocument->GetSrcVersion() < SC_MATRIX_DOUBLEREF && GetMatrixFlag() == MM_NONE && pCode->HasMatrixDoubleRefOps() ) { @@ -1169,9 +1162,8 @@ void ScFormulaCell::CalcAfterLoad() SetMatColsRows( 1, 1); } -// Must the cells be calculated? After Load cells can contain an error code, and then start -// the listener and ggbf. Recalculate if not RECALCMODE_NORMAL - +// Do the cells need to be calculated? After Load cells can contain an error code, and then start +// the listener and Recalculate (if needed) if not RECALCMODE_NORMAL if( !bNewCompiled || !pCode->GetCodeError() ) { StartListeningTo( pDocument ); @@ -1179,16 +1171,11 @@ void ScFormulaCell::CalcAfterLoad() bDirty = true; } if ( pCode->IsRecalcModeAlways() ) -{ // zufall(), heute(), jetzt() bleiben immer im FormulaTree, damit sie -// auch bei jedem F9 berechnet werden. - -// accident(), today(), now() always stay in the FormulaTree, so that they -// can also be calculated for each F9. +{ // random(), today(), now() always stay in the FormulaTree, so that they are calculated +// for each F9 bDirty = true; } -// Noch kein SetDirty weil noch nicht alle Listener bekannt, erst in -// SetDirtyAfterLoad. -// Still no SetDirty because all Listeners are not know, first in SetDirtyAfterLoad. +// No SetDirty yet, as no all Listeners are known yet (only in SetDirtyAfterLoad) } @@ -1204,12 +1191,8 @@ void ScFormulaCell::Interpret() return; // no double/triple processing //! HACK: -// Wenn der Aufruf aus einem Reschedule im DdeLink-Update kommt, dirty stehenlassen -// Besser: Dde-Link Update ohne Reschedule oder ganz asynchron !!! - -// If the call comes from a Reschedule in the DdeLink-Update, dirty let stand -// Better: Dde-Link Update without Reschdule or completely asynchronously !!! - +// If the call originates from a Reschedule in DdeLink update, leave dirty +// Better: Do a Dde Link Update without Reschedule or do it completely asynchronously! if ( pDocument->IsInDdeLinkUpdate() ) return; @@ -1551,7 +1534,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) p->GetStringResult() == aResult.GetString())) { // A convergence in the first iteration doesn't necessarily -// mean that it's done, it may be because not all related cells
[Libreoffice-commits] .: sc/source
sc/source/ui/view/cellsh1.cxx | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) New commits: commit c2a249f371eb8ac3bf70d92947efeb145566536b Author: Winfried Donkers Date: Mon Jan 14 16:05:33 2013 +0100 fdo#56098 Paste Special options after cut incorrect Change-Id: Icf6aa698e69a2271cf68f420ceaec4aaffe94ad0 Reviewed-on: https://gerrit.libreoffice.org/1671 Reviewed-by: Noel Power Tested-by: Noel Power diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 0c96dd5..c22d91d 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1271,18 +1271,15 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) { SCCOL nPosX = pData->GetCurX(); SCROW nPosY = pData->GetCurY(); -SCCOL nClipStartX, nClipSizeX; -SCROW nClipStartY, nClipSizeY; -pOwnClip->GetDocument()->GetClipStart( nClipStartX, nClipStartY ); +SCCOL nClipSizeX; +SCROW nClipSizeY; // for CutMode, filtered rows can always be included pOwnClip->GetDocument()->GetClipArea( nClipSizeX, nClipSizeY, sal_True ); int nDisableShift = 0; -if ( nClipStartX <= nPosX + nClipSizeX && -nPosX <= nClipStartX + nClipSizeX ) +if ( nPosX + 2 * nClipSizeX + 1 > MAXCOL ) // fdo#56098 + nDisableShift |= SC_CELL_SHIFT_DISABLE_RIGHT; +if ( nPosY + 2 * nClipSizeY + 1 > MAXROW ) // fdo#56098 nDisableShift |= SC_CELL_SHIFT_DISABLE_DOWN; -if ( nClipStartY <= nPosY + nClipSizeY && -nPosY <= nClipStartY + nClipSizeY ) -nDisableShift |= SC_CELL_SHIFT_DISABLE_RIGHT; if ( nDisableShift ) pDlg->SetCellShiftDisabled( nDisableShift ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/view/drawview.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit bdb66834887ec58cd9c602841c185a6629b13d6b Author: Noel Power Date: Wed Jan 23 15:25:41 2013 + don't use ScDrawLayer::GetObjDataTab to get Anchor fix for fdo#59325 Seems ScDrawLayer::GetObjDataTab was used mistakenly thinking that only an anchor for that tab would be returned ( but actually whatever anchor is returned gets the tab set ) Change-Id: I5d240f80a9974f6e4032875ed00350c94621bde7 diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 48a5504..e249e8c 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -756,7 +756,7 @@ void ScDrawView::SyncForGrid( SdrObject* pObj ) ScSplitPos eWhich = pViewData->GetActivePart(); ScGridWindow* pGridWin = (ScGridWindow*)pViewData->GetActiveWin(); -ScDrawObjData* pData = ScDrawLayer::GetObjDataTab( pObj, nTab ); +ScDrawObjData* pData = ScDrawLayer::GetObjData( pObj ); if ( pGridWin ) { ScAddress aOldStt; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/docshell/docsh.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 62bf434229f9f86469dea3123bc6180bd9979c2c Author: Markus Mohrhard Date: Tue Jan 22 23:50:47 2013 +0100 reset automatic row height flag after import, fdo#59193 Change-Id: Ied9cb4a2b6a17d8c7b65f4fec3cb17219a5afa5b diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index a2073b9..84b5364 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -473,11 +473,14 @@ sal_Bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::un // still need to recalc volatile formula cells. aDocument.CalcFormulaTree(false, true, false); +bool bAdjustHeightOld = aDocument.IsAdjustHeightEnabled(); aDocument.EnableAdjustHeight(false); aDocument.SetXMLFromWrapper( false ); AfterXMLLoading(bRet); +aDocument.EnableAdjustHeight(bAdjustHeightOld); + return bRet; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/inc/richstring.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit ca3859e781c1d63bde74fa21366b0fbde79c8ea7 Author: Michael Stahl Date: Tue Jan 22 18:45:15 2013 +0100 warning C4099: type name first seen using 'struct' now seen using 'class' Change-Id: I19cc56b0ab48435f1e20e03f23ed1bb0d984871d diff --git a/sc/source/filter/inc/richstring.hxx b/sc/source/filter/inc/richstring.hxx index 4815fa2..a0f8761 100644 --- a/sc/source/filter/inc/richstring.hxx +++ b/sc/source/filter/inc/richstring.hxx @@ -24,7 +24,7 @@ #include "stylesbuffer.hxx" class EditTextObject; -class ESelection; +struct ESelection; class ScEditEngineDefaulter; namespace com { namespace sun { namespace star { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/oox/worksheethelper.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit df70e3fee18835303cff17294b1fd21b6dd9146e Author: Noel Power Date: Tue Jan 22 13:58:35 2013 + blind fix for wae on macos Change-Id: Ib14021a2253fffd4badbf13db1f49a2309e4bb14 diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx index bfa7678..b993e34 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -69,6 +69,7 @@ #include "scitems.hxx" #include #include "editutil.hxx" +#include namespace oox { namespace xls { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/inc/richstring.hxx |7 +++ sc/source/filter/inc/workbookhelper.hxx |2 + sc/source/filter/oox/richstring.cxx | 58 + sc/source/filter/oox/stylesbuffer.cxx| 60 --- sc/source/filter/oox/workbookhelper.cxx | 26 + sc/source/filter/oox/worksheethelper.cxx | 15 --- 6 files changed, 141 insertions(+), 27 deletions(-) New commits: commit f54ce3e7f6d6aab7e34c54ad8eff06650e076fef Author: Noel Power Date: Tue Jan 22 11:58:20 2013 + lose uno api for font related xlsx import also fixes a bug where the font format of the first portion of a rich text string gets to be set as the default cell style for that cell Change-Id: Ib2e85e6f2a971940b94100c2bf45d85d8afa2869 diff --git a/sc/source/filter/inc/richstring.hxx b/sc/source/filter/inc/richstring.hxx index a279429..4815fa2 100644 --- a/sc/source/filter/inc/richstring.hxx +++ b/sc/source/filter/inc/richstring.hxx @@ -23,6 +23,10 @@ #include "oox/helper/refvector.hxx" #include "stylesbuffer.hxx" +class EditTextObject; +class ESelection; +class ScEditEngineDefaulter; + namespace com { namespace sun { namespace star { namespace text { class XText; } } } } @@ -68,7 +72,9 @@ public: /** Converts the portion and replaces or appends to the passed XText. */ voidconvert( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >& rxText, + const Font* pFont, bool bReplace ); +voidconvert( ScEditEngineDefaulter& rEE, ESelection& rSelection, const Font* pFont ); voidwriteFontProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >& rxText, @@ -250,6 +256,7 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >& rxText, bool bReplaceOld, const Font* pFirstPortionFont = 0 ) const; +::EditTextObject* convert( ScEditEngineDefaulter& rEE, const Font* pFont ) const; private: /** Creates, appends, and returns a new empty string portion. */ diff --git a/sc/source/filter/inc/workbookhelper.hxx b/sc/source/filter/inc/workbookhelper.hxx index a4265dc..0e1b87d 100644 --- a/sc/source/filter/inc/workbookhelper.hxx +++ b/sc/source/filter/inc/workbookhelper.hxx @@ -55,6 +55,7 @@ namespace oox { namespace core { } } class ScDocument; +class ScEditEngineDefaulter; namespace oox { namespace xls { @@ -146,6 +147,7 @@ public: // document model - ScDocument& getScDocument() const; +ScEditEngineDefaulter& getEditEngine() const; /** Returns a reference to the source/target spreadsheet document model. */ ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument > getDocument() const; diff --git a/sc/source/filter/oox/richstring.cxx b/sc/source/filter/oox/richstring.cxx index f262598..acbaea6 100644 --- a/sc/source/filter/oox/richstring.cxx +++ b/sc/source/filter/oox/richstring.cxx @@ -21,9 +21,11 @@ #include #include +#include #include "oox/helper/attributelist.hxx" #include "oox/helper/propertyset.hxx" #include "biffinputstream.hxx" +#include "editutil.hxx" namespace oox { namespace xls { @@ -112,6 +114,41 @@ void RichStringPortion::convert( const Reference< XText >& rxText, const Font* p } } +void RichStringPortion::convert( ScEditEngineDefaulter& rEE, ESelection& rSelection, const Font* pFont ) +{ +rSelection.nStartPos = rSelection.nEndPos; +rSelection.nStartPara = rSelection.nEndPara; +SfxItemSet aItemSet( rEE.GetEmptyItemSet() ); + +const Font* pFontToUse = mxFont.get() ? mxFont.get() : lclNeedsRichTextFormat( pFont ) ? pFont : NULL; + +if ( pFontToUse ) +pFontToUse->fillToItemSet( aItemSet, FONT_PROPTYPE_TEXT ); + +// #TODO need to manually adjust nEndPos ( and nEndPara ) to cater for any paragraphs +sal_Int32 nLastParaLoc = -1; +sal_Int32 nSearchIndex = maText.indexOf( '\n' ); +sal_Int32 nParaOccurence = 0; +while ( nSearchIndex != -1 ) +{ +nLastParaLoc = nSearchIndex; +++nParaOccurence; +rSelection.nEndPos = 0; +nSearchIndex = maText.indexOf( '\n', nSearchIndex + 1); +} + +rSelection.nEndPara += nParaOccurence; +if ( nLastParaLoc != -1 ) +{ +rSelection.nEndPos = maText.getLength() - 1 - nLastParaLoc; +} +else +{ +rSelection.nEndPos = rSelection.nStartPos + maText.getLength(); +} +rEE.QuickSetAttribs( aItemSet, rSelection ); +} + void RichStringPortion::writeFontProperties( const Reference& rxText, const Font* pFont ) const { PropertySet aPropSet(rxText); @@ -378,6 +415,27 @@ void RichString::convert( const Reference< XText
[Libreoffice-commits] .: sc/source
sc/source/ui/src/colorformat.src |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 208f8855a40d73aad1ee5086c7ee63b75376eade Author: Andras Timar Date: Tue Jan 22 09:55:59 2013 +0100 allow space for translated text expansion Change-Id: I5706fc9201359c05c00d0a97009994d7d188d5bf diff --git a/sc/source/ui/src/colorformat.src b/sc/source/ui/src/colorformat.src index 6333bf4..9e7b5b0 100644 --- a/sc/source/ui/src/colorformat.src +++ b/sc/source/ui/src/colorformat.src @@ -93,13 +93,13 @@ ModalDialog RID_SCDLG_DATABAR FixedText FT_POSITION { Pos = MAP_APPFONT( 10, 135 ); -Size = MAP_APPFONT( 70, 14 ); +Size = MAP_APPFONT( 110, 14 ); Text [ en-US ] = "Position of vertical axis"; }; FixedText FT_COLOR_AXIS { Pos = MAP_APPFONT( 10, 155 ); -Size = MAP_APPFONT( 70, 14 ); +Size = MAP_APPFONT( 110, 14 ); Text [ en-US ] = "Color of vertical axis"; }; ListBox LB_POS @@ -120,7 +120,7 @@ ModalDialog RID_SCDLG_DATABAR }; ListBox LB_COL_AXIS { -Pos = MAP_APPFONT( 100, 155 ); +Pos = MAP_APPFONT( 120, 155 ); Size = MAP_APPFONT( 60, 50 ); Border = TRUE; DropDown = TRUE; @@ -145,7 +145,7 @@ ModalDialog RID_SCDLG_DATABAR }; ListBox LB_AXIS_POSITION { -Pos = MAP_APPFONT( 100, 135 ); +Pos = MAP_APPFONT( 120, 135 ); Size = MAP_APPFONT( 50, 50 ); Border = TRUE; DropDown = TRUE; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/xml/xmlsubti.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 1b1f201b58b392a372ffc9070d41844997a2ec7d Author: Eike Rathke Date: Mon Jan 21 20:29:33 2013 +0100 it's a column count, so MAXCOLCOUNT instead of MAXCOL Number of repeated column styles were limited to MAXCOL effectively being MAXCOLCOUNT-1 and in an --enable-dbgutil build yielded lots of warnings when importing a document that has a style applied to all including the last column. For example see attachment of fdo#59583 https://bugs.freedesktop.org/attachment.cgi?id=73282 or fdo#59325 https://bugs.freedesktop.org/attachment.cgi?id=73014 Change-Id: I74dbbe3065a46015b0b7c8f61d58690a1c08c855 diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx index 1950e3c..c9f46b1 100644 --- a/sc/source/filter/xml/xmlsubti.cxx +++ b/sc/source/filter/xml/xmlsubti.cxx @@ -220,8 +220,8 @@ void ScMyTables::AddColStyle(const sal_Int32 nRepeat, const rtl::OUString& rCell { rImport.GetStylesImportHelper()->AddColumnStyle(rCellStyleName, nCurrentColCount, nRepeat); nCurrentColCount += nRepeat; -SAL_WARN_IF(nCurrentColCount > MAXCOL, "sc", "more columns than fit into SCCOL"); -nCurrentColCount = std::min( nCurrentColCount, MAXCOL ); +SAL_WARN_IF(nCurrentColCount > MAXCOLCOUNT, "sc", "more columns than fit into SCCOL"); +nCurrentColCount = std::min( nCurrentColCount, MAXCOLCOUNT ); } uno::Reference< drawing::XDrawPage > ScMyTables::GetCurrentXDrawPage() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/tool/compiler.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit aa2b8bde171bf9562536dc14b2cf81d81e31b438 Author: Eike Rathke Date: Mon Jan 21 17:56:25 2013 +0100 resolved fdo#59583 prevent inappropriate column/row label detection If followed by '(' (with or without space inbetween) an identifier can not be a column/row label. Prevent arbitrary content detection in case a macro function of the same name is meant (fdo#59583) or if it wouldn't resolve to a known function name at all, that earlier resulted in #REF! instead of #NAME? in the case of unknown function but label found. Change-Id: Id36a0c9ebad2d62867b4f9fe00ae78d464e77109 diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 7b7ab88..ac0d10b 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -3686,7 +3686,9 @@ bool ScCompiler::NextNewToken( bool bInArray ) return true; if (IsDBRange( aUpper )) return true; -if (IsColRowName( aUpper )) +// If followed by '(' (with or without space inbetween) it can not be a +// column/row label. Prevent arbitrary content detection. +if (!bMayBeFuncName && IsColRowName( aUpper )) return true; if (bMayBeFuncName && IsMacro( aUpper )) return true; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/xml/xmlcondformat.cxx |8 1 file changed, 8 insertions(+) New commits: commit d7728bb63086a73594fb59d6b0d55cf4975f0fc1 Author: Markus Mohrhard Date: Sun Jan 20 10:56:10 2013 +0100 add missing data bar axis import, fdo#59578 Change-Id: Id035741b2372c76f9afe54f59f2203c5edfbb0ae diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx index e3f3903..1f0a31b 100644 --- a/sc/source/filter/xml/xmlcondformat.cxx +++ b/sc/source/filter/xml/xmlcondformat.cxx @@ -254,6 +254,14 @@ ScXMLDataBarFormatContext::ScXMLDataBarFormatContext( ScXMLImport& rImport, sal_ else mpFormatData->mbNeg = false; +if(!sAxisPosition.isEmpty()) +{ +if(sAxisPosition == "middle") +mpFormatData->meAxisPosition = databar::MIDDLE; +else if (sAxisPosition == "none") +mpFormatData->meAxisPosition = databar::NONE; +} + if(!sAxisColor.isEmpty()) { sal_Int32 nColor = 0; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/tool/autoform.cxx | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) New commits: commit c228103ce6a5efe60de553073a9b20d977478bf5 Author: Julien Nabet Date: Sat Jan 19 10:11:24 2013 +0100 2 small fixes Variable 'bRet' is reassigned ++it without checking it != itEnd Change-Id: I3bdb8fa723cca8a132dc7aa6b5c5e3c7bd0861cf diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx index 54ee367..4e14754 100644 --- a/sc/source/core/tool/autoform.cxx +++ b/sc/source/core/tool/autoform.cxx @@ -1099,13 +1099,19 @@ bool ScAutoFormat::Save() osl_getThreadTextEncoding() ); m_aVersions.Write(rStream, fileVersion); -bRet = (rStream.GetError() == 0); +bRet &= (rStream.GetError() == 0); + //--- rStream << (sal_uInt16)(maData.size() - 1); -bRet = (rStream.GetError() == 0); +bRet &= (rStream.GetError() == 0); MapType::iterator it = maData.begin(), itEnd = maData.end(); -for (++it; bRet && it != itEnd; ++it) // Skip the first item. -bRet = it->second->Save(rStream, fileVersion); +if (it != itEnd) +{ +for (++it; bRet && it != itEnd; ++it) // Skip the first item. +{ +bRet &= it->second->Save(rStream, fileVersion); +} +} rStream.Flush(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/data/column.cxx |9 + 1 file changed, 9 insertions(+) New commits: commit 3fd16d489ef402893ee8df6913e6bd011d61d1fa Author: Kohei Yoshida Date: Fri Jan 18 15:55:41 2013 -0500 Try not to leak removed cell instances. Change-Id: I25da4a34a3e53bc001519194729e613eef167713 diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 8520dc3..01f85fe 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1216,6 +1216,14 @@ public: } }; +struct DeleteCell : std::unary_function +{ +void operator() (ColEntry& rEntry) +{ +rEntry.pCell->Delete(); +} +}; + } void ScColumn::CopyStaticToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDestCol) @@ -1230,6 +1238,7 @@ void ScColumn::CopyStaticToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDestCol if (it != rDestCol.maItems.end()) { itEnd = std::find_if(it, rDestCol.maItems.end(), FindAboveRow(nRow2)); +std::for_each(it, itEnd, DeleteCell()); rDestCol.maItems.erase(it, itEnd); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/app/scmod.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 6d36a31df1726e45d5c4e3623354afe5c5ab814d Author: Markus Mohrhard Date: Fri Jan 18 14:14:32 2013 +0100 make sure we call SetInRefMode only once Change-Id: I16ff8b6aaa24b1f8522117197226db39f0617fad diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 9f406d7..d4ed9da 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -2317,6 +2317,11 @@ void ScModule::PushNewAnyRefDlg( ScAnyRefModalDlg* pNewDlg ) { maAnyRefDlgStack.push( pNewDlg ); +// prevent mismatch between calls to +// SetInRefMode(true) and SetInRefMode(false) +if(maAnyRefDlgStack.size() != 1) +return; + SfxViewShell* pViewShell = SfxViewShell::GetFirst(); while(pViewShell) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/view/cellsh1.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 1de8d78a8ee6ddd6f2b175330fcb709f56b35960 Author: Markus Mohrhard Date: Fri Jan 18 14:07:25 2013 +0100 don't create multiple dialogs in the loop, fdo#59314 Change-Id: Ia48262cdf8b07caf6622f2d4a48f366f3f26c0fd diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 6d434ce..4654596 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1803,6 +1803,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) // found a matching range, edit this conditional format nKey = pCondFormat->GetKey(); pCondFormatDlg.reset( new ScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE ) ); +break; } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/dbgui/tpsort.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 7af886d7784b321e6cda2a870b514607e355b112 Author: Markus Mohrhard Date: Fri Jan 18 10:17:57 2013 +0100 reset one of the sort containers before refilling, fdo#57465 Change-Id: I758af67efec980a56ec83d8e5e6f5f60a0523ac5 diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index 6688166..78d04ac 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -358,6 +358,8 @@ void ScTabPageSortFields::FillFieldLists( sal_uInt16 nStartField ) SCROW nFirstSortRow = aSortData.nRow1; SCTAB nTab= pViewData->GetTabNo(); sal_uInt16 i = 1; +nFieldArr.clear(); +nFieldArr.push_back(0); if ( bSortByRows ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/xml/xmlcelli.cxx | 34 -- 1 file changed, 28 insertions(+), 6 deletions(-) New commits: commit 7f4269b9798c348b1ede4ad0d777f6a0977b7e16 Author: Markus Mohrhard Date: Tue Jan 15 05:13:17 2013 +0100 for error value in matrix force recalc, fdo#59293 Change-Id: I202526bb3cf6e0f6c55913b44a15694e0794e273 diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 25579f2..edf309bc 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -736,7 +736,7 @@ void ScXMLTableRowCellContext::SetFormulaCell(ScFormulaCell* pFCell) const pFCell->SetHybridDouble(fValue); pFCell->ResetDirty(); } - +pFCell->StartListeningTo(rXMLImport.GetDocument()); // Leave the cell dirty when the cached result is not given. } } @@ -754,15 +754,36 @@ void ScXMLTableRowCellContext::PutTextCell( const ScAddress& rCurrentPos, if ( bDoIncrement ) { ScFormulaCell* pFCell = static_cast(pCell); +OUString aCellString; if (pOUTextValue && !pOUTextValue->isEmpty()) -pFCell->SetHybridString( *pOUTextValue ); +aCellString = *pOUTextValue; else if (pOUTextContent && !pOUTextContent->isEmpty()) -pFCell->SetHybridString( *pOUTextContent ); +aCellString = *pOUTextContent; else if ( nCurrentCol > 0 && pOUText && !pOUText->isEmpty() ) -pFCell->SetHybridString( *pOUText ); +aCellString = *pOUText; else bDoIncrement = false; -pFCell->ResetDirty(); + +if(!aCellString.isEmpty()) +{ +if (bDoIncrement && !GetScImport().IsFormulaErrorConstant(aCellString)) +{ +pFCell->SetHybridString( aCellString ); +pFCell->ResetDirty(); +} +else +{ +ScAddress aTopLeftMatrixCell; +if(pFCell->GetMatrixOrigin(aTopLeftMatrixCell)) +{ +ScBaseCell* pMatrixCell = rXMLImport.GetDocument()->GetCell( aTopLeftMatrixCell ); +static_cast(pMatrixCell)->SetDirty(); +} +else +SAL_WARN("sc", "matrix cell without matrix"); +} +} +pFCell->StartListeningTo(rXMLImport.GetDocument()); } } else //regular text cells @@ -800,6 +821,7 @@ void ScXMLTableRowCellContext::PutValueCell( const ScAddress& rCurrentPos ) ScFormulaCell* pFCell = static_cast(pCell); SetFormulaCell(pFCell); } + } else //regular value cell { @@ -1036,7 +1058,6 @@ void ScXMLTableRowCellContext::PutFormulaCell( const ScAddress& rCellPos ) pNewCell = new ScFormulaCell( pDoc, rCellPos, pCode.get(), eGrammar, MM_NONE ); ScFormulaCell* pFCell = static_cast(pNewCell); -pFCell->StartListeningTo(pDoc); SetFormulaCell(pFCell); } else if ( aText[0] == '\'' && aText.getLength() > 1 ) @@ -1105,6 +1126,7 @@ void ScXMLTableRowCellContext::AddFormulaCell( const ScAddress& rCellPos ) nMatrixCols, nMatrixRows, pMat, new formula::FormulaDoubleToken(fValue)); pFCell->ResetDirty(); } +pFCell->StartListeningTo(rXMLImport.GetDocument()); } } else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/oox/formulabase.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 42a9b2399e6bbe4f29347da9933b02dd2d9ad1ca Author: Eike Rathke Date: Sat Jan 12 20:50:10 2013 +0100 fdo#59292 OOXML TDIST is ODF LEGACY.TDIST Commit 3deb83d7a74a0fe026791e7a336ac6ffad9c0026 correctly renamed ODF TDIST to LEGACY.TDIST but did not adapt the OOXML filter mapping. Change-Id: I107859722ac0e9f7ff9725f1d55080340973d86e diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx index 6c2441d..961db1a 100644 --- a/sc/source/filter/oox/formulabase.cxx +++ b/sc/source/filter/oox/formulabase.cxx @@ -505,7 +505,7 @@ static const FunctionData saFuncTableBiff4[] = { "ODD","ODD", 298,298,1, 1, V, { VR }, 0 }, { "PERMUT", "PERMUT", 299,299,2, 2, V, { VR }, 0 }, { "POISSON","POISSON", 300,300,3, 3, V, { VR }, 0 }, -{ "TDIST", "TDIST",301,301,3, 3, V, { VR }, 0 }, +{ "LEGACY.TDIST", "TDIST",301,301,3, 3, V, { VR }, 0 }, { "WEIBULL","WEIBULL", 302,302,4, 4, V, { VR }, 0 }, { "SUMXMY2","SUMXMY2", 303,303,2, 2, V, { VA }, 0 }, { "SUMX2MY2", "SUMX2MY2", 304,304,2, 2, V, { VA }, 0 }, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/oox/formulabase.cxx |4 1 file changed, 4 insertions(+) New commits: commit bad3ddbbb0fbef8a39cbe89db77d7c7053edf0ed Author: Eike Rathke Date: Sat Jan 12 20:22:56 2013 +0100 OpCodeProviderImpl::initFuncOpCode: warn if there is no opcode mapping During loading an xlsx document in an --enable-dbgutil build OpCodeProviderImpl::OpCodeProviderImpl() spits out a warning "OpCodeProviderImpl::OpCodeProviderImpl - opcodes not initialized" OpCodeProviderImpl::initFuncOpCode() now gives a clue which. Change-Id: Ia0bc53ce5a590e6904c660cd725d907efa5a731d diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx index 847beee..6c2441d 100644 --- a/sc/source/filter/oox/formulabase.cxx +++ b/sc/source/filter/oox/formulabase.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include "oox/core/filterbase.hxx" #include "oox/helper/containerhelper.hxx" #include "oox/token/properties.hxx" @@ -1228,6 +1229,9 @@ bool OpCodeProviderImpl::initFuncOpCode( FunctionInfo& orFuncInfo, const ApiToke { // ignore entries for functions unknown by Calc *and* by Excel bIsValid = orFuncInfo.maOoxFuncName.isEmpty(); +SAL_WARN_IF( !bIsValid, "sc", +"OpCodeProviderImpl::initFuncOpCode - no opcode mapping for function ODF '" << +orFuncInfo.maOdfFuncName << "' <-> OOXML '" << orFuncInfo.maOoxFuncName << "'"); } } else if( orFuncInfo.mnBiffFuncId == BIFF_FUNC_EXTERNCALL ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/src/condformatdlg.src |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit d928a8198a4ec9a45228b18bfb221195bdae6bbd Author: Markus Mohrhard Date: Sat Jan 12 07:31:03 2013 +0100 make the list box a bit larger, fdo#58609 Change-Id: I862ee7e20a7e534286785a12508a6442f78c diff --git a/sc/source/ui/src/condformatdlg.src b/sc/source/ui/src/condformatdlg.src index 22ca8fe..ae5fc86 100644 --- a/sc/source/ui/src/condformatdlg.src +++ b/sc/source/ui/src/condformatdlg.src @@ -113,9 +113,10 @@ Control RID_COND_ENTRY ListBox LB_TYPE { Pos = MAP_APPFONT( 5, 15 ); -Size = MAP_APPFONT( 80, 40 ); +Size = MAP_APPFONT( 80, 60 ); Border = TRUE; DropDown = TRUE; +DDExtraWidth = TRUE; StringList [ en-US ] = { "All Cells"; @@ -130,6 +131,7 @@ Control RID_COND_ENTRY Size = MAP_APPFONT( 80, 80 ); Border = TRUE; DropDown = TRUE; +DDExtraWidth = TRUE; StringList [ en-US ] = { "equal to"; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/docshell/dbdocfun.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 13d50871e328a640a5baa283cf669407738e8cdd Author: Kohei Yoshida Date: Sat Jan 12 00:30:49 2013 -0500 Maybe this will make the Windows tinderbox happy... Change-Id: I9e838d2e4cadd79c55a5648b006f40d3dcd04518 diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index e25dda0..f67b2cd 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1223,13 +1223,13 @@ bool isEditable(ScDocShell& rDocShell, const ScRangeList& rRanges, bool bApi) SAL_WNODEPRECATED_DECLARATIONS_PUSH void createUndoDoc(std::auto_ptr& pUndoDoc, ScDocument* pDoc, const ScRange& rRange) -SAL_WNODEPRECATED_DECLARATIONS_POP { SCTAB nTab = rRange.aStart.Tab(); pUndoDoc.reset(new ScDocument(SCDOCMODE_UNDO)); pUndoDoc->InitUndo(pDoc, nTab, nTab); pDoc->CopyToDocument(rRange, IDF_ALL, false, pUndoDoc.get()); } +SAL_WNODEPRECATED_DECLARATIONS_POP bool checkNewOutputRange(ScDPObject& rDPObj, ScDocShell& rDocShell, ScRange& rNewOut, bool bApi) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/docshell/docsh.cxx |4 +++- sc/source/ui/src/globstr.src|2 +- sc/source/ui/src/optdlg.src |2 +- 3 files changed, 5 insertions(+), 3 deletions(-) New commits: commit e610e5f28e4b2b774a897ee7cf6d8098ade30a7f Author: Caolán McNamara Date: Fri Jan 11 12:38:03 2013 + Resolves: fdo#58865 hard-coded LibreOffice strings Change-Id: Ie03106c3089f6d1bc0172a2e2c702b5725e55acf Reviewed-on: https://gerrit.libreoffice.org/1656 Tested-by: Kohei Yoshida Reviewed-by: Kohei Yoshida diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 2c35c01..a2073b9 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -102,6 +102,7 @@ #include #include #include +#include #include "uiitems.hxx" #include "cellsuno.hxx" #include "dpobject.hxx" @@ -438,7 +439,8 @@ sal_Bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::un bool bHardRecalc = false; if (nRecalcMode == RECALC_ASK) { -if (aDocument.IsUserInteractionEnabled() && xDocProps->getGenerator().indexOf("LibreOffice") == -1) +OUString sProductName(utl::ConfigManager::getProductName()); +if (aDocument.IsUserInteractionEnabled() && xDocProps->getGenerator().indexOf(sProductName) == -1) { // Generator is not LibreOffice. Ask if the user wants to perform // full re-calculation. diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src index a5ac8b2..9f9b259 100644 --- a/sc/source/ui/src/globstr.src +++ b/sc/source/ui/src/globstr.src @@ -1953,7 +1953,7 @@ Resource RID_GLOBSTR String STR_QUERY_FORMULA_RECALC_ONLOAD_ODS { -Text [ en-US ] = "This document was last saved by application other than LibreOffice. Some formula cells may produce different results when recalculated.\n\nDo you want to recalculate all formula cells in this document now?"; +Text [ en-US ] = "This document was last saved by an application other than %PRODUCTNAME. Some formula cells may produce different results when recalculated.\n\nDo you want to recalculate all formula cells in this document now?"; }; String STR_QUERY_FORMULA_RECALC_ONLOAD_XLS diff --git a/sc/source/ui/src/optdlg.src b/sc/source/ui/src/optdlg.src index 4f6f5ab..9004396 100644 --- a/sc/source/ui/src/optdlg.src +++ b/sc/source/ui/src/optdlg.src @@ -317,7 +317,7 @@ TabPage RID_SCPAGE_FORMULA { Pos = MAP_APPFONT ( 21, 165 ); Size = MAP_APPFONT ( 120, 8 ); -Text [ en-US ] = "ODF Spreadsheet (not saved by LibreOffice)"; +Text [ en-US ] = "ODF Spreadsheet (not saved by %PRODUCTNAME)"; }; ListBox LB_ODF_RECALC ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/docshell/dbdocfun.cxx |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit 823ab0f98c81e68847b7a0e0667329c679b37f6c Author: Michael Stahl Date: Fri Jan 11 19:55:45 2013 +0100 ScDBDocFunc::UpdatePivotTable: -Werror=deprecated-declarations Change-Id: I0d1b8176c9796ae39bc692d48e4481bdedb6ff09 diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index d0e3ebb..1f09610 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1453,8 +1453,10 @@ bool ScDBDocFunc::UpdatePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi) ScDocShellModificator aModificator( rDocShell ); WaitObject aWait( rDocShell.GetActiveDialogParent() ); +SAL_WNODEPRECATED_DECLARATIONS_PUSH std::auto_ptr pOldUndoDoc; std::auto_ptr pNewUndoDoc; +SAL_WNODEPRECATED_DECLARATIONS_POP ScDPObject aUndoDPObj(rDPObj); // For undo or revert on failure. @@ -1573,11 +1575,11 @@ bool ScDBDocFunc::UpdatePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi) if (bRecord) { -std::auto_ptr pAction( +SfxUndoAction *const pAction( new ScUndoDataPilot( &rDocShell, pOldUndoDoc.release(), pNewUndoDoc.release(), &aUndoDPObj, &rDPObj, false)); -rDocShell.GetUndoManager()->AddUndoAction(pAction.release()); +rDocShell.GetUndoManager()->AddUndoAction(pAction); } // notify API objects ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source xmloff/inc xmloff/source
sc/source/filter/xml/xmlstyle.cxx | 24 ++ sc/source/filter/xml/xmlstyle.hxx |7 +++ sc/source/filter/xml/xmlstyli.cxx | 83 ++ sc/source/ui/unoobj/cellsuno.cxx |2 sc/source/ui/unoobj/styleuno.cxx |1 xmloff/inc/xmloff/xmlprcon.hxx|2 xmloff/inc/xmloff/xmltoken.hxx|1 xmloff/source/core/xmltoken.cxx |1 8 files changed, 119 insertions(+), 2 deletions(-) New commits: commit 066bdb31f7ff801b7a36c79c43ecbd527ffb2a88 Author: Noel Power Date: Fri Jan 11 09:52:39 2013 + support saving/loading hyperlink cell attribute in extended odf style:table-cell-properties has new child element style:hyperlink which will store the hyperlink info in attributes xlink:href & xlink:type Change-Id: I184310d124c4242cd62fdabb45f9773094cfc229 diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx index a40e833..e81a173 100644 --- a/sc/source/filter/xml/xmlstyle.cxx +++ b/sc/source/filter/xml/xmlstyle.cxx @@ -79,6 +79,7 @@ const XMLPropertyMapEntry aXMLScCellStylesProperties[] = 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 ), +MAP_EXT( SC_UNONAME_HYPERLINK, XML_NAMESPACE_STYLE, XML_HYPERLINK, XML_TYPE_PROP_TABLE_CELL | XML_TYPE_STRING | MID_FLAG_ELEMENT_ITEM, CTF_SC_HYPERLINK ), MAP_EXT( SC_UNONAME_CELLHJUS_METHOD, XML_NAMESPACE_CSS3TEXT, XML_TEXT_JUSTIFY, XML_TYPE_PROP_PARAGRAPH|XML_SC_TYPE_HORIJUSTIFY_METHOD, 0 ), MAP( "IsCellBackgroundTransparent", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_ISTRANSPARENT|MID_FLAG_MULTI_PROPERTY|MID_FLAG_MERGE_ATTRIBUTE, 0 ), MAP( "IsTextWrapped", XML_NAMESPACE_FO, XML_WRAP_OPTION, XML_TYPE_PROP_TABLE_CELL|XML_SC_ISTEXTWRAPPED, 0 ), @@ -107,7 +108,6 @@ const XMLPropertyMapEntry aXMLScCellStylesProperties[] = MAP( "ValidationXML", XML_NAMESPACE_TABLE, XML_CONTENT_VALIDATION, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BUILDIN_CMP_ONLY, CTF_SC_VALIDATION ), MAP( "VertJustify", XML_NAMESPACE_STYLE, XML_VERTICAL_ALIGN, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_VERTJUSTIFY, 0), MAP_EXT( SC_UNONAME_CELLVJUS_METHOD, XML_NAMESPACE_STYLE, XML_VERTICAL_JUSTIFY, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_VERTJUSTIFY_METHOD, 0 ), - MAP_END() }; @@ -520,6 +520,28 @@ void ScXMLCellExportPropertyMapper::handleSpecialItem( // the SpecialItem ConditionlaFormat must not be handled by this method // the SpecialItem CharBackColor must not be handled by this method } +void ScXMLCellExportPropertyMapper::handleElementItem( +SvXMLExport& rExport, +const XMLPropertyState& rProperty, +sal_uInt16 nFlags, +const ::std::vector< XMLPropertyState > *pProperties, +sal_uInt32 nIdx ) const +{ +sal_uInt32 nContextId = getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ); +OUString sURL; +if ( ( nContextId == CTF_SC_HYPERLINK ) && +( rProperty.maValue >>= sURL ) && +!sURL.isEmpty() ) +{ +rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sURL ); +rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, + XML_SIMPLE ); +sal_uInt32 nPropIndex = rProperty.mnIndex; +sal_uInt16 nPrefix = getPropertySetMapper()->GetEntryNameSpace( nPropIndex ); +OUString sLocalName = getPropertySetMapper()->GetEntryXMLName( nPropIndex ); +SvXMLElementExport aElem( rExport, nPrefix, sLocalName, sal_True, sal_True ); +} +} ScXMLRowExportPropertyMapper::ScXMLRowExportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper ) diff --git a/sc/source/filter/xml/xmlstyle.hxx b/sc/source/filter/xml/xmlstyle.hxx index 85c971b..feb62e5 100644 --- a/sc/source/filter/xml/xmlstyle.hxx +++ b/sc/source/filter/xml/xmlstyle.hxx @@ -94,6 +94,7 @@ extern const XMLPropertyMapEntry aXMLScTableStylesImportProperties[]; #define CTF_SC_ISVISIBLE(XML_SC_CTF_START + 53) #define CTF_SC_MASTERPAGENAME (XML_SC_CTF_START + 53) +#define CTF_SC_HYPERLINK(XML_SC_CTF_START + 54) //ColumnStyles #define XML_SC_TYPE_BREAKBEFORE (XML_SC_TYPES_START + 50) @@ -112,6 +113,12 @@ public: ScXMLCellExportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper ); virtual ~ScXMLCellExportPropertyMapper(); +virtual void handleElementItem( +SvXMLExport& rExport, +const XMLPropertyState& rProperty, +
[Libreoffice-commits] .: sc/source
sc/source/ui/docshell/dbdocfun.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit 6e0b18ddde4310f85d3d6b7c27a93f78b541d976 Author: Kohei Yoshida Date: Fri Jan 11 00:04:13 2013 -0500 Makes no sense to 'continue' at the end of the block. Change-Id: I2b02430944c5c6ecf67d2b7cd02c66bb549c93f9 diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 94d4f1f..3b1db2f 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1465,8 +1465,7 @@ sal_uLong ScDBDocFunc::RefreshPivotTables(ScDPObject* pDPObj, bool bApi) ScDPObject* pObj = *it; // This action is intentionally not undoable since it modifies cache. -if (!DataPilotUpdate(pObj, pObj, false, bApi)) -continue; +DataPilotUpdate(pObj, pObj, false, bApi); } return 0; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/dbgui/sortkeydlg.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 2c403c7f36561410418ebb9f86664e46a8c1c968 Author: Caolán McNamara Date: Thu Jan 10 13:49:20 2013 + Resolves: fdo#59112 re-scroll to current entry when dialog resized Change-Id: I96486f6edad11520bf9bb43b700b1716d9b2f170 diff --git a/sc/source/ui/dbgui/sortkeydlg.cxx b/sc/source/ui/dbgui/sortkeydlg.cxx index 76a8747..211afcc 100644 --- a/sc/source/ui/dbgui/sortkeydlg.cxx +++ b/sc/source/ui/dbgui/sortkeydlg.cxx @@ -126,6 +126,7 @@ void ScSortKeyCtrl::setScrollRange() sal_Int32 nVisibleItems = m_rScrolledWindow.getVisibleChildSize().Height() / nScrollOffset; m_rVertScroll.SetPageSize( nVisibleItems - 1 ); m_rVertScroll.SetVisibleSize( nVisibleItems ); +m_rVertScroll.Scroll(); } // --- ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/xml/xmlexprt.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit d158a09e56e3944458d63a6c572f60dbe4632dad Author: Markus Mohrhard Date: Thu Jan 10 03:59:57 2013 +0100 handle shapes anchored to the wrong sheet without crash, fdo#58858 Change-Id: I00d127dbb6151e3100be931079cbf8907ac69ddd diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 7ac0351..3e4599e 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -693,7 +693,10 @@ void ScXMLExport::CollectSharedData(sal_Int32& nTableCount, sal_Int32& nShapesCo { ScMyShape aMyShape; aMyShape.aAddress = pAnchor->maStart; +SAL_WARN_IF(aMyShape.aAddress.Tab() != nTable, "sc", "not anchored to current sheet!"); +aMyShape.aAddress.SetTab(nTable); aMyShape.aEndAddress = pAnchor->maEnd; +aMyShape.aEndAddress.SetTab( nTable ); aMyShape.nEndX = pAnchor->maEndOffset.X(); aMyShape.nEndY = pAnchor->maEndOffset.Y(); aMyShape.xShape = xShape; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/condformat/condformatdlgentry.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 028c21ba5075edc90f1367061b294ef392e66ec7 Author: Markus Mohrhard Date: Wed Jan 9 07:20:13 2013 +0100 accidently moved that line around Change-Id: I8a6bbe161a91140e1ee2aca36ba848a02286108f diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 3406982..487842a 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -506,7 +506,6 @@ ScFormulaFrmtEntry::ScFormulaFrmtEntry( Window* pParent, ScDocument* pDoc, const FreeResource(); maLbType.SelectEntryPos(2); -maLbColorFormat.SelectEntryPos(1); if(pFormat) { @@ -816,6 +815,7 @@ ScColorScale3FrmtEntry::ScColorScale3FrmtEntry( Window* pParent, ScDocument* pDo maLbEntryTypeMin.RemoveEntry(0); maLbEntryTypeMiddle.RemoveEntry(0); maLbEntryTypeMax.RemoveEntry(0); +maLbColorFormat.SelectEntryPos(1); Init(); maLbType.SelectEntryPos(0); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source sd/source
sc/source/filter/xml/xmlwrap.cxx |4 ++-- sc/source/ui/docshell/docsh.cxx |2 +- sc/source/ui/docshell/docsh8.cxx |4 ++-- sd/source/filter/xml/sdxmlwrp.cxx |4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) New commits: commit 371727c78fdfd80b4d4ec33dc2129da96c38e777 Author: Stephan Bergmann Date: Tue Jan 8 12:59:15 2013 +0100 DynamicErrorInfo objects must be allocated on the heap cf. "delete pInfo;" in ErrorHandler::HandleError_Impl (tools/source/ref/errinf.cxx). This reverts the remaining (non UNO related) changes from e48d47469508dee55ae6abcb3988222b5612e1e9 "fix some memory leaks in sc" and 5ea7e74c29f7279b6c31d38185ace576f68f4fb2 "fix some memory leaks in sd" that had not already been reverted. Whether any of these instantiations are really leaked (i.e., never deleted again in calls to ErrorHandler::HandleError_Impl) is unclear to me, but that would need to be fixed in a different way. Change-Id: I6d9e7a2f6fce6d6a4d5d390c09a5a12f593028a6 diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index 439e5e6..5913788 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -219,7 +219,7 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Referencehttp://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/src/colorformat.src |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 002531190d88c7e8f7dc9287af32d54c56b5495a Author: Markus Mohrhard Date: Tue Jan 8 02:47:17 2013 +0100 correct label for data bar dialog, fdo#58608 Change-Id: I91cdb23a25092f44ff76784b5347134a3c9a3528 diff --git a/sc/source/ui/src/colorformat.src b/sc/source/ui/src/colorformat.src index 2cc5852..6333bf4 100644 --- a/sc/source/ui/src/colorformat.src +++ b/sc/source/ui/src/colorformat.src @@ -52,7 +52,7 @@ ModalDialog RID_SCDLG_DATABAR { Pos = MAP_APPFONT( 5, 5 ); Size = MAP_APPFONT( 190, 10 ); -Text [ en-US ] = "Bar Colors"; +Text [ en-US ] = "Entry Values"; }; FixedLine FL_BAR_COLORS { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/unoobj/scdetect.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 9b62bbc91e91b6b724dbf95c6977cc6cc049edb1 Author: Stephan Bergmann Date: Mon Jan 7 12:40:15 2013 +0100 UNO objects must be allocated on the heap This was a regression introduced with e48d47469508dee55ae6abcb3988222b5612e1e9 "fix some memory leaks in sc." Change-Id: I482516d31b857801c321ed252d19f06b4b11542e diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx index 9ef418e..53c69f8 100644 --- a/sc/source/ui/unoobj/scdetect.cxx +++ b/sc/source/ui/unoobj/scdetect.cxx @@ -930,7 +930,8 @@ OUString ScFilterDetect::impl_getStaticImplementationName() /* Helper for registry */ UNOREFERENCE< UNOXINTERFACE > SAL_CALL ScFilterDetect::impl_createInstance( const UNOREFERENCE< UNOXMULTISERVICEFACTORY >& xServiceManager ) throw( UNOEXCEPTION ) { -return UNOREFERENCE< UNOXINTERFACE >( ScFilterDetect( xServiceManager ) ); +return static_cast< cppu::OWeakObject * >( +new ScFilterDetect( xServiceManager ) ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/xml/xmlwrap.cxx |4 ++-- sc/source/ui/docshell/docsh.cxx |2 +- sc/source/ui/docshell/docsh8.cxx |4 ++-- sc/source/ui/unoobj/scdetect.cxx |2 +- 4 files changed, 6 insertions(+), 6 deletions(-) New commits: commit e48d47469508dee55ae6abcb3988222b5612e1e9 Author: Markus Mohrhard Date: Sun Jan 6 23:34:38 2013 +0100 fix some memory leaks in sc Change-Id: I1e3b9a55561f941346cb9f553f960dc2bafbb1b6 diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index 5913788..439e5e6 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -219,7 +219,7 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference SAL_CALL ScFilterDetect::impl_createInstance( const UNOREFERENCE< UNOXMULTISERVICEFACTORY >& xServiceManager ) throw( UNOEXCEPTION ) { -return UNOREFERENCE< UNOXINTERFACE >( *new ScFilterDetect( xServiceManager ) ); +return UNOREFERENCE< UNOXINTERFACE >( ScFilterDetect( xServiceManager ) ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/data/dpobject.cxx |8 ++-- sc/source/ui/dbgui/pvlaydlg.cxx |2 -- 2 files changed, 2 insertions(+), 8 deletions(-) New commits: commit 107cb122e962df7fff51f746a65cee91b2c71d22 Author: Kohei Yoshida Date: Thu Jan 3 20:28:07 2013 -0500 fdo#58004: Let's remove these upper bound truncation. We may still need to set an upper bound, but we shouldn't do these all over the place. Apparently we now allow more than 256 fields, so doing this would only break things for fields whose indices are greater than 255. Change-Id: Ic2e374ec01267044c2e40664775e7f62b1461f41 diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 3c43378..69e7901 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -2138,9 +2138,7 @@ bool ScDPObject::FillLabelData(sal_Int32 nDim, ScDPLabelData& rLabels) uno::Reference xDimsName = xSource->getDimensions(); uno::Reference xDims = new ScNameToIndexAccess( xDimsName ); sal_Int32 nDimCount = xDims->getCount(); -if ( nDimCount > SC_DP_MAX_FIELDS ) -nDimCount = SC_DP_MAX_FIELDS; -if (!nDimCount || nDim >= nDimCount) +if (nDimCount <= 0 || nDim >= nDimCount) return false; return FillLabelDataForDimension(xDims, nDim, rLabels); @@ -2157,9 +2155,7 @@ bool ScDPObject::FillLabelData(ScPivotParam& rParam) uno::Reference xDimsName = xSource->getDimensions(); uno::Reference xDims = new ScNameToIndexAccess( xDimsName ); sal_Int32 nDimCount = xDims->getCount(); -if ( nDimCount > SC_DP_MAX_FIELDS ) -nDimCount = SC_DP_MAX_FIELDS; -if (!nDimCount) +if (nDimCount <= 0) return false; for (sal_Int32 nDim = 0; nDim < nDimCount; ++nDim) diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index 86a3069..9f01ab2 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -289,8 +289,6 @@ sal_Bool ScPivotLayoutDlg::Close() void ScPivotLayoutDlg::InitWndSelect(const ScDPLabelDataVector& rLabels) { size_t nLabelCount = rLabels.size(); -if (nLabelCount > SC_DP_MAX_FIELDS) -nLabelCount = SC_DP_MAX_FIELDS; maLabelData.clear(); maLabelData.reserve( nLabelCount ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/data/dpoutput.cxx | 178 +-- 1 file changed, 99 insertions(+), 79 deletions(-) New commits: commit c9db8c02a38bfff08a9bae3b2901c316a4f3eabe Author: Kohei Yoshida Date: Thu Jan 3 14:50:18 2013 -0500 fdo#58004: Apply source number format over one specified by the style. Pivot table output applies several pre-defined styles, which also include number formats. But, the source number format, or one set by the pivot table should take precedence over the one specified by the style, or else it would lead to a very peculiar behavior. This is especially the case when the documnet has its 'Default' style specify a number format that's not 'General'. Also, we should take all number formats into account, including the ones that are 0. Change-Id: Ifa794314a2881c5146e24eb7be892585a823048d diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 1a3022d..be2518c 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -81,6 +81,7 @@ struct ScDPOutLevelData longnHier; longnLevel; longnDimPos; +sal_uInt32 mnSrcNumFmt; /// Prevailing number format used in the source data. uno::Sequence aResult; rtl::OUString maName; /// Name is the internal field name. rtl::OUString maCaption; /// Caption is the name visible in the output table. @@ -89,7 +90,7 @@ struct ScDPOutLevelData boolmbPageDim:1; ScDPOutLevelData() : -nDim(-1), nHier(-1), nLevel(-1), nDimPos(-1), mbHasHiddenMember(false), mbDataLayout(false), mbPageDim(false) +nDim(-1), nHier(-1), nLevel(-1), nDimPos(-1), mnSrcNumFmt(0), mbHasHiddenMember(false), mbDataLayout(false), mbPageDim(false) {} bool operator<(const ScDPOutLevelData& r) const @@ -339,80 +340,76 @@ void lcl_FillNumberFormats( sal_uInt32*& rFormats, long& rCount, uno::Sequence aResult = xLevRes->getResults(); long nSize = aResult.getLength(); -if (nSize) -{ -// get names/formats for all data dimensions -//! merge this with the loop to collect ScDPOutLevelData? +if (!nSize) +return; -rtl::OUString aDataNames[SC_DPOUT_MAXLEVELS]; -sal_uInt32 nDataFormats[SC_DPOUT_MAXLEVELS]; -long nDataCount = 0; -bool bAnySet = false; +// get names/formats for all data dimensions +//! merge this with the loop to collect ScDPOutLevelData? -long nDimCount = xDims->getCount(); -for (long nDim=0; nDimgetCount(); +for (long nDim=0; nDim xDim = +ScUnoHelpFunctions::AnyToInterface( xDims->getByIndex(nDim) ); +uno::Reference xDimProp( xDim, uno::UNO_QUERY ); +uno::Reference xDimName( xDim, uno::UNO_QUERY ); +if ( xDimProp.is() && xDimName.is() ) { -uno::Reference xDim = -ScUnoHelpFunctions::AnyToInterface( xDims->getByIndex(nDim) ); -uno::Reference xDimProp( xDim, uno::UNO_QUERY ); -uno::Reference xDimName( xDim, uno::UNO_QUERY ); -if ( xDimProp.is() && xDimName.is() ) +sheet::DataPilotFieldOrientation eDimOrient = +(sheet::DataPilotFieldOrientation) ScUnoHelpFunctions::GetEnumProperty( +xDimProp, rtl::OUString(SC_UNO_DP_ORIENTATION), +sheet::DataPilotFieldOrientation_HIDDEN ); +if ( eDimOrient == sheet::DataPilotFieldOrientation_DATA ) { -sheet::DataPilotFieldOrientation eDimOrient = -(sheet::DataPilotFieldOrientation) ScUnoHelpFunctions::GetEnumProperty( -xDimProp, rtl::OUString(SC_UNO_DP_ORIENTATION), -sheet::DataPilotFieldOrientation_HIDDEN ); -if ( eDimOrient == sheet::DataPilotFieldOrientation_DATA ) -{ -aDataNames[nDataCount] = xDimName->getName(); -long nFormat = ScUnoHelpFunctions::GetLongProperty( -xDimProp, -rtl::OUString(SC_UNONAME_NUMFMT) ); -nDataFormats[nDataCount] = nFormat; -if ( nFormat != 0 ) -bAnySet = true; -++nDataCount; -} +aDataNames[nDataCount] = xDimName->getName(); +long nFormat = ScUnoHelpFunctions::GetLongProperty( +xDimProp, +rtl::OUString(SC_UNONAME_NUMFMT) ); +nDataFormats[nDataCount] = nFormat; +++nDataCount; } } +} -if ( bAnySet ) // fo
[Libreoffice-commits] .: sc/source
sc/source/filter/excel/xichart.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 329f3cd02546dfe58bf00f6ad3b71bc84a8d4320 Author: Kohei Yoshida Date: Thu Jan 3 00:27:08 2013 -0500 fdo#58539: Check for mxValueLink being NULL before dereferencing. Or else Calc would crash while loading the xls document from gnome519788. As an aside, this xls document appears to be corrupt. Trying to open it in Excel (XP and 2007) causes Excel to offer to repair it, while fails in both versions. Excel XP is somehow able to open it with some content preserved. No such luck with Excel 2007. Change-Id: I04616a4c926862461a2efdd99ccabe36122d6825 diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 1aa9d45..8310deb 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -2057,7 +2057,7 @@ Reference< XDataSeries > XclImpChSeries::CreateDataSeries() const aSeriesProp.SetBoolProperty( EXC_CHPROP_VARYCOLORSBY, rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_PIE ); #endif // #i91271# always set area formatting for every point in pie/doughnut charts -if( mxSeriesFmt && ((bVarPointFmt && mxSeriesFmt->IsAutoArea()) || (rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_PIE)) ) +if (mxSeriesFmt && mxValueLink && ((bVarPointFmt && mxSeriesFmt->IsAutoArea()) || (rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_PIE))) { for( sal_uInt16 nPointIdx = 0, nPointCount = mxValueLink->GetCellCount(); nPointIdx < nPointCount; ++nPointIdx ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/oox/defnamesbuffer.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 7a8a3e46978b3397ca8aba38917bd5dbc808c9b8 Author: Kohei Yoshida Date: Wed Jan 2 23:56:43 2013 -0500 fdo#58539: Properly initialize a member pointer value. Or else it would crash when loading the doc from fdo#55174. Change-Id: I21eb77f97dcab467c185dacaf9f00753bb4fc18c diff --git a/sc/source/filter/oox/defnamesbuffer.cxx b/sc/source/filter/oox/defnamesbuffer.cxx index d735ac4..488b7e3 100644 --- a/sc/source/filter/oox/defnamesbuffer.cxx +++ b/sc/source/filter/oox/defnamesbuffer.cxx @@ -285,6 +285,7 @@ ApiTokenSequence DefinedNameBase::importBiffFormula( sal_Int16 nBaseSheet, BiffI DefinedName::DefinedName( const WorkbookHelper& rHelper ) : DefinedNameBase( rHelper ), +mpScRangeData(NULL), mnTokenIndex( -1 ), mcBuiltinId( BIFF_DEFNAME_UNKNOWN ), mnFmlaSize( 0 ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/xml/xmlsubti.cxx |2 ++ sc/source/filter/xml/xmlsubti.hxx |2 +- 2 files changed, 3 insertions(+), 1 deletion(-) New commits: commit fa1b00095011def26cc291e74948817632e3545d Author: Markus Mohrhard Date: Thu Jan 3 01:41:45 2013 +0100 don't overflow column number during import, fdo#58539 This should fix the crash with kde#245919 Change-Id: I7c3af01e27233d2f94d5585247c59e7d5b6ea8ca diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx index 2dddb90..1950e3c 100644 --- a/sc/source/filter/xml/xmlsubti.cxx +++ b/sc/source/filter/xml/xmlsubti.cxx @@ -220,6 +220,8 @@ void ScMyTables::AddColStyle(const sal_Int32 nRepeat, const rtl::OUString& rCell { rImport.GetStylesImportHelper()->AddColumnStyle(rCellStyleName, nCurrentColCount, nRepeat); nCurrentColCount += nRepeat; +SAL_WARN_IF(nCurrentColCount > MAXCOL, "sc", "more columns than fit into SCCOL"); +nCurrentColCount = std::min( nCurrentColCount, MAXCOL ); } uno::Reference< drawing::XDrawPage > ScMyTables::GetCurrentXDrawPage() diff --git a/sc/source/filter/xml/xmlsubti.hxx b/sc/source/filter/xml/xmlsubti.hxx index 2cdea77..b770771 100644 --- a/sc/source/filter/xml/xmlsubti.hxx +++ b/sc/source/filter/xml/xmlsubti.hxx @@ -87,7 +87,7 @@ public: ScXMLTabProtectionData& GetCurrentProtectionData() { return maProtectionData; } rtl::OUString GetCurrentSheetName() const { return sCurrentSheetName; } SCTAB GetCurrentSheet() const { return (maCurrentCellPos.Tab() >= 0) ? maCurrentCellPos.Tab() : 0; } -SCCOL GetCurrentColCount() const { return nCurrentColCount; } +SCCOL GetCurrentColCount() const { return std::min(nCurrentColCount, MAXCOL); } SCROW GetCurrentRow() const { return (maCurrentCellPos.Row() >= 0) ? maCurrentCellPos.Row() : 0; } ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > GetCurrentXSheet() const { return xCurrentSheet; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/unoobj/dapiuno.cxx | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) New commits: commit c27e334661b62897a81a450ea9188f80e053261e Author: Kohei Yoshida Date: Wed Jan 2 16:03:35 2013 -0500 fdo#58539: Avoid throwing exception not specified in the signature. This should fix the crasher with the fdo#45266 document. Change-Id: I41cf02f211e289b85c31b2d2d60e0c4d849b7e8e diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index feb8b4c..07c2693 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -2697,8 +2697,16 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( cons Reference< XNameAccess > xFields(mrParent.getDataPilotFields(), UNO_QUERY); if (xFields.is()) { -xRet.set(xFields->getByName(sNewDim), UNO_QUERY); -OSL_ENSURE(xRet.is(), "there is a name, so there should be also a field"); +try +{ +xRet.set(xFields->getByName(sNewDim), UNO_QUERY); +OSL_ENSURE(xRet.is(), "there is a name, so there should be also a field"); +} +catch (const container::NoSuchElementException&) +{ +// Avoid throwing exception that's not specified in the method signature. +throw RuntimeException(); +} } } return xRet; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/docshell/docfunc.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit f843850ee9994653673ef5591aae875d7fb22fed Author: Julien Nabet Date: Tue Jan 1 16:23:16 2013 +0100 fdo#47466 FORMATTING: Autoformat empty rows causes app to crash Thank you John LeMoyne Castle for your support http://nabble.documentfoundation.org/Wrong-indentation-which-leads-to-segfault-in-sc-source-ui-docshell-docfunc-cxx-td4026726.html However, the weird thing is I reproduced the crash with master sources but didn't with 4.0 branch nor with 3.5.4.2 Debian packages Change-Id: Ia5366f479a1066106551b77b5a6315fb78e1bf7d diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index abcd66d..bbd6c96 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -3739,10 +3739,12 @@ bool ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark, ScMarkData::iterator itr = aMark.begin(), itrEnd = aMark.end(); for (; itr != itrEnd && *itr < nTabCount; ++itr) +{ SetWidthOrHeight( sal_True, 1,nCols, *itr, SC_SIZE_VISOPT, STD_EXTRA_WIDTH, false, sal_True); SetWidthOrHeight( false,1,nRows, *itr, SC_SIZE_VISOPT, 0, false, false); rDocShell.PostPaint( 0,0,*itr, MAXCOL,MAXROW,*itr, PAINT_GRID | PAINT_LEFT | PAINT_TOP ); +} } else { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/tool/autoform.cxx | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) New commits: commit 2e1abe1c59b1121ffb5d46afe82ce985cb70c4db Author: Julien Nabet Date: Tue Jan 1 15:17:21 2013 +0100 Fix some 'bRet' is reassigned a value before the old one has been used Change-Id: I815b943871f11ae2bbe2d5ecfa6e096fb7bb463f diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx index a11e5f6..54ee367 100644 --- a/sc/source/core/tool/autoform.cxx +++ b/sc/source/core/tool/autoform.cxx @@ -746,10 +746,9 @@ void ScAutoFormatData::GetFromItemSet( sal_uInt16 nIndex, const SfxItemSet& rIte bool ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersions ) { -sal_BoolbRet = true; sal_uInt16 nVer = 0; rStream >> nVer; -bRet = 0 == rStream.GetError(); +bool bRet = 0 == rStream.GetError(); if( bRet && (nVer == AUTOFORMAT_DATA_ID_X || (AUTOFORMAT_DATA_ID_504 <= nVer && nVer <= AUTOFORMAT_DATA_ID)) ) { @@ -1016,8 +1015,6 @@ ScAutoFormat::iterator ScAutoFormat::end() bool ScAutoFormat::Load() { -bool bRet = true; - INetURLObject aURL; SvtPathOptions aPathOpt; aURL.SetSmartURL( aPathOpt.GetUserConfigPath() ); @@ -1026,7 +1023,7 @@ bool ScAutoFormat::Load() SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_READ ); SvStream* pStream = aMedium.GetInStream(); -bRet = (pStream && pStream->GetError() == 0); +bool bRet = (pStream && pStream->GetError() == 0); if (bRet) { SvStream& rStream = *pStream; @@ -1079,8 +1076,6 @@ bool ScAutoFormat::Load() bool ScAutoFormat::Save() { -bool bRet = true; - INetURLObject aURL; SvtPathOptions aPathOpt; aURL.SetSmartURL( aPathOpt.GetUserConfigPath() ); @@ -1089,7 +1084,7 @@ bool ScAutoFormat::Save() SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_WRITE ); SvStream* pStream = aMedium.GetOutStream(); -bRet = (pStream && pStream->GetError() == 0); +bool bRet = (pStream && pStream->GetError() == 0); if (bRet) { const sal_uInt16 fileVersion = SOFFICE_FILEFORMAT_50; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source slideshow/source unusedcode.easy
sc/source/ui/cctrl/checklistmenu.cxx |5 - slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionImpl.cxx |8 slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionImpl.hxx |1 - unusedcode.easy |2 -- 4 files changed, 16 deletions(-) New commits: commit 3d623f39335870e4c6706e6b985f0218e2faafa6 Author: Marcos Paulo de Souza Date: Sun Dec 30 18:45:51 2012 -0200 Remove some unused functions Change-Id: I618de5d34d891b1b183cca12b71aff4128b2f92e Signed-off-by: Marcos Paulo de Souza Reviewed-on: https://gerrit.libreoffice.org/1517 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index b125c01..98f37d0 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -599,11 +599,6 @@ void ScMenuFloatingWindow::fillMenuItemsToAccessible(ScAccessibleFilterMenu* pAc } } -ScDocument* ScMenuFloatingWindow::getDoc() -{ -return mpDoc; -} - void ScMenuFloatingWindow::resizeToFitMenuItems() { SetOutputSizePixel(getMenuSize()); diff --git a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionImpl.cxx b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionImpl.cxx index 1142f61..1df7802 100644 --- a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionImpl.cxx +++ b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionImpl.cxx @@ -67,14 +67,6 @@ void TransitionScene::swap(TransitionScene& rOther) swap(maSceneObjects, rOther.maSceneObjects); } -void TransitionScene::clear() -{ -maLeavingSlidePrimitives.clear(); -maEnteringSlidePrimitives.clear(); -maOverallOperations.clear(); -maSceneObjects.clear(); -} - OGLTransitionImpl::~OGLTransitionImpl() { } diff --git a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionImpl.hxx b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionImpl.hxx index 3760683..9b27b47 100644 --- a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionImpl.hxx +++ b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionImpl.hxx @@ -95,7 +95,6 @@ public: TransitionScene& operator=(const TransitionScene& rOther); void swap(TransitionScene& rOther); -void clear(); const Primitives_t& getLeavingSlide() const { diff --git a/unusedcode.easy b/unusedcode.easy index c6bdb68..8c8c30f 100755 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -5,11 +5,9 @@ PoHeader::PoHeader() SanExtensionImpl::setCertExtn(unsigned char*, unsigned int, unsigned char*, unsigned int, unsigned char) ScFiltersTest::testColorScaleODS() ScFiltersTest::testColorScaleXLSX() -ScMenuFloatingWindow::getDoc() ScVbaFormat::getAddIndent() ScVbaFormat::setAddIndent(com::sun::star::uno::Any const&) TextEngine::GetLeftMargin() const -TransitionScene::clear() UnoControl::UnoControl() VirtualDevice::SetOutputSizePixelScaleOffsetAndBuffer(Size const&, Fraction const&, Point const&, boost::shared_array const&) Window::PostUserEvent(unsigned long&, unsigned long, void*) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/data/table4.cxx |2 +- sc/source/core/tool/interpr2.cxx|4 +++- sc/source/ui/cctrl/dpcontrol.cxx|3 +-- sc/source/ui/docshell/arealink.cxx |3 +-- sc/source/ui/docshell/docsh8.cxx|2 +- sc/source/ui/drawfunc/fusel.cxx |4 ++-- sc/source/ui/unoobj/viewuno.cxx |2 +- sc/source/ui/view/dbfunc.cxx|3 +-- sc/source/ui/view/drawvie3.cxx |6 +++--- sc/source/ui/view/gridwin.cxx |2 +- sc/source/ui/view/preview.cxx |2 +- sc/source/ui/view/printfun.cxx |3 +-- sc/source/ui/view/tabvwshb.cxx |3 +-- sc/source/ui/view/viewfun4.cxx |2 +- sc/source/ui/view/viewfun7.cxx |3 +-- sc/source/ui/xmlsource/xmlsourcedlg.cxx |2 +- 16 files changed, 21 insertions(+), 25 deletions(-) New commits: commit 2fbd64cef870568da1479a03f6ea778bab68a09b Author: Julien Nabet Date: Sun Dec 30 21:19:04 2012 +0100 More cppcheck cleaning in sc Change-Id: Ie040fa7ed9a3304bd4a10e404b7a0a4e45cbd69c diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 1b9debb..f5655f3 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1390,7 +1390,6 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uLong nActFormCnt = 0; for (rOuter = nOStart; rOuter <= nOEnd; rOuter++) { -bool bFirst = true; rInner = nISource; ScBaseCell* pSrcCell = aCol[nCol].GetCell(static_cast(nRow)); @@ -1467,6 +1466,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, { if (eCellType == CELLTYPE_FORMULA) { +bool bFirst = true; for (rInner = nIMin; rInner <= nIMax; rInner++) { if(HiddenRowColumn(rInner, bVertical, this)) diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index a25826c..dc37e08 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -2653,10 +2653,12 @@ void ScInterpreter::ScArabic() sal_uInt16 nDigit1 = 0; sal_uInt16 nDigit2 = 0; bool bIsDec1 = false; -bool bIsDec2 = false; bValid = lcl_GetArabicValue( aRoman.GetChar( nCharIndex ), nDigit1, bIsDec1 ); if( bValid && (nCharIndex + 1 < nCharCount) ) +{ +bool bIsDec2 = false; bValid = lcl_GetArabicValue( aRoman.GetChar( nCharIndex + 1 ), nDigit2, bIsDec2 ); +} if( bValid ) { if( nDigit1 >= nDigit2 ) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index c866ded..ab583cb 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -97,7 +97,6 @@ void ScDPFieldButton::setPopupLeft(bool b) void ScDPFieldButton::draw() { -const long nMargin = 2; bool bOldMapEnablaed = mpOutDev->IsMapModeEnabled(); mpOutDev->EnableMapMode(false); @@ -136,7 +135,7 @@ void ScDPFieldButton::draw() Point aTextPos = maPos; long nTHeight = mpOutDev->GetTextHeight(); -aTextPos.setX(maPos.getX() + nMargin); +aTextPos.setX(maPos.getX() + 2); // 2 = Margin aTextPos.setY(maPos.getY() + (maSize.Height()-nTHeight)/2); mpOutDev->Push(PUSH_CLIPREGION); diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx index 84d30be..85db183 100644 --- a/sc/source/ui/docshell/arealink.cxx +++ b/sc/source/ui/docshell/arealink.cxx @@ -331,7 +331,6 @@ sal_Bool ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter, // Undo initialisieren ScDocument* pUndoDoc = NULL; -ScDocument* pRedoDoc = NULL; if ( bAddUndo && bUndo ) { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -414,7 +413,7 @@ sal_Bool ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter, if ( bAddUndo && bUndo) { -pRedoDoc = new ScDocument( SCDOCMODE_UNDO ); +ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO ); pRedoDoc->InitUndo( pDoc, nDestTab, nDestTab ); pDoc->CopyToDocument( aNewRange, IDF_ALL & ~IDF_NOTE, false, pRedoDoc ); diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 267d6cf..2bfbcb0 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -424,9 +424,9 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet sal_Bool bEnd = false; while ( !bEnd && xRowSet->next() ) { -bool bSimpleRow = true; if ( nRow <= MAXROW ) { +bool bSimpleRow = true;
[Libreoffice-commits] .: sc/source
sc/source/core/tool/chgtrack.cxx |4 - sc/source/core/tool/interpr3.cxx | 59 + sc/source/filter/excel/excform.cxx |2 sc/source/filter/xml/xmlcelli.cxx |2 sc/source/ui/app/inputhdl.cxx |8 +-- sc/source/ui/condformat/condformatdlgentry.cxx |6 -- sc/source/ui/view/viewfun3.cxx |2 7 files changed, 44 insertions(+), 39 deletions(-) New commits: commit dd4173e9bd4877721b2225975f9d01b1c88c1a9b Author: Julien Nabet Date: Sun Dec 30 17:35:24 2012 +0100 Some cppcheck cleaning in sc Change-Id: I620a9329d50397a7ea498dc4703978026ad337ae diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index 85f61ce..ed05ee1 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -355,7 +355,6 @@ void ScChangeAction::RemoveAllDeletedIn() bool ScChangeAction::IsDeletedInDelType( ScChangeActionType eDelType ) const { -ScChangeAction* p; ScChangeActionLinkEntry* pL = GetDeletedIn(); if ( pL ) { @@ -375,6 +374,7 @@ bool ScChangeAction::IsDeletedInDelType( ScChangeActionType eDelType ) const default: eInsType = SC_CAT_NONE; } +ScChangeAction* p; while ( pL ) { if ( (p = pL->GetAction()) != NULL && @@ -1033,10 +1033,10 @@ bool ScChangeActionDel::Reject( ScDocument* pDoc ) if ( !aBigRange.IsValid( pDoc ) && GetType() != SC_CAT_DELETE_TABS ) return false; -bool bOk = true; if ( IsTopDelete() ) { // den kompletten Bereich in einem Rutsch restaurieren +bool bOk = true; ScBigRange aTmpRange( GetOverAllRange() ); if ( !aTmpRange.IsValid( pDoc ) ) { diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index 76f9a98..1b0e85a 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -212,41 +212,49 @@ double ScInterpreter::taylor(double* pPolynom, sal_uInt16 nMax, double x) double ScInterpreter::gauss(double x) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::gauss" ); -double t0[] = -{ 0.39894228040143268, -0.06649038006690545, 0.00997355701003582, - -0.00118732821548045, 0.00011543468761616, -0.0944465625950, - 0.0066596935163, -0.0004122667415, 0.227352982, - 0.011301172, 0.000511243, -0.21218 }; -double t2[] = -{ 0.47724986805182079, 0.05399096651318805, -0.05399096651318805, - 0.02699548325659403, -0.00449924720943234, -0.00224962360471617, - 0.00134977416282970, -0.00011783742691370, -0.00011515930357476, - 0.3704737285544, 0.0282690796889, -0.0354513195524, - 0.0037669563126, 0.0019202407921, -0.0005226908590, - -0.491799345, 0.366377919, -0.015981997, - -0.017381238, 0.002624031, 0.000560919, - -0.000172127, -0.08634, 0.07894 }; -double t4[] = -{ 0.49996832875816688, 0.00013383022576489, -0.00026766045152977, - 0.00033457556441221, -0.00028996548915725, 0.00018178605666397, - -0.8252863922168, 0.2551802519049, -0.0391665839292, - -0.0074018205222, 0.0064422023359, -0.0017370155340, - 0.909595465, 0.944943118, -0.329957075, - 0.029492075, 0.011874477, -0.004420396, - 0.000361422, 0.000143638, -0.45848 }; -double asympt[] = { -1.0, 1.0, -3.0, 15.0, -105.0 }; double xAbs = fabs(x); sal_uInt16 xShort = (sal_uInt16)::rtl::math::approxFloor(xAbs); double nVal = 0.0; if (xShort == 0) +{ +double t0[] = +{ 0.39894228040143268, -0.06649038006690545, 0.00997355701003582, + -0.00118732821548045, 0.00011543468761616, -0.0944465625950, + 0.0066596935163, -0.0004122667415, 0.227352982, + 0.011301172, 0.000511243, -0.21218 }; nVal = taylor(t0, 11, (xAbs * xAbs)) * xAbs; +} else if ((xShort >= 1) && (xShort <= 2)) +{ +double t2[] = +{ 0.47724986805182079, 0.05399096651318805, -0.05399096651318805, + 0.02699548325659403, -0.00449924720943234, -0.00224962360471617, + 0.00134977416282970, -0.00011783742691370, -0.00011515930357476, + 0.3704737285544, 0.0282690796889, -0.0354513195524, + 0.0037669563126, 0.0019202407921, -0.0005226908590, + -0.491799345, 0.366377919, -0.015981997, + -0.017381238, 0.002624031, 0.000560919, + -0.000172127, -0.08634, 0.07894 }; nVal = taylor(t2, 23, (xAbs - 2.0))
[Libreoffice-commits] .: sc/source ucb/workben
sc/source/ui/vba/vbahelper.cxx |2 +- ucb/workben/ucb/ucbdemo.cxx|2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit c5132e30fb09477aa46d810dd86727b3aa8cf20e Author: Radu Ioan Date: Sun Dec 30 02:47:09 2012 +0200 fdo#39440 - cppcheck cleanliness Correct some strings Change-Id: Ic019cb11b87cd51e7ffd1fb8f16b79dff381936c Reviewed-on: https://gerrit.libreoffice.org/1508 Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard diff --git a/sc/source/ui/vba/vbahelper.cxx b/sc/source/ui/vba/vbahelper.cxx index 96c1aeb..1452d42 100644 --- a/sc/source/ui/vba/vbahelper.cxx +++ b/sc/source/ui/vba/vbahelper.cxx @@ -275,7 +275,7 @@ getCurrentDocument() throw (uno::RuntimeException) if ( !xModel.is() ) { throw uno::RuntimeException( -rtl::OUString( "Can't extract model from basic ( its obviously not set yet therefore don't know the currently selected document") ), uno::Reference< uno::XInterface >() ); +rtl::OUString( "Can't extract model from basic ( its obviously not set yet therefore don't know the currently selected document)" ), uno::Reference< uno::XInterface >() ); } return xModel; } diff --git a/ucb/workben/ucb/ucbdemo.cxx b/ucb/workben/ucb/ucbdemo.cxx index 667bcd5..f38447a 100644 --- a/ucb/workben/ucb/ucbdemo.cxx +++ b/ucb/workben/ucb/ucbdemo.cxx @@ -296,7 +296,7 @@ rtl::OUString ProgressHandler::toString(const uno::Any & rStatus) return rtl::OUString(sResult); } -return rtl::OUString("(Unknown object")); +return rtl::OUString("(Unknown object)"); } // ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/data/fillinfo.cxx |2 -- 1 file changed, 2 deletions(-) New commits: commit 26a0979711f89915508359a9804765d934631ec2 Author: Julien Nabet Date: Sat Dec 29 19:42:57 2012 +0100 bHOver isn't used in second loop and afterwards See http://nabble.documentfoundation.org/Questions-about-function-lcl-GetMergeRange-sc-source-core-data-fillinfo-cxx-td4026455.html Change-Id: I6fbd51917be1716b20a61a310186f4ca795dd639 diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index 53ff7bb..0b27fb6 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -118,14 +118,12 @@ static void lcl_GetMergeRange( SCsCOL nX, SCsROW nY, SCSIZE nArrY, !pDoc->RowHidden(rStartY, nTab, NULL, &nLastRow) && (SCsROW) pRowInfo[nArrY].nRowNo == rStartY) { -bHOver = pRowInfo[nArrY].pCellInfo[rStartX+1].bHOverlapped; bVOver = pRowInfo[nArrY].pCellInfo[rStartX+1].bVOverlapped; } else { sal_uInt16 nOverlap = ((ScMergeFlagAttr*)pDoc->GetAttr( rStartX, rStartY, nTab, ATTR_MERGE_FLAG ))->GetValue(); -bHOver = ((nOverlap & SC_MF_HOR) != 0); bVOver = ((nOverlap & SC_MF_VER) != 0); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source tools/source vcl/unx
sc/source/core/data/column2.cxx |2 +- sc/source/core/data/conditio.cxx|5 ++--- sc/source/core/data/documen8.cxx|5 ++--- sc/source/core/data/fillinfo.cxx|2 +- sc/source/ui/condformat/colorformat.cxx |3 +-- tools/source/inet/inetstrm.cxx |2 +- vcl/unx/generic/printer/ppdparser.cxx |2 +- 7 files changed, 9 insertions(+), 12 deletions(-) New commits: commit c4b2921fc21eed2ec7a5333a3d24cdba46be1203 Author: Julien Nabet Date: Sat Dec 29 18:25:56 2012 +0100 Some cppcheck cleaning Change-Id: Id027823617d2328b9e827268825812634731a828 diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 2bdb401..42f6cd0 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1221,10 +1221,10 @@ bool ScColumn::IsEmptyBlock(SCROW nStartRow, SCROW nEndRow) const SCSIZE ScColumn::GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const { SCSIZE nLines = 0; -bool bFound = false; SCSIZE i; if ( !maItems.empty() ) { +bool bFound = false; if (eDir == DIR_BOTTOM) { i = maItems.size(); diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 016c5e9..d2206ba 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -527,11 +527,9 @@ void ScConditionEntry::UpdateReference( UpdateRefMode eUpdateRefMode, bool bInsertTab = ( eUpdateRefMode == URM_INSDEL && nDz >= 1 ); bool bDeleteTab = ( eUpdateRefMode == URM_INSDEL && nDz <= -1 ); -bool bChanged1 = false; -bool bChanged2 = false; - if (pFormula1) { +bool bChanged1 = false; if ( bInsertTab ) lcl_CondUpdateInsertTab( *pFormula1, rRange.aStart.Tab(), aSrcPos.Tab(), bChanged1, nDz ); else @@ -553,6 +551,7 @@ void ScConditionEntry::UpdateReference( UpdateRefMode eUpdateRefMode, } if (pFormula2) { +bool bChanged2 = false; if ( bInsertTab ) lcl_CondUpdateInsertTab( *pFormula2, rRange.aStart.Tab(), aSrcPos.Tab(), bChanged2, nDz ); else diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index b83b63f..d36453b 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -449,8 +449,6 @@ bool ScDocument::IdleCalcTextWidth()// true = demnaechst wieder vers ScStyleSheet* pStyle = NULL; ScColumnIterator* pColIter = NULL; ScTable*pTable = NULL; -ScColumn* pColumn = NULL; -ScBaseCell* pCell= NULL; SCTAB nTab = aCurTextWidthCalcPos.Tab(); SCROW nRow = aCurTextWidthCalcPos.Row(); SCsCOL nCol = aCurTextWidthCalcPos.Col(); @@ -484,10 +482,11 @@ bool ScDocument::IdleCalcTextWidth()// true = demnaechst wieder vers sal_uInt16 nRestart = 0; sal_uInt16 nZoom = 0; sal_uInt16 nCount = 0; +ScBaseCell* pCell = NULL; nZoom= GET_SCALEVALUE(pStyle->GetItemSet(),ATTR_PAGE_SCALE); Fraction aZoomFract( nZoom, 100 ); -pColumn = &pTable->aCol[nCol]; +ScColumn* pColumn = &pTable->aCol[nCol]; pColIter = new ScColumnIterator( pColumn, nRow, MAXROW ); while ( (nZoom > 0) && (nCount < CALCMAX) && (nRestart < 2) ) diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index d950164..53ff7bb 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -599,13 +599,13 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX { // Blockmarken const ScMarkArray* pThisMarkArr = pMarkData->GetArray()+nX; -bool bThisMarked; nArrY = 1; nCurRow = nY1; // einzelne Zeile nThisRow = nY1; // Ende des Bereichs if ( pThisMarkArr->Search( nY1, nIndex ) ) { +bool bThisMarked; do { nThisRow=pThisMarkArr->pData[nIndex].nRow; // Ende des Bereichs diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx index bda89a4..581954c 100644 --- a/sc/source/ui/condformat/colorformat.cxx +++ b/sc/source/ui/condformat/colorformat.cxx @@ -136,14 +136,13 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, const ScDataBarForma void ScDataBarSettingsDlg::Init() { SfxObjectShell* pDocSh = SfxObjectShell::Current(); -const SfxPoolItem* pItem = NULL; XColorLis
[Libreoffice-commits] .: sc/source
sc/source/ui/view/cellsh1.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 9e0dbe9f8c1fa9d2c50895985fe2c374fa9364ac Author: Markus Mohrhard Date: Mon Dec 24 03:00:32 2012 +0100 be safe against invalid cond format cell info, fdo#58686 Change-Id: Ie89aee95755d9abd3b82062fac271cfe774174ec diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 16e0b06..a805661 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1792,6 +1792,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) { // check if at least one existing conditional format has the same range const ScConditionalFormat* pCondFormat = pList->GetFormat(*itr); +if(!pCondFormat) +continue; + const ScRangeList& rCondFormatRange = pCondFormat->GetRange(); if(rCondFormatRange == aRangeList) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/data/dociter.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6869aaa2b36316e50b512e0ba4819743d834ceaa Author: Tor Lillqvist Date: Fri Dec 21 20:46:10 2012 +0200 C4701: potentially uninitialized local variable 'bTestEqualCondition' used Change-Id: I01c9a166d0faabed4a92a0aa42a123432cb7e847 diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index f9934e5..e343680 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -1172,7 +1172,7 @@ ScBaseCell* ScQueryCellIterator::GetThis() ++nRow; else { -bool bTestEqualCondition; +bool bTestEqualCondition = false; if ( (pDoc->maTabs[nTab])->ValidQuery( nRow, *mpParam, (nCol == static_cast(nFirstQueryField) ? pCell : NULL), (nTestEqualCondition ? &bTestEqualCondition : NULL) ) ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/excel/xiescher.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit bb97ecdbcc8d8dafd39e728b21bc68efee4eccbc Author: Markus Mohrhard Date: Sat Dec 22 14:19:38 2012 +0100 storing the chart doc while loading is a bad idea, fdo#57530 There seems to be no obvious reason why we would need to store the chart doc during xls import. The chart test docs don't show any difference without this call. This speeds up xls chart import quite a bit. With the test doc from the bug report I'm able to open the doc nearly instantly now. Change-Id: I0b80462b9d1c405ab1d4cf456e12ebfe4428db98 diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index d8c79f2..33036c0 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -1674,7 +1674,6 @@ void XclImpChartObj::DoPostProcessSdrObj( XclImpDffConverter& rDffConv, SdrObjec Reference< XEmbedPersist > xPersist( xEmbObj, UNO_QUERY_THROW ); Reference< XModel > xModel( xEmbObj->getComponent(), UNO_QUERY_THROW ); mxChart->Convert( xModel, rDffConv, xPersist->getEntryName(), rSdrObj.GetLogicRect() ); -xPersist->storeOwn(); } catch( const Exception& ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/oox/workbookfragment.cxx |4 ++-- sc/source/ui/docshell/docsh.cxx | 15 +-- 2 files changed, 15 insertions(+), 4 deletions(-) New commits: commit d98b888258e413214275c8e7f035325fe9339b78 Author: Kohei Yoshida Date: Thu Dec 20 14:50:36 2012 -0500 Forgot to add checkbox to the dialog & saving the option when checked. Also remove a printf statement. Change-Id: I29c89a19f0c75b21f912d12903d1fceea535a6c7 diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx index ba74b96..ba0c2fd 100644 --- a/sc/source/filter/oox/workbookfragment.cxx +++ b/sc/source/filter/oox/workbookfragment.cxx @@ -335,20 +335,20 @@ void WorkbookFragment::finalizeImport() ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS)); aBox.SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED)); -boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() ); sal_Int32 nRet = aBox.Execute(); bHardRecalc = nRet == RET_YES; if (aBox.GetCheckBoxState()) { // Always perform selected action in the future. +boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() ); officecfg::Office::Calc::Formula::Load::OOXMLRecalcMode::set(sal_Int32(0), batch); ScFormulaOptions aOpt = SC_MOD()->GetFormulaOptions(); aOpt.SetOOXMLRecalcOptions(bHardRecalc ? RECALC_ALWAYS : RECALC_NEVER); SC_MOD()->SetFormulaOptions(aOpt); +batch->commit(); } -batch->commit(); } } else if (nRecalcMode == RECALC_ALWAYS) diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 9377f94..f910070 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -444,15 +444,26 @@ sal_Bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::un QueryBox aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_ODS)); + aBox.SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED)); bHardRecalc = aBox.Execute() == RET_YES; + +if (aBox.GetCheckBoxState()) +{ +// Always perform selected action in the future. +boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() ); + officecfg::Office::Calc::Formula::Load::ODFRecalcMode::set(sal_Int32(0), batch); +ScFormulaOptions aOpt = SC_MOD()->GetFormulaOptions(); +aOpt.SetODFRecalcOptions(bHardRecalc ? RECALC_ALWAYS : RECALC_NEVER); +SC_MOD()->SetFormulaOptions(aOpt); + +batch->commit(); +} } } else if (nRecalcMode == RECALC_ALWAYS) bHardRecalc = true; -fprintf(stdout, "ScDocShell::LoadXML: hard recalc = %d\n", bHardRecalc); - if (bHardRecalc) DoHardRecalc(false); else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/view/cellsh1.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 9123db4ce8f1c20cf7b4f5a8ceaa66b6321ede14 Author: Rodolfo Ribeiro Gomes Date: Thu Dec 20 10:18:47 2012 -0200 Group undo actions when showing/hiding several notes once, fdo#39454 This is a complement for fdo#39454 bugfix. Change-Id: I3f406ae151b92419a86abb8f050c8b032d080838 Reviewed-on: https://gerrit.libreoffice.org/1452 Reviewed-by: Eike Rathke Tested-by: Eike Rathke diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index f1d3594..16e0b06 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2061,6 +2061,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ScRangeList aRanges = *aRangesRef; size_t nRangeSize = aRanges.size(); +String aUndo = ScGlobal::GetRscString( bShowNote ? STR_UNDO_SHOWNOTE : STR_UNDO_HIDENOTE ); +pData->GetDocShell()->GetUndoManager()->EnterListAction( aUndo, aUndo ); + for ( size_t i = 0; i < nRangeSize; ++i ) { const ScRange * pRange = aRanges[i]; @@ -2107,6 +2110,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) } } +pData->GetDocShell()->GetUndoManager()->LeaveListAction(); + if ( bDone ) { rReq.Done(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/view/cellsh.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 4ecfcfebbabb950654f699f0168fd3823ea60b94 Author: Rodolfo Ribeiro Gomes Date: Wed Dec 19 12:06:55 2012 -0200 Little optimization when detecting if there is cell notes to be deleted Change-Id: I6f7a79459f3d0431adc45f339854b1a9339444c0 Reviewed-on: https://gerrit.libreoffice.org/1415 Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 72c8be3..ade336a 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -929,7 +929,10 @@ void ScCellShell::GetState(SfxItemSet &rSet) if ( nCol <= aRanges[nPos]->aEnd.Col() && nRow <= aRanges[nPos]->aEnd.Row() && nCol >= aRanges[nPos]->aStart.Col() && nRow >= aRanges[nPos]->aStart.Row() ) +{ bEnable = true; //note found +break; +} } } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/inc/autofilterbuffer.hxx |6 -- sc/source/filter/oox/autofilterbuffer.cxx | 24 2 files changed, 30 deletions(-) New commits: commit 413d1a932eb4c47510dd05905c1ff467cb186d04 Author: Marcos Paulo de Souza Date: Tue Dec 18 22:09:47 2012 -0200 Remove unused method from sc: importBiffRecord As Thomas Arnhold pointed, these method eems to be useless. After removing and running calc, it seems to work perfect. Change-Id: I3e3eb7ba3e2e71bb615f64d5f63ca7f8cac00e9c Signed-off-by: Marcos Paulo de Souza Reviewed-on: https://gerrit.libreoffice.org/1410 Reviewed-by: Kohei Yoshida Tested-by: Kohei Yoshida diff --git a/sc/source/filter/inc/autofilterbuffer.hxx b/sc/source/filter/inc/autofilterbuffer.hxx index 091c026..7b4ca5c 100644 --- a/sc/source/filter/inc/autofilterbuffer.hxx +++ b/sc/source/filter/inc/autofilterbuffer.hxx @@ -63,8 +63,6 @@ public: virtual voidimportAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); /** Derived classes import filter settings from the passed record. */ virtual voidimportRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); -/** Derived classes import filter settings from the FILTERCOLUMN record. */ -virtual voidimportBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags ); /** Derived classes return converted UNO API filter settings representing all filter settings. */ virtual ApiFilterSettings finalizeImport( sal_Int32 nMaxCount ); @@ -110,8 +108,6 @@ public: virtual voidimportAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports filter settings from the FILTERS and FILTER records. */ virtual voidimportRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); -/** Imports filter settings from the FILTERCOLUMN record. */ -virtual voidimportBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags ); /** Returns converted UNO API filter settings representing all filter settings. */ virtual ApiFilterSettings finalizeImport( sal_Int32 nMaxCount ); @@ -159,8 +155,6 @@ public: virtual voidimportAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports filter settings from the FILTERS and FILTER records. */ virtual voidimportRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); -/** Imports filter settings from the FILTERCOLUMN record. */ -virtual voidimportBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags ); /** Returns converted UNO API filter settings representing all filter settings. */ virtual ApiFilterSettings finalizeImport( sal_Int32 nMaxCount ); diff --git a/sc/source/filter/oox/autofilterbuffer.cxx b/sc/source/filter/oox/autofilterbuffer.cxx index 1c5345f..6ccb193 100644 --- a/sc/source/filter/oox/autofilterbuffer.cxx +++ b/sc/source/filter/oox/autofilterbuffer.cxx @@ -211,10 +211,6 @@ void FilterSettingsBase::importRecord( sal_Int32 /*nRecId*/, SequenceInputStream { } -void FilterSettingsBase::importBiffRecord( BiffInputStream& /*rStrm*/, sal_uInt16 /*nFlags*/ ) -{ -} - ApiFilterSettings FilterSettingsBase::finalizeImport( sal_Int32 /*nMaxCount*/ ) { return ApiFilterSettings(); @@ -328,13 +324,6 @@ void Top10Filter::importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ) } } -void Top10Filter::importBiffRecord( BiffInputStream& /*rStrm*/, sal_uInt16 nFlags ) -{ -mfValue = extractValue< sal_uInt16 >( nFlags, 7, 9 ); -mbTop = getFlag( nFlags, BIFF_FILTERCOLUMN_TOP ); -mbPercent = getFlag( nFlags, BIFF_FILTERCOLUMN_PERCENT ); -} - ApiFilterSettings Top10Filter::finalizeImport( sal_Int32 /*nMaxCount*/ ) { sal_Int32 nOperator = mbTop ? @@ -512,19 +501,6 @@ void CustomFilter::importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ) } } -void CustomFilter::importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags ) -{ -mbAnd = !getFlag( nFlags, BIFF_FILTERCOLUMN_OR ); - -FilterCriterionModel aCriterion1, aCriterion2; -aCriterion1.readBiffData( rStrm ); -aCriterion2.readBiffData( rStrm ); -aCriterion1.readString( rStrm, getBiff(), getTextEncoding() ); -aCriterion2.readString( rStrm, getBiff(), getTextEncoding() ); -appendCriterion( aCriterion1 ); -appendCriterion( aCriterion2 ); -} - ApiFilterSettings CustomFilter::finalizeImport( sal_Int32 /*nMaxCount*/ ) { ApiFilterSettings aSettings; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/data/dpcache.cxx | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) New commits: commit 87bfd731cbb9610252b39e9ef1d0d3d6c6c71f09 Author: Kohei Yoshida Date: Tue Dec 18 13:31:40 2012 -0500 Check the validity of row ranges after after the data area shrinkage. Or else it might crash again in the pivot layout dialog. Change-Id: I2254e5901f4736fffc6940346a866fc1f22b7c7f diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx index 724c842..5f075a3 100644 --- a/sc/source/core/data/dpcache.cxx +++ b/sc/source/core/data/dpcache.cxx @@ -303,7 +303,7 @@ bool ScDPCache::InitFromDoc(ScDocument* pDoc, const ScRange& rRange) SCROW nEndRow = rRange.aEnd.Row(); // Sanity check -if (!ValidRow(nStartRow) || !ValidRow(nEndRow) || nEndRow-nStartRow <= 0) +if (!ValidRow(nStartRow) || !ValidRow(nEndRow) || nEndRow <= nStartRow) return false; sal_uInt16 nStartCol = rRange.aStart.Col(); @@ -322,6 +322,15 @@ bool ScDPCache::InitFromDoc(ScDocument* pDoc, const ScRange& rRange) bool bTailEmptyRows = nEndRow > nRow2; // Trailing empty rows exist. nEndRow = nRow2; +if (nEndRow <= nStartRow) +{ +// Check this again since the end row position has changed. It's +// possible that the new end row becomes lower than the start row +// after the shrinkage. +Clear(); +return false; +} + maFields.reserve(mnColumnCount); for (size_t i = 0; i < static_cast(mnColumnCount); ++i) maFields.push_back(new Field); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source vcl/aqua
sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |2 + sc/source/ui/Accessibility/AccessibleTableBase.cxx | 20 +++--- vcl/aqua/source/a11y/aqua11ywrapper.mm | 37 +-- 3 files changed, 44 insertions(+), 15 deletions(-) New commits: commit 15aac31ebac23ef745400a8d9c146aef85923c9d Author: Michael Meeks Date: Tue Dec 18 13:29:03 2012 + fdo#56937 - mac a11y hang related to traversing vast, broken hierarchies. Change-Id: Iff0537a69b2c6ae929da6a05f26c0d55415d6d8a diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index d57d92e..e4d0060 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -44,6 +44,8 @@ using namespace ::com::sun::star::accessibility; //= internal +// FIXME: really unclear why we have an ScAccessibleTableBase with +// only this single sub-class ScAccessibleSpreadsheet::ScAccessibleSpreadsheet( ScAccessibleDocument* pAccDoc, ScTabViewShell* pViewShell, diff --git a/sc/source/ui/Accessibility/AccessibleTableBase.cxx b/sc/source/ui/Accessibility/AccessibleTableBase.cxx index 780638b..3a950c4 100644 --- a/sc/source/ui/Accessibility/AccessibleTableBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleTableBase.cxx @@ -261,7 +261,7 @@ sal_Bool SAL_CALL ScAccessibleTableBase::isAccessibleSelected( sal_Int32 /* nRow return false; } -//= XAccessibleExtendedTable +// = XAccessibleExtendedTable sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) throw (uno::RuntimeException, lang::IndexOutOfBoundsException) @@ -304,7 +304,7 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleColumn( sal_Int32 nChildI return nChildIndex % static_cast(maRange.aEnd.Col() - maRange.aStart.Col() + 1); } -//= XAccessibleContext == +// = XAccessibleContext == sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleChildCount(void) @@ -312,9 +312,16 @@ sal_Int32 SAL_CALL { SolarMutexGuard aGuard; IsObjectValid(); -return static_cast(maRange.aEnd.Row() - maRange.aStart.Row() + 1) * -(maRange.aEnd.Col() - maRange.aStart.Col() + 1); -// return 1; + +// FIXME: representing rows & columns this way is a plain and simple madness. +// this needs a radical re-think. +sal_Int64 nMax = ((sal_Int64)(maRange.aEnd.Row() - maRange.aStart.Row() + 1) * + (sal_Int64)(maRange.aEnd.Col() - maRange.aStart.Col() + 1)); +if (nMax > SAL_MAX_INT32) +nMax = SAL_MAX_INT32; +if (nMax < 0) +return 0; +return static_cast(nMax); } uno::Reference< XAccessible > SAL_CALL @@ -328,6 +335,9 @@ uno::Reference< XAccessible > SAL_CALL if (nIndex >= getAccessibleChildCount() || nIndex < 0) throw lang::IndexOutOfBoundsException(); +// FIXME: representing rows & columns this way is a plain and simple madness. +// this needs a radical re-think. + sal_Int32 nRow(0); sal_Int32 nColumn(0); sal_Int32 nTemp(maRange.aEnd.Col() - maRange.aStart.Col() + 1); diff --git a/vcl/aqua/source/a11y/aqua11ywrapper.mm b/vcl/aqua/source/a11y/aqua11ywrapper.mm index b3517b0..94dbe1b 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapper.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapper.mm @@ -977,21 +977,38 @@ Reference < XAccessibleContext > hitTestRunner ( com::sun::star::awt::Point poin Reference < XAccessibleComponent > rxAccessibleComponent ( rxAccessibleContext, UNO_QUERY ); if ( rxAccessibleComponent.is() ) { com::sun::star::awt::Point location = rxAccessibleComponent -> getLocationOnScreen(); -com::sun::star::awt::Point hitPoint ( point.X - location.X , point.Y - location.Y); +com::sun::star::awt::Point hitPoint ( point.X - location.X , point.Y - location.Y); Reference < XAccessible > rxAccessible = rxAccessibleComponent -> getAccessibleAtPoint ( hitPoint ); if ( rxAccessible.is() && rxAccessible -> getAccessibleContext().is() && rxAccessible -> getAccessibleContext() -> getAccessibleChildCount() == 0 ) { hitChild = rxAccessible -> getAccessibleContext(); } -} -if ( !hitChild.is() && rxAccessibleContext -> getAccessibleChildCount() > 0 ) { // special treatment for e.g. comboboxes -for ( int i = 0; i < rxAccessibleContext -> getAccessibleChildCount(); i++ ) { -Reference < XAccessible > rxAccessibleChild = rxAccessibleContext -> getAccessibleChild ( i ); -if ( rxAccessibleChild.i
[Libreoffice-commits] .: sc/source
sc/source/filter/oox/workbookhelper.cxx | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) New commits: commit 015bcb0840a584a660cefec412493107b74f4712 Author: Noel Power Date: Tue Dec 18 14:33:20 2012 + finalize pivot *before* scenario sheet to ensure table numbers are correct Change-Id: I15cf378b51b1ecfbd05c7013e5a5b69fb87fdafb diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index e5521e7..c3c2fbb 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -597,11 +597,6 @@ void WorkbookGlobals::finalize() // #i79826# enable updating automatic row height after loading the document aPropSet.setProperty( PROP_IsAdjustHeightEnabled, true ); -// Insert all pivot tables. Must be done after loading all sheets and -// formulas, because data pilots expect existing source data on -// creation. -getPivotTables().finalizeImport(); - // #i76026# enable Undo after loading the document aPropSet.setProperty( PROP_IsUndoEnabled, true ); // disable editing read-only documents (e.g. from read-only files) @@ -674,6 +669,12 @@ void WorkbookHelper::finalizeWorkbookImport() // need to import formulas before scenarios mrBookGlob.getFormulaBuffer().finalizeImport(); + +// Insert all pivot tables. Must be done after loading all sheets and +// formulas, because data pilots expect existing source data on +// creation. +getPivotTables().finalizeImport(); + /* Insert scenarios after all sheet processing is done, because new hidden sheets are created for scenarios which would confuse code that relies on certain sheet indexes. Must be done after pivot tables too. */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/data/attarray.cxx | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) New commits: commit 8a028afd55decfd269268d0d1e6adcfbdc9d85d0 Author: Markus Mohrhard Date: Tue Dec 18 02:28:24 2012 +0100 we need to use a copy of the original ScPatternAttr, fdo#58338 Change-Id: Ic231347cb864bff073d46ddef06f65b7517c45c3 diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 31e4b2f..201538d 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -279,9 +279,10 @@ void ScAttrArray::AddCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nInd { const ScPatternAttr* pPattern = GetPattern(nTempStartRow); -ScPatternAttr aPattern( pDocument->GetPool() ); +boost::scoped_ptr pNewPattern; if(pPattern) { +pNewPattern.reset( new ScPatternAttr(*pPattern) ); SCROW nPatternStartRow; SCROW nPatternEndRow; GetPatternRange( nPatternStartRow, nPatternEndRow, nTempStartRow ); @@ -296,17 +297,18 @@ void ScAttrArray::AddCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nInd ScCondFormatItem aItem; aItem.SetCondFormatData( aCondFormatData ); -aPattern.GetItemSet().Put( aItem ); +pNewPattern->GetItemSet().Put( aItem ); } else { +pNewPattern.reset( new ScPatternAttr( pDocument->GetPool() ) ); ScCondFormatItem aItem; aItem.AddCondFormatData(nIndex); -aPattern.GetItemSet().Put( aItem ); +pNewPattern->GetItemSet().Put( aItem ); nTempEndRow = nEndRow; } -SetPatternArea( nTempStartRow, nTempEndRow, &aPattern, true ); +SetPatternArea( nTempStartRow, nTempEndRow, pNewPattern.get(), true ); nTempStartRow = nTempEndRow + 1; } while(nTempEndRow < nEndRow); @@ -328,9 +330,9 @@ void ScAttrArray::RemoveCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 n { const ScPatternAttr* pPattern = GetPattern(nTempStartRow); -ScPatternAttr aPattern( pDocument->GetPool() ); if(pPattern) { +ScPatternAttr aPattern( *pPattern ); SCROW nPatternStartRow; SCROW nPatternEndRow; GetPatternRange( nPatternStartRow, nPatternEndRow, nTempStartRow ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/inc/tpformula.hxx| 10 ++-- sc/source/ui/optdlg/tpformula.cxx | 10 ++-- sc/source/ui/src/optdlg.src | 77 +++--- 3 files changed, 50 insertions(+), 47 deletions(-) New commits: commit f55f86e016e8d1b509be1e7ba59919301dc17d67 Author: Kohei Yoshida Date: Mon Dec 17 11:15:16 2012 -0500 Re-arranged formula options page to make room for re-calc option. Change-Id: If144ffa1c5d868f41f6303b0f99fbe2e4d23a6b8 diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx index 646f429..55ea854 100644 --- a/sc/source/ui/inc/tpformula.hxx +++ b/sc/source/ui/inc/tpformula.hxx @@ -61,6 +61,11 @@ private: ListBox maLbFormulaSyntax; CheckBox maCbEnglishFuncName; +FixedLine maFlCustomCalcOpt; +RadioButton maBtnCustomCalcDefault; +RadioButton maBtnCustomCalcCustom; +PushButton maBtnCustomCalcDetails; + FixedLine maFlFormulaSeps; FixedText maFtSepFuncArg; Edit maEdSepFuncArg; @@ -70,11 +75,6 @@ private: Edit maEdSepArrayRow; PushButton maBtnSepReset; -FixedLine maFlCustomCalcOpt; -RadioButton maBtnCustomCalcDefault; -RadioButton maBtnCustomCalcCustom; -PushButton maBtnCustomCalcDetails; - FixedLine maFlRecalcOptions; ListBox maLbOOXMLRecalcOptions; diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx index 5b60bd3..4a9608c 100644 --- a/sc/source/ui/optdlg/tpformula.cxx +++ b/sc/source/ui/optdlg/tpformula.cxx @@ -48,6 +48,12 @@ ScTpFormulaOptions::ScTpFormulaOptions(Window* pParent, const SfxItemSet& rCoreA maFtFormulaSyntax(this, ScResId(FT_FORMULA_SYNTAX)), maLbFormulaSyntax(this, ScResId(LB_FORMULA_SYNTAX)), maCbEnglishFuncName(this, ScResId(CB_ENGLISH_FUNC_NAME)), + +maFlCustomCalcOpt(this, ScResId(FL_CUSTOM_CALC_OPTIONS)), +maBtnCustomCalcDefault(this, ScResId(BTN_CUSTOM_CALC_DEFAULT)), +maBtnCustomCalcCustom(this, ScResId(BTN_CUSTOM_CALC_CUSTOM)), +maBtnCustomCalcDetails(this, ScResId(BTN_CUSTOM_CALC_DETAILS)), + maFlFormulaSeps(this, ScResId(FL_FORMULA_SEPS)), maFtSepFuncArg(this, ScResId(FT_FORMULA_SEP_ARG)), maEdSepFuncArg(this, ScResId(ED_FORMULA_SEP_ARG)), @@ -56,10 +62,6 @@ ScTpFormulaOptions::ScTpFormulaOptions(Window* pParent, const SfxItemSet& rCoreA maFtSepArrayRow(this, ScResId(FT_FORMULA_SEP_ARRAY_R)), maEdSepArrayRow(this, ScResId(ED_FORMULA_SEP_ARRAY_R)), maBtnSepReset(this, ScResId(BTN_FORMULA_SEP_RESET)), -maFlCustomCalcOpt(this, ScResId(FL_CUSTOM_CALC_OPTIONS)), -maBtnCustomCalcDefault(this, ScResId(BTN_CUSTOM_CALC_DEFAULT)), -maBtnCustomCalcCustom(this, ScResId(BTN_CUSTOM_CALC_CUSTOM)), -maBtnCustomCalcDetails(this, ScResId(BTN_CUSTOM_CALC_DETAILS)), maFlRecalcOptions(this, ScResId(FL_RECALC_OPTIONS)), maLbOOXMLRecalcOptions( this, ScResId(LB_OOXML_RECALC)), mnDecSep(0) diff --git a/sc/source/ui/src/optdlg.src b/sc/source/ui/src/optdlg.src index 821f200..43cb595 100644 --- a/sc/source/ui/src/optdlg.src +++ b/sc/source/ui/src/optdlg.src @@ -201,16 +201,44 @@ TabPage RID_SCPAGE_FORMULA Text [ en-US ] = "Use English function names" ; }; +FixedLine FL_CUSTOM_CALC_OPTIONS +{ +Pos = MAP_APPFONT ( 6 , 47 ) ; +Size = MAP_APPFONT ( 140 , 8 ) ; +Text [ en-US ] = "Detailed calculation settings"; +}; + +RadioButton BTN_CUSTOM_CALC_DEFAULT +{ +Pos = MAP_APPFONT ( 21 , 62 ) ; +Size = MAP_APPFONT ( 60, 14 ) ; +Text [ en-US ] = "Default"; +}; + +RadioButton BTN_CUSTOM_CALC_CUSTOM +{ +Pos = MAP_APPFONT ( 21 , 76 ) ; +Size = MAP_APPFONT ( 60, 14 ) ; +Text [ en-US ] = "Custom"; +}; + +PushButton BTN_CUSTOM_CALC_DETAILS +{ +Pos = MAP_APPFONT ( 83 , 74 ) ; +Size = MAP_APPFONT ( 58, 14 ) ; +Text [ en-US ] = "Details..."; +}; + FixedLine FL_FORMULA_SEPS { -Pos = MAP_APPFONT ( 6 , 46 ) ; -Size = MAP_APPFONT ( 248 , 8 ) ; +Pos = MAP_APPFONT ( 154 , 47 ) ; +Size = MAP_APPFONT ( 100 , 8 ) ; Text [ en-US ] = "Separators"; }; FixedText FT_FORMULA_SEP_ARG { -Pos = MAP_APPFONT ( 21, 59 ); +Pos = MAP_APPFONT ( 169, 60 ); Size = MAP_APPFONT ( 60, 8 ); Text [ en-US ] = "~Function"; }; @@ -218,13 +246,13 @@ TabPage RID_SCPAGE_FORMULA Edit ED_FORMULA_SEP_ARG { Border = TRUE; -Pos = MAP_APPFONT ( 85, 57 ); +Pos = MAP_APPFONT ( 233, 58 ); Size = MAP_APPFONT ( 10, 12 ); }; FixedText FT_FORMULA_SEP_ARRAY_C { -Pos = MAP_APPFONT ( 21, 77 ); +Pos = MAP_APPFONT ( 169, 78 ); Size = MAP_APPFONT ( 60, 8 ); Text [ en-US ] = "Array co~lumn"; }; @@ -232,13 +260,13 @@ TabPage RID_SCPAGE_FORMULA Edit ED_FORMULA_SEP_ARRAY_C { Border = TRUE; -Pos = MAP
[Libreoffice-commits] .: sc/source
sc/source/ui/view/cellsh.cxx |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) New commits: commit 63e10bf2383d22a5b3fafd95a688c2389f0076bc Author: Eike Rathke Date: Sat Dec 15 23:42:45 2012 +0100 check conditions before checking for matrix fragment Was omitted in ab0096ed68cdc08906f518d3499a8e1afc5ba80c Change-Id: If3e1c141f02751ca7e6104ba21c246926fca843d diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 6fbe22d..72c8be3 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -150,15 +150,18 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) case FID_FILL_TO_RIGHT: // fill to left / right { bDisable = !bSimpleArea || (nCol1 == 0 && nCol2 == 0); -bDisable = pDoc->HasSelectedBlockMatrixFragment( -nCol1, nRow1, nCol1, nRow2, rMark );// first column +if ( !bDisable && bEditable ) +{ // do not damage matrix +bDisable = pDoc->HasSelectedBlockMatrixFragment( +nCol1, nRow1, nCol1, nRow2, rMark );// first column +} } break; case FID_FILL_TO_LEFT: { bDisable = (!bSimpleArea) || (nCol1 == MAXCOL && nCol2 == MAXCOL); if ( !bDisable && bEditable ) -{ // Matrix nicht zerreissen +{ // do not damage matrix bDisable = pDoc->HasSelectedBlockMatrixFragment( nCol2, nRow1, nCol2, nRow2, rMark );// last column } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/oox/formulabase.cxx | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) New commits: commit 9a0bc6d06e30377d2ddf05bf5975dc8c850c8f97 Author: Eike Rathke Date: Sat Dec 15 23:29:35 2012 +0100 add missing *IFS pieces to Excel filter These were omitted in ba950a50b0d0863e18ef781214eaaff9a8684790 because oox/source/xls/formulabase.cxx was moved to source/filter/oox/formulabase.cxx AVERAGEIF, AVERAGEIFS, COUNTIFS, SUMIFS Merged from Apache OO, parts of http://svn.apache.org/viewvc?rev=1381452&view=rev Original Apache OO committer: Andrew Rist Original Author: Daniel Rentz [dr] Original Committer: Daniel Rentz [dr] # HG changeset patch # User Daniel Rentz [dr] # Date 1299664669 -3600 # Node ID 89feb2fb2947d76a15e2de8bc1def1edf20e4f88 # Parent 1bf6d73db8a4ee709aa4d9d9d827efafc9c611d2 Change-Id: I0756e1da4aa2acaefb86b5813e047b2768c192a1 diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx index 1a946ee..e7060ce 100644 --- a/sc/source/filter/oox/formulabase.cxx +++ b/sc/source/filter/oox/formulabase.cxx @@ -712,10 +712,10 @@ static const FunctionData saFuncTableOox[] = { 0,"CUBESET", 478,NOID, 2, 5, V, { VR, RX, VR }, 0 }, { 0,"CUBESETCOUNT", 479,NOID, 1, 1, V, { VR }, 0 }, { 0,"IFERROR", 480,NOID, 2, 2, V, { VO, RO }, 0 }, -{ 0,"COUNTIFS", 481,NOID, 2, MX, V, { RO, VR }, FUNCFLAG_PARAMPAIRS }, -{ 0,"SUMIFS", 482,NOID, 3, MX, V, { RO, RO, VR }, FUNCFLAG_PARAMPAIRS }, -{ 0,"AVERAGEIF",483,NOID, 2, 3, V, { RO, VR, RO }, 0 }, -{ 0,"AVERAGEIFS", 484,NOID, 3, MX, V, { RO, RO, VR }, FUNCFLAG_PARAMPAIRS } +{ "COUNTIFS", "COUNTIFS", 481,NOID, 2, MX, V, { RO, VR }, FUNCFLAG_MACROCALL | FUNCFLAG_PARAMPAIRS }, +{ "SUMIFS", "SUMIFS", 482,NOID, 3, MX, V, { RO, RO, VR }, FUNCFLAG_MACROCALL | FUNCFLAG_PARAMPAIRS }, +{ "AVERAGEIF", "AVERAGEIF",483,NOID, 2, 3, V, { RO, VR, RO }, FUNCFLAG_MACROCALL }, +{ "AVERAGEIFS", "AVERAGEIFS", 484,NOID, 3, MX, V, { RO, RO, VR }, FUNCFLAG_MACROCALL | FUNCFLAG_PARAMPAIRS } }; /** Functions defined by OpenFormula, but not supported by Calc or by Excel. */ @@ -776,8 +776,6 @@ FunctionParamInfoIterator::FunctionParamInfoIterator( const FunctionInfo& rFuncI mpParamInfoEnd( rFuncInfo.mpParamInfos + FUNCINFO_PARAMINFOCOUNT ), mbParamPairs( rFuncInfo.mbParamPairs ) { -OSL_ENSURE( !mbParamPairs || (mpParamInfo + 1 < mpParamInfoEnd), -"FunctionParamInfoIterator::FunctionParamInfoIterator - expecting at least 2 infos for paired parameters" ); } bool FunctionParamInfoIterator::isCalcOnlyParam() const @@ -797,12 +795,12 @@ FunctionParamInfoIterator& FunctionParamInfoIterator::operator++() // move pointer to next entry, if something explicit follows if( (mpParamInfo + 1 < mpParamInfoEnd) && (mpParamInfo[ 1 ].meValid != FUNC_PARAM_NONE) ) ++mpParamInfo; -// points to last info, but parameter pairs expected, move to previous info -else if( mbParamPairs ) ---mpParamInfo; // if last parameter type is 'Excel-only' or 'Calc-only', do not repeat it else if( isExcelOnlyParam() || isCalcOnlyParam() ) mpParamInfo = 0; +// points to last info, but parameter pairs expected, move to previous info +else if( mbParamPairs ) +--mpParamInfo; // otherwise: repeat last parameter class } return *this; @@ -867,8 +865,7 @@ FunctionProviderImpl::FunctionProviderImpl( FilterType eFilter, BiffType eBiff, initFuncs( saFuncTableBiff5, STATIC_ARRAY_END( saFuncTableBiff5 ), nMaxParam, bImportFilter ); if( eBiff >= BIFF8 ) initFuncs( saFuncTableBiff8, STATIC_ARRAY_END( saFuncTableBiff8 ), nMaxParam, bImportFilter ); -if( eFilter == FILTER_OOXML ) -initFuncs( saFuncTableOox, STATIC_ARRAY_END( saFuncTableOox ), nMaxParam, bImportFilter ); +initFuncs( saFuncTableOox, STATIC_ARRAY_END( saFuncTableOox ), nMaxParam, bImportFilter ); initFuncs( saFuncTableOdf, STATIC_ARRAY_END( saFuncTableOdf ), nMaxParam, bImportFilter ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/data/dpcache.cxx |5 + sc/source/core/data/dpshttab.cxx |8 2 files changed, 13 insertions(+) New commits: commit 33c5cd785762f272d2a88230af48261342800c3f Author: Kohei Yoshida Date: Fri Dec 14 22:34:38 2012 -0500 Do extra check on source range to make sure no funny things happen. Like a crash in the pivot layout dialog... :-/ Change-Id: I9a330ee3f39ebacb7299d24868bb13ee2a9c3ec5 diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx index afa4b1b..cf03b0d 100644 --- a/sc/source/core/data/dpcache.cxx +++ b/sc/source/core/data/dpcache.cxx @@ -300,6 +300,11 @@ bool ScDPCache::InitFromDoc(ScDocument* pDoc, const ScRange& rRange) SCROW nStartRow = rRange.aStart.Row(); // start of data SCROW nEndRow = rRange.aEnd.Row(); + +// Sanity check +if (!ValidRow(nStartRow) || !ValidRow(nEndRow) || nEndRow-nStartRow <= 0) +return false; + sal_uInt16 nStartCol = rRange.aStart.Col(); sal_uInt16 nEndCol = rRange.aEnd.Col(); sal_uInt16 nDocTab = rRange.aStart.Tab(); diff --git a/sc/source/core/data/dpshttab.cxx b/sc/source/core/data/dpshttab.cxx index b9de61f..ccf4659 100644 --- a/sc/source/core/data/dpshttab.cxx +++ b/sc/source/core/data/dpshttab.cxx @@ -312,6 +312,14 @@ sal_uLong ScSheetSourceDesc::CheckSourceRange() const if (!mpDoc) return STR_ERR_DATAPILOTSOURCE; +// Make sure the range is valid and sane. +const ScRange& rSrcRange = GetSourceRange(); +if (!rSrcRange.IsValid()) +return STR_ERR_DATAPILOTSOURCE; + +if (rSrcRange.aStart.Col() > rSrcRange.aEnd.Col() || rSrcRange.aStart.Row() > rSrcRange.aEnd.Row()) +return STR_ERR_DATAPILOTSOURCE; + return 0; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/tool/interpr3.cxx | 131 +++ 1 file changed, 64 insertions(+), 67 deletions(-) New commits: commit d8f34ebb234789da18f0c8f5461f580b4129bff1 Author: Eike Rathke Date: Fri Dec 14 12:27:41 2012 +0100 fix ugly and misleading indentation that crept in with rebase Change-Id: I8990411b5004358925dcb3a18a9b6f1a64c0b065 diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index 638806d..76f9a98 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -998,35 +998,35 @@ double ScInterpreter::GetBetaDist(double fXin, double fAlpha, double fBeta) return fResult; } - void ScInterpreter::ScBetaDist() - { - sal_uInt8 nParamCount = GetByte(); +void ScInterpreter::ScBetaDist() +{ +sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 3, 6 ) ) // expanded, see #i91547# - return; +return; double fLowerBound, fUpperBound; double alpha, beta, x; bool bIsCumulative; if (nParamCount == 6) bIsCumulative = GetBool(); - else +else bIsCumulative = true; if (nParamCount >= 5) fUpperBound = GetDouble(); else fUpperBound = 1.0; - if (nParamCount >= 4) +if (nParamCount >= 4) fLowerBound = GetDouble(); - else +else fLowerBound = 0.0; - beta = GetDouble(); - alpha = GetDouble(); - x = GetDouble(); +beta = GetDouble(); +alpha = GetDouble(); +x = GetDouble(); double fScale = fUpperBound - fLowerBound; if (fScale <= 0.0 || alpha <= 0.0 || beta <= 0.0) - { - PushIllegalArgument(); - return; - } +{ +PushIllegalArgument(); +return; +} if (bIsCumulative) // cumulative distribution function { // special cases @@ -1161,35 +1161,35 @@ void ScInterpreter::ScVariationen2() double ScInterpreter::GetBinomDistPMF(double x, double n, double p) // used in ScB and ScBinomDist // preconditions: 0.0 <= x <= n, 0.0 < p < 1.0; x,n integral although double -{ +{ double q = (0.5 - p) + 0.5; -double fFactor = pow(q, n); +double fFactor = pow(q, n); if (fFactor <=::std::numeric_limits::min()) -{ -fFactor = pow(p, n); +{ +fFactor = pow(p, n); if (fFactor <= ::std::numeric_limits::min()) return GetBetaDistPDF(p, x+1.0, n-x+1.0)/(n+1.0); -else -{ +else +{ sal_uInt32 max = static_cast(n - x); for (sal_uInt32 i = 0; i < max && fFactor > 0.0; i++) -fFactor *= (n-i)/(i+1)*q/p; +fFactor *= (n-i)/(i+1)*q/p; return fFactor; -} -} -else -{ +} +} +else +{ sal_uInt32 max = static_cast(x); for (sal_uInt32 i = 0; i < max && fFactor > 0.0; i++) -fFactor *= (n-i)/(i+1)*p/q; +fFactor *= (n-i)/(i+1)*p/q; return fFactor; -} } +} double lcl_GetBinomDistRange(double n, double xs,double xe, double fFactor /* q^n */, double p, double q) //preconditions: 0.0 <= xs < xe <= n; xs,xe,n integral although double -{ +{ sal_uInt32 i; double fSum; // skip summands index 0 to xs-1, start sum with index xs @@ -1199,12 +1199,12 @@ double lcl_GetBinomDistRange(double n, double xs,double xe, fSum = fFactor; // Summand xs sal_uInt32 nXe = static_cast(xe); for (i = nXs+1; i <= nXe && fFactor > 0.0; i++) -{ +{ fFactor *= (n-i+1)/i * p/q; -fSum += fFactor; -} +fSum += fFactor; +} return (fSum>1.0) ? 1.0 : fSum; -} +} void ScInterpreter::ScB() { @@ -1219,16 +1219,14 @@ void ScInterpreter::ScB() double n = ::rtl::math::approxFloor(GetDouble()); if (n < 0.0 || x < 0.0 || x > n || p < 0.0 || p > 1.0) PushIllegalArgument(); +else if (p == 0.0) +PushDouble( (x == 0.0) ? 1.0 : 0.0 ); +else if ( p == 1.0) +PushDouble( (x == n) ? 1.0 : 0.0); else -if (p == 0.0) -PushDouble( (x == 0.0) ? 1.0 : 0.0 ); -else -if ( p == 1.0) -PushDouble( (x == n) ? 1.0 : 0.0); -else -PushDouble(GetBinomDistPMF(x,n,p)); -} -else +PushDouble(GetBinomDistPMF(x,n,p)); +} +else { // nParamCount == 4 double xe = ::rtl::math::approxFloor(GetDouble()); double xs = ::rtl::math::approxFloor(GetDouble()); @@ -1237,11 +1235,11 @@ void ScInterpreter::ScB() double q = (0.5 - p) + 0.5; bool bIsValidX = ( 0.0 <= xs && xs <= xe && xe <=
[Libreoffice-commits] .: sc/source
sc/source/core/tool/interpr3.cxx | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) New commits: commit a9a734a680dda8c177f92cf2f14061c9b785ec8d Author: Werner Koerner Date: Tue Dec 11 22:23:39 2012 +0100 calc: fix mathematical error in CritBinom CRITBINOM(462,0.8,0.9), expected result 381, calculated value is 462. Similar errors in BinomDist, B, CritBinom and NegBinomDist were fixed by commit 5cf55f5b7800e443c4f087e72ae05abc8b7fef45. Change-Id: I9b12a1c4410ec72258ae1fb68409ad00c922b94c Reviewed-on: https://gerrit.libreoffice.org/1301 Reviewed-by: Eike Rathke Tested-by: Eike Rathke diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index ada1cff..638806d 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -1348,26 +1348,25 @@ void ScInterpreter::ScCritBinom() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScCritBinom" ); if ( MustHaveParamCount( GetByte(), 3 ) ) { -double alpha = GetDouble();// alpha -double p = GetDouble();// p +double alpha = GetDouble(); +double p = GetDouble(); double n = ::rtl::math::approxFloor(GetDouble()); if (n < 0.0 || alpha <= 0.0 || alpha >= 1.0 || p < 0.0 || p > 1.0) PushIllegalArgument(); else { -double q = 1.0 - p; +double q = (0.5 - p) + 0.5; // get one bit more for p near 1.0 double fFactor = pow(q,n); -if (fFactor == 0.0) +if (fFactor <= ::std::numeric_limits::min()) { fFactor = pow(p, n); -if (fFactor == 0.0) +if (fFactor <= ::std::numeric_limits::min()) PushNoValue(); else { -double fSum = 1.0 - fFactor; sal_uLong max = (sal_uLong) n; -sal_uLong i; - -for ( i = 0; i < max && fSum >= alpha; i++) +double fSum = 1.0 - fFactor; +sal_uInt32 max = static_cast (n), i; +for (i = 0; i < max && fSum >= alpha; i++) { fFactor *= (n-i)/(i+1)*q/p; fSum -= fFactor; @@ -1377,10 +1376,9 @@ void ScInterpreter::ScCritBinom() } else { -double fSum = fFactor; sal_uLong max = (sal_uLong) n; -sal_uLong i; - -for ( i = 0; i < max && fSum < alpha; i++) +double fSum = fFactor; +sal_uInt32 max = static_cast (n), i; +for (i = 0; i < max && fSum < alpha; i++) { fFactor *= (n-i)/(i+1)*p/q; fSum += fFactor; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source xmloff/source
sc/source/core/tool/addincol.cxx |1 + xmloff/source/style/xmlnumfe.cxx |6 ++ 2 files changed, 7 insertions(+) New commits: commit 34b7826f9814b09dcd6aba15552bef1c330f3db2 Author: Eike Rathke Date: Thu Dec 13 23:54:44 2012 +0100 added some FIXME-BCP47 markers Change-Id: I085ca72b6c2dc1e73f4af7233017895bf92b2ef8 diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index bb29171..8f63781 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -175,6 +175,7 @@ sal_Bool ScUnoAddInFuncData::GetExcelName( LanguageType eDestLang, ::rtl::OUStri const sheet::LocalizedName* pArray = rSequence.getConstArray(); long i; +/* FIXME-BCP47: we may want to handle language tags here as well. */ rtl::OUString aLangStr, aCountryStr; LanguageTag( eDestLang ).getIsoLanguageCountry( aLangStr, aCountryStr ); rtl::OUString aUserLang = aLangStr.toAsciiLowerCase(); diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index 694d939..98e3e9e 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -342,6 +342,12 @@ void SvXMLNumFmtExport::AddLanguageAttr_Impl( sal_Int32 nLang ) { if ( nLang != LANGUAGE_SYSTEM ) { +/* FIXME-BCP47: handle language tags! + * ODF now provides fo:script, and rfc-language-tag attribute in case a + * locale can't be expressed using these three ISO codes. + * Of course these need to be read in xmlnumfi.cxx then.. + * In general all places using XML_LANGUAGE and XML_COUNTRY need to be + * adapted once we really support bcp47. */ OUString aLangStr, aCountryStr; LanguageTag( (LanguageType)nLang ).getIsoLanguageCountry( aLangStr, aCountryStr ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/data/dpobject.cxx |2 +- sc/source/core/data/dpoutput.cxx |2 +- sc/source/ui/cctrl/dpcontrol.cxx | 31 +-- sc/source/ui/inc/dpcontrol.hxx |3 --- sc/source/ui/view/gridwin4.cxx |2 -- 5 files changed, 7 insertions(+), 33 deletions(-) New commits: commit e209615b121f92f3668fc68903aa31e7ce6fdac6 Author: Kohei Yoshida Date: Wed Dec 12 18:38:29 2012 -0500 Revert "fix for bnc#791731 preserve cell formatting of datapilot area (" This reverts commit 307ac3f53d670a28e60471859aed03e4e13519d6. That change causes nasty side-effect of leaving behind borders and buttons that should've been removed when pivot table's geometry changes. Change-Id: I46fa84c128e755516fc699810c53c869188c6452 diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 9b78336..0c835cf 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -780,7 +780,7 @@ void ScDPObject::Output( const ScAddress& rPos ) // clear old output area pDoc->DeleteAreaTab( aOutRange.aStart.Col(), aOutRange.aStart.Row(), aOutRange.aEnd.Col(), aOutRange.aEnd.Row(), - aOutRange.aStart.Tab(), IDF_CONTENTS | IDF_OBJECTS ); + aOutRange.aStart.Tab(), IDF_ALL ); pDoc->RemoveFlagsTab( aOutRange.aStart.Col(), aOutRange.aStart.Row(), aOutRange.aEnd.Col(), aOutRange.aEnd.Row(), aOutRange.aStart.Tab(), SC_MF_AUTO ); diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 7c38ee3..5038d43 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -952,7 +952,7 @@ void ScDPOutput::Output() // clear whole (new) output area //! when modifying table, clear old area //! include IDF_OBJECTS ??? -pDoc->DeleteAreaTab( aStartPos.Col(), aStartPos.Row(), nTabEndCol, nTabEndRow, nTab, IDF_CONTENTS | IDF_OBJECTS); +pDoc->DeleteAreaTab( aStartPos.Col(), aStartPos.Row(), nTabEndCol, nTabEndRow, nTab, IDF_ALL ); if ( bDoFilter ) lcl_DoFilterButton( pDoc, aStartPos.Col(), aStartPos.Row(), nTab ); diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index e57a7a5..c866ded 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -26,8 +26,6 @@ #include "document.hxx" #include "docpool.hxx" #include "patattr.hxx" -#include -#include using rtl::OUString; @@ -35,7 +33,6 @@ ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pSt mpDoc(pDoc), mpOutDev(pOutDev), mpStyle(pStyle), -mpPattern(NULL), mbBaseButton(true), mbPopupButton(false), mbHasHiddenMember(false), @@ -108,15 +105,8 @@ void ScDPFieldButton::draw() { // Background Rectangle aRect(maPos, maSize); -Color aBackCol = mpStyle->GetFaceColor(); -if ( mpPattern ) -{ -const SvxBrushItem& rBrushItem = (const SvxBrushItem&)mpPattern->GetItemSet().Get( ATTR_BACKGROUND ); -if ( rBrushItem.GetColor() != COL_TRANSPARENT ) -aBackCol = rBrushItem.GetColor(); -} -mpOutDev->SetFillColor(aBackCol); -mpOutDev->SetLineColor(aBackCol); +mpOutDev->SetLineColor(mpStyle->GetFaceColor()); +mpOutDev->SetFillColor(mpStyle->GetFaceColor()); mpOutDev->DrawRect(aRect); // Border lines @@ -133,27 +123,16 @@ void ScDPFieldButton::draw() // Field name. // Get the font and size the same way as in scenario selection (lcl_DrawOneFrame in gridwin4.cxx) Font aTextFont( mpStyle->GetAppFont() ); -Color aButTextCol = mpStyle->GetButtonTextColor(); if ( mpDoc ) { +// use ScPatternAttr::GetFont only for font size Font aAttrFont; -if ( mpPattern ) -{ - mpPattern->GetFont( aAttrFont, SC_AUTOCOL_DISPLAY, mpOutDev, &maZoomY ); - const SvxColorItem& rColorItem = (const SvxColorItem&)mpPattern->GetItemSet().Get( ATTR_FONT_COLOR ); - if ( rColorItem.GetValue().GetColor() != COL_TRANSPARENT ) - aButTextCol = rColorItem.GetValue(); -} -else -{ -// use ScPatternAttr::GetFont only for font size -static_cast(mpDoc->GetPool()->GetDefaultItem(ATTR_PATTERN)). +static_cast(mpDoc->GetPool()->GetDefaultItem(ATTR_PATTERN)). GetFont( aAttrFont, SC_AUTOCOL_BLACK, mpOutDev, &maZoomY ); -} aTextFont.SetSize( aAttrFont.GetSize() ); } mpOutDev->SetFont(aTextFont); -mpOutDev->SetTextColor( aButTextCol ); +mpOutDev->SetTextColor(mpStyle->GetButtonTextColor()); Point aTextPos = maPos; long nTH
[Libreoffice-commits] .: sc/source
sc/source/core/data/bcaslot.cxx | 183 +--- sc/source/core/inc/bcaslot.hxx | 53 +-- 2 files changed, 145 insertions(+), 91 deletions(-) New commits: commit a60b149eede0c79dc08f00fd76d648a9cce0e660 Author: Eike Rathke Date: Wed Dec 12 22:54:28 2012 +0100 reworked solution for i#118012 crash during deletion of rows commit 16155fdc39c004dc924a3b6919eb7c86da23c119 introduced a bottleneck in area broadcasts with the change from http://svn.apache.org/viewvc?view=revision&revision=1297916 That for each broadcast copied all areas in the affected slot(s) before broadcasting, just in case that during Notify() an area would be removed from the same slot invalidating the iterator, and attempted to find the area again in the original set. For documents with lots of areas in a slot and/or lots of slots that would be a major performance penalty. Reworked such that to-be-erased area entries are marked and remembered instead and cleaned up after iteration. Change-Id: Ia485941746f435f8410d2084868263e84f25ffcb diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx index 602f6a7..2a0ca67 100644 --- a/sc/source/core/data/bcaslot.cxx +++ b/sc/source/core/data/bcaslot.cxx @@ -21,8 +21,6 @@ #include #include -#include - #include "document.hxx" #include "brdcst.hxx" #include "bcaslot.hxx" @@ -114,7 +112,8 @@ ScBroadcastAreaSlot::ScBroadcastAreaSlot( ScDocument* pDocument, ScBroadcastAreaSlotMachine* pBASMa ) : aTmpSeekBroadcastArea( ScRange()), pDoc( pDocument ), -pBASM( pBASMa ) +pBASM( pBASMa ), +mbInBroadcastIteration( false) { } @@ -126,7 +125,7 @@ ScBroadcastAreaSlot::~ScBroadcastAreaSlot() { // Prevent hash from accessing dangling pointer in case area is // deleted. -ScBroadcastArea* pArea = *aIter; +ScBroadcastArea* pArea = (*aIter).mpArea; // Erase all so no hash will be accessed upon destruction of the // boost::unordered_map. aBroadcastAreaTbl.erase( aIter++); @@ -174,7 +173,7 @@ bool ScBroadcastAreaSlot::StartListeningArea( const ScRange& rRange, // would add quite some penalty for all but the first formula cell. ScBroadcastAreas::const_iterator aIter( FindBroadcastArea( rRange)); if (aIter != aBroadcastAreaTbl.end()) -rpArea = *aIter; +rpArea = (*aIter).mpArea; else { rpArea = new ScBroadcastArea( rRange); @@ -221,18 +220,15 @@ void ScBroadcastAreaSlot::EndListeningArea( const ScRange& rRange, if ( !rpArea ) { ScBroadcastAreas::iterator aIter( FindBroadcastArea( rRange)); -if (aIter == aBroadcastAreaTbl.end()) +if (aIter == aBroadcastAreaTbl.end() || isMarkedErased( aIter)) return; -rpArea = *aIter; +rpArea = (*aIter).mpArea; pListener->EndListening( rpArea->GetBroadcaster() ); if ( !rpArea->GetBroadcaster().HasListeners() ) { // if nobody is listening we can dispose it -aBroadcastAreaTbl.erase( aIter); -if ( !rpArea->DecRef() ) -{ -delete rpArea; -rpArea = NULL; -} +if (rpArea->GetRef() == 1) +rpArea = NULL; // will be deleted by erase +EraseArea( aIter); } } else @@ -240,15 +236,12 @@ void ScBroadcastAreaSlot::EndListeningArea( const ScRange& rRange, if ( !rpArea->GetBroadcaster().HasListeners() ) { ScBroadcastAreas::iterator aIter( FindBroadcastArea( rRange)); -if (aIter == aBroadcastAreaTbl.end()) +if (aIter == aBroadcastAreaTbl.end() || isMarkedErased( aIter)) return; -OSL_ENSURE( *aIter == rpArea, "EndListeningArea: area pointer mismatch"); -aBroadcastAreaTbl.erase( aIter); -if ( !rpArea->DecRef() ) -{ -delete rpArea; -rpArea = NULL; -} +OSL_ENSURE( (*aIter).mpArea == rpArea, "EndListeningArea: area pointer mismatch"); +if (rpArea->GetRef() == 1) +rpArea = NULL; // will be deleted by erase +EraseArea( aIter); } } } @@ -262,30 +255,20 @@ ScBroadcastAreas::iterator ScBroadcastAreaSlot::FindBroadcastArea( } -sal_Bool ScBroadcastAreaSlot::AreaBroadcast( const ScHint& rHint) const +sal_Bool ScBroadcastAreaSlot::AreaBroadcast( const ScHint& rHint) { if (aBroadcastAreaTbl.empty()) return false; +bool bInBroadcast = mbInBroadcastIteration; +mbInBroadcastIteration = true; sal_Bool bIsBroadcasted = false; - -// issue 118012 -// do not iterate on as its reveals that its iterators -// are destroyed during notification. -std::vector< ScBroadcastArea* > aCopyForIteration(
[Libreoffice-commits] .: sc/source
sc/source/core/tool/address.cxx | 17 ++ sc/source/ui/view/gridwin.cxx | 47 +++- 2 files changed, 63 insertions(+), 1 deletion(-) New commits: commit b30b0010c00c0cbfe4bd7e035255a6328ff68dee Author: Kohei Yoshida Date: Tue Dec 11 12:09:21 2012 -0500 Support non 'Calc A1' reference syntax in HYPERLINK function. It uses the current formula syntax set in the Formula options page to interpret the URL in HYPERLINK function. Change-Id: Ic394d10b1e781fcd6a6949f62949c5cb137328bc diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 34a7306..08e29de 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -156,7 +156,24 @@ static bool lcl_ScRange_External_TabSpan( ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager(); if (pRefMgr->isOwnDocument( rExternDocName)) +{ +// This is an internal document. Get the sheet positions from the +// ScDocument instance. +if (rStartTabName.Len()) +{ +SCTAB nTab; +if (pDoc->GetTable(rStartTabName, nTab)) +rRange.aStart.SetTab(nTab); +} + +if (rEndTabName.Len()) +{ +SCTAB nTab; +if (pDoc->GetTable(rEndTabName, nTab)) +rRange.aEnd.SetTab(nTab); +} return !pExtInfo || !pExtInfo->mbExternal; +} sal_uInt16 nFileId = pRefMgr->getExternalFileId( rExternDocName); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index c116d43..be9520d 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -119,6 +119,7 @@ #include "markdata.hxx" #include "checklistmenu.hrc" #include "strload.hxx" +#include "externalrefmgr.hxx" #include #include @@ -2371,7 +2372,51 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) if ( GetEditUrl( rMEvt.GetPosPixel(), &aName, &aUrl, &aTarget ) ) { nMouseStatus = SC_GM_NONE; // keinen Doppelklick anfangen -ScGlobal::OpenURL( aUrl, aTarget ); + +// ScGlobal::OpenURL() only understands Calc A1 style syntax. +// Convert it to Calc A1 before calling OpenURL(). + +if (pDoc->GetAddressConvention() == formula::FormulaGrammar::CONV_OOO) +ScGlobal::OpenURL(aUrl, aTarget); +else +{ +ScAddress aTempAddr; +ScAddress::ExternalInfo aExtInfo; +sal_uInt16 nRes = aTempAddr.Parse(aUrl, pDoc, pDoc->GetAddressConvention(), &aExtInfo); +if (!(nRes & SCA_VALID)) +{ +// Not a reference string. Pass it through unmodified. +ScGlobal::OpenURL(aUrl, aTarget); +return; +} + +OUStringBuffer aBuf; +if (aExtInfo.mbExternal) +{ +// External reference. +ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager(); +const OUString* pStr = pRefMgr->getExternalFileName(aExtInfo.mnFileId); +if (pStr) +aBuf.append(*pStr); + +aBuf.append('#'); +aBuf.append(aExtInfo.maTabName); +aBuf.append('.'); +OUString aRefCalcA1; +aTempAddr.Format(aRefCalcA1, SCA_ABS, NULL, formula::FormulaGrammar::CONV_OOO); +aBuf.append(aRefCalcA1); +ScGlobal::OpenURL(aBuf.makeStringAndClear(), aTarget); +} +else +{ +// Internal reference. +aBuf.append('#'); +OUString aUrlCalcA1; +aTempAddr.Format(aUrlCalcA1, SCA_ABS_3D, pDoc, formula::FormulaGrammar::CONV_OOO); +aBuf.append(aUrlCalcA1); +ScGlobal::OpenURL(aBuf.makeStringAndClear(), aTarget); +} +} // fire worksheet_followhyperlink event uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = pDoc->GetVbaEventProcessor(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/tool/cellkeywords.inl |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 8532cbd3e685d7a1e4e26bf7c2b7bf0b1c38c5be Author: LuboÅ¡ LuÅák Date: Tue Dec 11 15:09:41 2012 +0100 simply use string literals Change-Id: Id82c9dc43d3af21d434ed5f9b7ef3bdae9c4289b diff --git a/sc/source/core/tool/cellkeywords.inl b/sc/source/core/tool/cellkeywords.inl index ce58ccf..0d6c57f 100644 --- a/sc/source/core/tool/cellkeywords.inl +++ b/sc/source/core/tool/cellkeywords.inl @@ -21,7 +21,7 @@ // --- // French language locale (automatically generated) // --- -static const Locale aFr(OUString(RTL_CONSTASCII_USTRINGPARAM("fr")), OUString(), OUString()); +static const Locale aFr("fr", "", ""); // pre instantiations of localized function names static const sal_Unicode cell_address_fr[] = { @@ -76,7 +76,7 @@ addToMap(pFr, aFr); // --- // Hungarian language locale (automatically generated) // --- -static const Locale aHu(OUString(RTL_CONSTASCII_USTRINGPARAM("hu")), OUString(), OUString()); +static const Locale aHu("hu", "", ""); // pre instantiations of localized function names static const sal_Unicode cell_address_hu[] = { @@ -146,7 +146,7 @@ addToMap(pHu, aHu); // --- // German language locale (automatically generated) // --- -static const Locale aDe(OUString(RTL_CONSTASCII_USTRINGPARAM("de")), OUString(), OUString()); +static const Locale aDe("de", "", ""); // pre instantiations of localized function names static const sal_Unicode cell_row_de[] = { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source sd/source sfx2/inc sfx2/source starmath/inc starmath/source sw/source
sc/source/ui/inc/prevwsh.hxx|3 ++- sc/source/ui/inc/tabvwsh.hxx|1 + sc/source/ui/view/prevwsh.cxx |5 + sc/source/ui/view/tabvwsh4.cxx |5 + sd/source/ui/inc/ViewShellBase.hxx |5 - sd/source/ui/view/ViewShellBase.cxx | 12 sfx2/inc/sfx2/viewsh.hxx|3 ++- sfx2/source/view/viewprn.cxx|7 ++- starmath/inc/view.hxx |1 + starmath/source/view.cxx|4 sw/source/ui/inc/pview.hxx |3 ++- sw/source/ui/inc/view.hxx |5 +++-- sw/source/ui/uiview/pview.cxx |5 + sw/source/ui/uiview/viewprt.cxx |5 + 14 files changed, 41 insertions(+), 23 deletions(-) New commits: commit d1660f19d5c8c60d8549b594a36d13a5edcf15a3 Author: Caolán McNamara Date: Thu Dec 6 21:05:57 2012 + an app can have print options without a print options dialog e.g. draw and impress have print options, but no print options dialog (It's plausible that we should merge the print options in the print dialog with the print options in the options... dialog of the printer settings dialog) Change-Id: I25c029ad8ba482b1e8d8d5974cc8de99584b9a55 diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx index 60d0872..7530478 100644 --- a/sc/source/ui/inc/prevwsh.hxx +++ b/sc/source/ui/inc/prevwsh.hxx @@ -110,7 +110,8 @@ public: virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); virtual SfxPrinter* GetPrinter( sal_Bool bCreate = false ); -virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ); +virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ); +virtual boolHasPrintOptionsPage() const; virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); voidAddAccessibilityObject( SfxListener& rObject ); diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 54606fa..d1e53ad 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -353,6 +353,7 @@ public: virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false ); +virtual boolHasPrintOptionsPage() const; virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); voidConnectObject( SdrOle2Obj* pObj ); diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 505544e..37e0e86 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -570,6 +570,11 @@ sal_uInt16 ScPreviewShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiff return pDocShell->SetPrinter( pNewPrinter, nDiffFlags ); } +bool ScPreviewShell::HasPrintOptionsPage() const +{ +return true; +} + SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ) { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 799f953..d154b01 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1093,6 +1093,11 @@ sal_uInt16 ScTabViewShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiff return GetViewData()->GetDocShell()->SetPrinter( pNewPrinter, nDiffFlags ); } +bool ScTabViewShell::HasPrintOptionsPage() const +{ +return true; +} + SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ) { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx index 9377c83..458896a 100644 --- a/sd/source/ui/inc/ViewShellBase.hxx +++ b/sd/source/ui/inc/ViewShellBase.hxx @@ -139,11 +139,6 @@ public: SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false); -/// Forwarded to the print manager. -virtual SfxTabPage* CreatePrintOptionsPage ( -::Window *pParent, -const SfxItemSet &rOptions); - /// Forward methods to main sub shell. virtual void WriteUserDataSequence ( ::com::sun::star::uno::Sequence < diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index d732280..0cd5c67 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -626,18 +626,6 @@ sal_uInt16 ViewShellBase::SetPrinter ( -SfxTabPage* ViewShellBase::CreatePrintOptionsPage( -::Window *pParent, -const SfxItemSet &rOptions) -{ -(void)pParent; -(void)rOptions; -return NULL; -} - - - - void ViewShellBase::UIActivati
[Libreoffice-commits] .: sc/source
sc/source/ui/condformat/condformatdlg.cxx |4 +--- sc/source/ui/condformat/condformatmgr.cxx | 11 +-- sc/source/ui/dbgui/sortkeydlg.cxx |1 - sc/source/ui/inc/condformatdlg.hxx|4 sc/source/ui/inc/condformatmgr.hxx|5 ++--- sc/source/ui/inc/sortkeydlg.hxx |3 --- 6 files changed, 8 insertions(+), 20 deletions(-) New commits: commit 4ee829af622a2932ffad8f9712e2563579746cf0 Author: Stephan Bergmann Date: Thu Dec 6 18:15:33 2012 +0100 -Werror,-Wunused-private-field Change-Id: I1866be3b7feb42f0b1a24bf214a1276b76f883b5 diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 3398188..6236432 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -368,9 +368,7 @@ ScCondFormatDlg::ScCondFormatDlg(Window* pParent, ScDocument* pDoc, const ScCond maCondFormList( this, ScResId( CTRL_LIST ), pDoc, pFormat, rRange, rPos, eType ), maPos(rPos), mpDoc(pDoc), -mpFormat(pFormat), -mpLastEdit(NULL), -meType(eType) +mpLastEdit(NULL) { rtl::OUStringBuffer aTitle( GetText() ); aTitle.append(rtl::OUString(" ")); diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index 5a5ea1b..af9e383 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -37,12 +37,11 @@ #define ITEMID_CONDITION 2 -ScCondFormatManagerWindow::ScCondFormatManagerWindow(Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList, const ScAddress& rPos): +ScCondFormatManagerWindow::ScCondFormatManagerWindow(Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList): SvTabListBox(pParent, WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP), maHeaderBar( pParent, WB_BUTTONSTYLE | WB_BOTTOMBORDER ), mpDoc(pDoc), -mpFormatList(pFormatList), -mrPos(rPos) +mpFormatList(pFormatList) { Size aBoxSize( pParent->GetOutputSizePixel() ); @@ -142,9 +141,9 @@ IMPL_LINK_NOARG(ScCondFormatManagerWindow, HeaderEndDragHdl) return 0; } -ScCondFormatManagerCtrl::ScCondFormatManagerCtrl(Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList, const ScAddress& rPos): +ScCondFormatManagerCtrl::ScCondFormatManagerCtrl(Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList): Control(pParent, ScResId(CTRL_TABLE)), -maWdManager(this, pDoc, pFormatList, rPos) +maWdManager(this, pDoc, pFormatList) { } @@ -172,7 +171,7 @@ ScCondFormatManagerDlg::ScCondFormatManagerDlg(Window* pParent, ScDocument* pDoc maBtnCancel(this, ScResId(BTN_CANCEL)), maFlLine(this, ScResId(FL_LINE)), mpFormatList( pFormatList ? new ScConditionalFormatList(*pFormatList) : NULL), -maCtrlManager(this, pDoc, mpFormatList, rPos), +maCtrlManager(this, pDoc, mpFormatList), mpDoc(pDoc), maPos(rPos), mbModified(false) diff --git a/sc/source/ui/dbgui/sortkeydlg.cxx b/sc/source/ui/dbgui/sortkeydlg.cxx index 45d65ca..76a8747 100644 --- a/sc/source/ui/dbgui/sortkeydlg.cxx +++ b/sc/source/ui/dbgui/sortkeydlg.cxx @@ -109,7 +109,6 @@ ScSortKeyCtrl::ScSortKeyCtrl(SfxTabPage* pParent, ScSortKeyItems& rItems) : m_aSortWin(pParent, rItems) , m_rScrolledWindow(*pParent->get("SortCriteriaPage")) , m_rVertScroll(m_rScrolledWindow.getVertScrollBar()) -, nThumbPos(0) { m_rVertScroll.EnableDrag(); m_rVertScroll.Show(); diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index 588d04d..5541c49 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -112,12 +112,8 @@ private: ScAddress maPos; ScDocument* mpDoc; -const ScConditionalFormat* mpFormat; - formula::RefEdit* mpLastEdit; -condformat::dialog::ScCondFormatDialogType meType; - DECL_LINK( EdRangeModifyHdl, Edit* ); protected: diff --git a/sc/source/ui/inc/condformatmgr.hxx b/sc/source/ui/inc/condformatmgr.hxx index c13ff6b..d3c9099 100644 --- a/sc/source/ui/inc/condformatmgr.hxx +++ b/sc/source/ui/inc/condformatmgr.hxx @@ -50,13 +50,12 @@ private: HeaderBar maHeaderBar; ScDocument* mpDoc; ScConditionalFormatList* mpFormatList; -const ScAddress& mrPos; std::map maMapLBoxEntryToCondIndex; DECL_LINK( HeaderEndDragHdl, void* ); public: -ScCondFormatManagerWindow( Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList, const ScAddress& rPos ); +ScCondFormatManagerWindow( Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList ); void DeleteSelection(); ScConditionalFormat* GetSelection(); @@ -66,7 +65,7 @@ public: class ScCondFormatManagerCtrl : Control { public: -ScCondFormatManagerCtrl(Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList, const ScAddress&
[Libreoffice-commits] .: sc/source
sc/source/ui/inc/gridwin.hxx |4 +++- sc/source/ui/view/gridwin.cxx | 39 +++ 2 files changed, 26 insertions(+), 17 deletions(-) New commits: commit abb1e3352b21d26e2ea00f504162540daa7d69f2 Author: Kohei Yoshida Date: Thu Dec 6 00:32:22 2012 -0500 Avoid activating window pane when launching popup window. Else, activating another window pane where the cursor is not would cause the pivot table field popup to immediately get dismissed after launch because ClickExtern() gets called from ActivatePart(). For example, imagine a field popup button is on C2, the cell cursor is on E5, and the window is frozen between rows 2 and 3. Clicking the popup button in C2 would launch it for a brief second and dismiss it immediately afterward. Conceptually, launching a popup in another pane shouldn't activate that pane anyway. So it makes sense not to activate it for that scenario. Change-Id: Ib970cb898fb9c79d254411e2519cfce74c60b72f diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 055924a..fcd4dbf 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -93,6 +93,8 @@ private: boost::scoped_ptr mpAutoFillRect; +struct MouseEventState; + /** * Stores current visible column and row ranges, used to avoid expensive * operations on objects that are outside visible area. @@ -228,7 +230,7 @@ private: sal_Int8DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPosX, SCROW nDestPosY, const Point& rLogicPos, sal_Int8 nDndAction ); -voidHandleMouseButtonDown( const MouseEvent& rMEvt ); +voidHandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventState& rState ); boolDrawMouseButtonDown(const MouseEvent& rMEvt); boolDrawMouseButtonUp(const MouseEvent& rMEvt); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index fba27b7..c116d43 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -155,6 +155,13 @@ extern SfxViewShell* pScActiveViewShell;// global.cxx extern sal_uInt16 nScClickMouseModifier;// global.cxx extern sal_uInt16 nScFillModeMouseModifier; // global.cxx +struct ScGridWindow::MouseEventState +{ +bool mbActivatePart; + +MouseEventState() : mbActivatePart(false) {} +}; + #define SC_FILTERLISTBOX_LINES 12 // @@ -1720,7 +1727,10 @@ void ScGridWindow::MouseButtonDown( const MouseEvent& rMEvt ) { nNestedButtonState = SC_NESTEDBUTTON_DOWN; -HandleMouseButtonDown( rMEvt ); +MouseEventState aState; +HandleMouseButtonDown(rMEvt, aState); +if (aState.mbActivatePart) +pViewData->GetView()->ActivatePart(eWhich); if ( nNestedButtonState == SC_NESTEDBUTTON_UP ) { @@ -1737,7 +1747,7 @@ void ScGridWindow::MouseButtonDown( const MouseEvent& rMEvt ) nNestedButtonState = SC_NESTEDBUTTON_NONE; } -void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt ) +void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventState& rState ) { // We have to check if a context menu is shown and we have an UI // active inplace client. In that case we have to ignore the event. @@ -1818,12 +1828,9 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt ) if (!bDouble) nMouseStatus = SC_GM_NONE; -if (!bFormulaMode) -{ -if ( pViewData->GetActivePart() != eWhich ) -pViewData->GetView()->ActivatePart( eWhich ); -} -else +rState.mbActivatePart = !bFormulaMode; // Don't activate when in formula mode. + +if (bFormulaMode) { ScViewSelectionEngine* pSelEng = pViewData->GetView()->GetSelEngine(); pSelEng->SetWindow(this); @@ -1879,9 +1886,7 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt ) { bRFMouse = true;// die anderen Variablen sind oben initialisiert -if ( pViewData->GetActivePart() != eWhich ) -pViewData->GetView()->ActivatePart( eWhich ); //! schon oben immer ??? - +rState.mbActivatePart = true; // always activate ? StartTracking(); return; } @@ -1892,7 +1897,7 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt ) if ( bDouble ) pViewData->GetView()->FillCrossDblClick(); else -pScMod->InputEnterHandler();// Autofill etc. +pScMod->InputEnterHandler();// Autofill etc. } if ( !bCrossPointer ) @@ -1927,10 +1932,7 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt ) SCTAB nTab = pViewData->GetTabNo(); ScDocument
[Libreoffice-commits] .: sc/source
sc/source/core/data/conditio.cxx | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) New commits: commit af3030e6bc0ac443387bca80d2969ad1caa2606b Author: Markus Mohrhard Date: Wed Dec 5 05:51:20 2012 +0100 OSL_* to SAL_WARN in conditio.cxx Change-Id: I866217341572a79f653fb9900789a7e523b620a6 diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index c193607..a684e63 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -465,7 +465,7 @@ void ScConditionEntry::CompileXML() void ScConditionEntry::SetSrcString( const rtl::OUString& rNew ) { // aSrcString is only evaluated in CompileXML -OSL_ENSURE( mpDoc->IsImportingXML(), "SetSrcString is only valid for XML import" ); +SAL_WARN_IF( !mpDoc->IsImportingXML(), "sc", "SetSrcString is only valid for XML import" ); aSrcString = rNew; } @@ -1138,7 +1138,7 @@ bool ScConditionEntry::IsValid( double nArg, const ScAddress& rPos ) const bValid = !bValid; break; default: -OSL_FAIL("unbekannte Operation bei ScConditionEntry"); +SAL_WARN("sc", "unbekannte Operation bei ScConditionEntry"); break; } return bValid; @@ -1246,7 +1246,7 @@ bool ScConditionEntry::IsValidStr( const rtl::OUString& rArg, const ScAddress& r break; // SC_COND_DIRECT schon oben abgefragt default: -OSL_FAIL("unbekannte Operation bei ScConditionEntry"); +SAL_WARN("sc", "unbekannte Operation bei ScConditionEntry"); bValid = false; break; } @@ -1317,7 +1317,7 @@ rtl::OUString ScConditionEntry::GetExpression( const ScAddress& rCursor, sal_uIn } else { -OSL_FAIL("GetExpression: falscher Index"); +SAL_WARN("sc", "GetExpression: falscher Index"); } return aRet; @@ -1356,7 +1356,7 @@ ScTokenArray* ScConditionEntry::CreateTokenArry( sal_uInt16 nIndex ) const } else { -OSL_FAIL("GetExpression: falscher Index"); +SAL_WARN("sc", "GetExpression: falscher Index"); } return pRet; @@ -2110,7 +2110,7 @@ ScConditionalFormat* ScConditionalFormatList::GetFormat( sal_uInt32 nKey ) if (itr->GetKey() == nKey) return &(*itr); -OSL_FAIL("ScConditionalFormatList: Eintrag nicht gefunden"); +SAL_WARN("sc", "ScConditionalFormatList: Eintrag nicht gefunden"); return NULL; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/dbgui/pvlaydlg.cxx | 40 +++- sc/source/ui/inc/pvlaydlg.hxx |4 ++-- 2 files changed, 25 insertions(+), 19 deletions(-) New commits: commit 8e43393c9514f39e6b43e581503b61177a00bd36 Author: Kohei Yoshida Date: Wed Dec 5 16:34:01 2012 -0500 Don't forget to set focus handler for the reference edit boxes. Or else the reference mode wouldn't work at all. Also rename the pointer that holds the current reference edit box instance, to be consistent with our other reference edit dialogs. Change-Id: I72e98b5a81b4c313d41c5bd0e429781997cf78b2 diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index 3dfa58e..3ef8e0b 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -116,7 +116,7 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window mxDlgDPObject( new ScDPObject( rDPObject ) ), mpViewData( ((ScTabViewShell*)SfxViewShell::Current())->GetViewData() ), mpDoc( ((ScTabViewShell*)SfxViewShell::Current())->GetViewData()->GetDocument() ), -mpActiveEdit(NULL), +mpRefInputEdit(NULL), maStrUndefined(SC_RESSTR(SCSTR_UNDEFINED)), maStrNewTable(SC_RESSTR(SCSTR_NEWTABLE)), @@ -185,6 +185,12 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window maBtnOk.SetClickHdl( LINK( this, ScPivotLayoutDlg, OkHdl ) ); maBtnCancel.SetClickHdl( LINK( this, ScPivotLayoutDlg, CancelHdl ) ); +// Set focus handler for the reference edit text boxes. +Link aGetFocusLink = LINK(this, ScPivotLayoutDlg, GetFocusHdl); +if (maEdInPos.IsEnabled()) +maEdInPos.SetGetFocusHdl(aGetFocusLink); +maEdOutPos.SetGetFocusHdl(aGetFocusLink); + if ( mpViewData && mpDoc ) { /* @@ -1597,23 +1603,23 @@ sal_uInt8 ScPivotLayoutDlg::GetNextDupCount( void ScPivotLayoutDlg::SetReference( const ScRange& rRef, ScDocument* pDoc ) { -if ( !mbRefInputMode || !mpActiveEdit ) +if (!mbRefInputMode || !mpRefInputEdit) return; if ( rRef.aStart != rRef.aEnd ) -RefInputStart( mpActiveEdit ); +RefInputStart(mpRefInputEdit); -if ( mpActiveEdit == &maEdInPos ) +if (mpRefInputEdit == &maEdInPos) { rtl::OUString aRefStr; rRef.Format( aRefStr, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention() ); -mpActiveEdit->SetRefString( aRefStr ); +mpRefInputEdit->SetRefString(aRefStr); } -else if ( mpActiveEdit == &maEdOutPos ) +else if (mpRefInputEdit == &maEdOutPos) { rtl::OUString aRefStr; rRef.aStart.Format( aRefStr, STD_FORMAT, pDoc, pDoc->GetAddressConvention() ); -mpActiveEdit->SetRefString( aRefStr ); +mpRefInputEdit->SetRefString(aRefStr); } } @@ -1626,12 +1632,12 @@ void ScPivotLayoutDlg::SetActive() { if ( mbRefInputMode ) { -if ( mpActiveEdit ) -mpActiveEdit->GrabFocus(); +if (mpRefInputEdit) +mpRefInputEdit->GrabFocus(); -if ( mpActiveEdit == &maEdInPos ) +if (mpRefInputEdit == &maEdInPos) EdInModifyHdl( NULL ); -else if ( mpActiveEdit == &maEdOutPos ) +else if (mpRefInputEdit == &maEdOutPos) EdOutModifyHdl( NULL ); } else @@ -1906,13 +1912,13 @@ IMPL_LINK_NOARG(ScPivotLayoutDlg, SelAreaHdl) return 0; } -IMPL_LINK( ScPivotLayoutDlg, GetFocusHdl, Control*, pCtrl ) +IMPL_LINK( ScPivotLayoutDlg, GetFocusHdl, formula::RefEdit*, pEdit ) { -mpActiveEdit = NULL; -if ( pCtrl == &maEdInPos ) -mpActiveEdit = &maEdInPos; -else if ( pCtrl == &maEdOutPos ) -mpActiveEdit = &maEdOutPos; +if (pEdit == &maEdInPos) +mpRefInputEdit = &maEdInPos; +else if (pEdit == &maEdOutPos) +mpRefInputEdit = &maEdOutPos; +else mpRefInputEdit = NULL; return 0; } diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx index 9b1ce0a..678ccba 100644 --- a/sc/source/ui/inc/pvlaydlg.hxx +++ b/sc/source/ui/inc/pvlaydlg.hxx @@ -204,7 +204,7 @@ private: DECL_LINK( EdOutModifyHdl, void * ); DECL_LINK( EdInModifyHdl, void * ); DECL_LINK( SelAreaHdl, void * ); -DECL_LINK( GetFocusHdl, Control* ); +DECL_LINK( GetFocusHdl, formula::RefEdit* ); private: struct FieldRect @@ -257,7 +257,7 @@ private: ScViewData* mpViewData; ScDocument* mpDoc; -::formula::RefEdit* mpActiveEdit; +formula::RefEdit* mpRefInputEdit; const rtl::OUString maStrUndefined; const rtl::OUString maStrNewTable; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/view/dbfunc3.cxx | 25 + 1 file changed, 9 insertions(+), 16 deletions(-) New commits: commit 6e57e691fa87b4b60678cc3f9a89ac7034a0ebdd Author: Kohei Yoshida Date: Wed Dec 5 14:16:25 2012 -0500 Same logic without using the boolean variable. Slightly simpler to follow its logic. Change-Id: I988158c93c813fbeffe8e0319c7970d2d3cf3e02 diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index 5925e3f..84754c2 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -1238,8 +1238,6 @@ void ScDBFunc::UngroupDataPilot() ScDPDimensionSaveData* pDimData = aData.GetDimensionData(); -bool bApply = false; - ScDPSaveGroupDimension* pGroupDim = pDimData->GetNamedGroupDimAcc( aDimName ); const ScDPSaveNumGroupDimension* pNumGroupDim = pDimData->GetNumGroupDim( aDimName ); if ( ( pGroupDim && pGroupDim->GetDatePart() != 0 ) || @@ -1249,10 +1247,10 @@ void ScDBFunc::UngroupDataPilot() // This is done using DateGroupDataPilot with nParts=0. DateGroupDataPilot( ScDPNumGroupInfo(), 0 ); -// bApply remains FALSE -// dimension pointers become invalid +return; } -else if ( pGroupDim ) + +if ( pGroupDim ) { ScDPUniqueStringSet::const_iterator it = aEntries.begin(), itEnd = aEntries.end(); for (; it != itEnd; ++it) @@ -1275,26 +1273,21 @@ void ScDBFunc::UngroupDataPilot() // also remove SaveData settings for the dimension that no longer exists aData.RemoveDimensionByName( aDimName ); } -bApply = true; } else if ( pNumGroupDim ) { // remove the numerical grouping pDimData->RemoveNumGroupDimension( aDimName ); // SaveData settings can remain unchanged - the same dimension still exists -bApply = true; } -if ( bApply ) -{ -// apply changes -ScDBDocFunc aFunc( *GetViewData()->GetDocShell() ); -pDPObj->SetSaveData( aData ); -aFunc.RefreshPivotTableGroups(pDPObj); +// apply changes +ScDBDocFunc aFunc( *GetViewData()->GetDocShell() ); +pDPObj->SetSaveData( aData ); +aFunc.RefreshPivotTableGroups(pDPObj); -// unmark cell selection -Unmark(); -} +// unmark cell selection +Unmark(); } static OUString lcl_replaceMemberNameInSubtotal(const OUString& rSubtotal, const OUString& rMemberName) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/core/data/dpobject.cxx |2 +- sc/source/core/data/dpoutput.cxx |2 +- sc/source/ui/cctrl/dpcontrol.cxx | 31 ++- sc/source/ui/inc/dpcontrol.hxx |3 +++ sc/source/ui/view/gridwin4.cxx |2 ++ 5 files changed, 33 insertions(+), 7 deletions(-) New commits: commit 307ac3f53d670a28e60471859aed03e4e13519d6 Author: Noel Power Date: Wed Dec 5 09:49:08 2012 + fix for bnc#791731 preserve cell formatting of datapilot area ( also uses the cell formatting to set up the field buttons background & text/font attributes Change-Id: I5f5a46bfc7f0b7aabb8872c25b3c3134e90611ac diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 40c3df9..529de6b 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -770,7 +770,7 @@ void ScDPObject::Output( const ScAddress& rPos ) // clear old output area pDoc->DeleteAreaTab( aOutRange.aStart.Col(), aOutRange.aStart.Row(), aOutRange.aEnd.Col(), aOutRange.aEnd.Row(), - aOutRange.aStart.Tab(), IDF_ALL ); + aOutRange.aStart.Tab(), IDF_CONTENTS | IDF_OBJECTS ); pDoc->RemoveFlagsTab( aOutRange.aStart.Col(), aOutRange.aStart.Row(), aOutRange.aEnd.Col(), aOutRange.aEnd.Row(), aOutRange.aStart.Tab(), SC_MF_AUTO ); diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 5038d43..7c38ee3 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -952,7 +952,7 @@ void ScDPOutput::Output() // clear whole (new) output area //! when modifying table, clear old area //! include IDF_OBJECTS ??? -pDoc->DeleteAreaTab( aStartPos.Col(), aStartPos.Row(), nTabEndCol, nTabEndRow, nTab, IDF_ALL ); +pDoc->DeleteAreaTab( aStartPos.Col(), aStartPos.Row(), nTabEndCol, nTabEndRow, nTab, IDF_CONTENTS | IDF_OBJECTS); if ( bDoFilter ) lcl_DoFilterButton( pDoc, aStartPos.Col(), aStartPos.Row(), nTab ); diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index c866ded..e57a7a5 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -26,6 +26,8 @@ #include "document.hxx" #include "docpool.hxx" #include "patattr.hxx" +#include +#include using rtl::OUString; @@ -33,6 +35,7 @@ ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pSt mpDoc(pDoc), mpOutDev(pOutDev), mpStyle(pStyle), +mpPattern(NULL), mbBaseButton(true), mbPopupButton(false), mbHasHiddenMember(false), @@ -105,8 +108,15 @@ void ScDPFieldButton::draw() { // Background Rectangle aRect(maPos, maSize); -mpOutDev->SetLineColor(mpStyle->GetFaceColor()); -mpOutDev->SetFillColor(mpStyle->GetFaceColor()); +Color aBackCol = mpStyle->GetFaceColor(); +if ( mpPattern ) +{ +const SvxBrushItem& rBrushItem = (const SvxBrushItem&)mpPattern->GetItemSet().Get( ATTR_BACKGROUND ); +if ( rBrushItem.GetColor() != COL_TRANSPARENT ) +aBackCol = rBrushItem.GetColor(); +} +mpOutDev->SetFillColor(aBackCol); +mpOutDev->SetLineColor(aBackCol); mpOutDev->DrawRect(aRect); // Border lines @@ -123,16 +133,27 @@ void ScDPFieldButton::draw() // Field name. // Get the font and size the same way as in scenario selection (lcl_DrawOneFrame in gridwin4.cxx) Font aTextFont( mpStyle->GetAppFont() ); +Color aButTextCol = mpStyle->GetButtonTextColor(); if ( mpDoc ) { -// use ScPatternAttr::GetFont only for font size Font aAttrFont; -static_cast(mpDoc->GetPool()->GetDefaultItem(ATTR_PATTERN)). +if ( mpPattern ) +{ + mpPattern->GetFont( aAttrFont, SC_AUTOCOL_DISPLAY, mpOutDev, &maZoomY ); + const SvxColorItem& rColorItem = (const SvxColorItem&)mpPattern->GetItemSet().Get( ATTR_FONT_COLOR ); + if ( rColorItem.GetValue().GetColor() != COL_TRANSPARENT ) + aButTextCol = rColorItem.GetValue(); +} +else +{ +// use ScPatternAttr::GetFont only for font size +static_cast(mpDoc->GetPool()->GetDefaultItem(ATTR_PATTERN)). GetFont( aAttrFont, SC_AUTOCOL_BLACK, mpOutDev, &maZoomY ); +} aTextFont.SetSize( aAttrFont.GetSize() ); } mpOutDev->SetFont(aTextFont); -mpOutDev->SetTextColor(mpStyle->GetButtonTextColor()); +mpOutDev->SetTextColor( aButTextCol ); Point aTextPos = maPos; long nTHeight = mpOutDev->GetTextHeight(); diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index e571adb..311d
[Libreoffice-commits] .: sc/source
sc/source/ui/condformat/condformatdlgentry.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f2cce815d17ecab4a9440d3cae2064db60fa5d2c Author: Markus Mohrhard Date: Tue Dec 4 20:24:01 2012 +0100 also workaround strange crash with ref edit field for formula condition Change-Id: I96a08b04215fdb22af5e1d2b21512544ebcc0f3a diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index fe2d0e3..96c9bda 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -500,7 +500,7 @@ ScFormulaFrmtEntry::ScFormulaFrmtEntry( Window* pParent, ScDocument* pDoc, const maFtStyle( this, ScResId( FT_STYLE ) ), maLbStyle( this, ScResId( LB_STYLE ) ), maWdPreview( this, ScResId( WD_PREVIEW ) ), -maEdFormula( this, static_cast(pParent->GetParent()), ScResId( ED_FORMULA ) ) +maEdFormula( this, NULL, ScResId( ED_FORMULA ) ) { Init(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/view/gridwin5.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit be76d34849f95568e333a2af28bf61411eab3124 Author: Tor Lillqvist Date: Tue Dec 4 20:46:36 2012 +0200 WaE: unused variable 'pDrawView' Change-Id: Ide676ba1127a69dd2b787a57623a23d1ee13aaac diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx index e7e3edc..9789a24 100644 --- a/sc/source/ui/view/gridwin5.cxx +++ b/sc/source/ui/view/gridwin5.cxx @@ -207,7 +207,7 @@ bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, bool bKeyboard ) pNoteMarker = new ScNoteMarker( pLeft, pRight, pBottom, pDiagonal, pDoc, aCellPos, aTrackText, aMapMode, bLeftEdge, bFast, bKeyboard ); -if ( ScDrawView* pDrawView = pViewData->GetScDrawView() ) +if ( pViewData->GetScDrawView() ) { // get position for aCellPos if ( pDoc ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/inc/notemark.hxx |3 ++- sc/source/ui/view/gridwin5.cxx | 20 +++- sc/source/ui/view/notemark.cxx |3 +++ sc/source/ui/view/viewfun6.cxx |3 +++ 4 files changed, 27 insertions(+), 2 deletions(-) New commits: commit cce13e3f6a42c10232653dbd52088743f935c7d0 Author: Noel Power Date: Tue Dec 4 16:49:34 2012 + fix problem with captions inserted at problematic zoom levels also makes sure that caption drawn ( when hovering over note cell ) is drawn at the correct position also ( e.g. corrected for zoom pos ) Change-Id: I7c06dd74d26e37d69bcc5a5734fae676aa7599e7 diff --git a/sc/source/ui/inc/notemark.hxx b/sc/source/ui/inc/notemark.hxx index 501ec7f..acf4757 100644 --- a/sc/source/ui/inc/notemark.hxx +++ b/sc/source/ui/inc/notemark.hxx @@ -48,7 +48,7 @@ private: SdrModel* pModel; SdrObject* pObject; sal_BoolbVisible; - +Point aGridOff; DECL_LINK( TimeHdl, void* ); public: @@ -62,6 +62,7 @@ public: ScAddress GetDocPos() const { return aDocPos; } sal_BoolIsByKeyboard() const{ return bByKeyboard; } +voidSetGridOff( const Point& rOff ) { aGridOff = rOff; } }; diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx index a82fc30..e7e3edc 100644 --- a/sc/source/ui/view/gridwin5.cxx +++ b/sc/source/ui/view/gridwin5.cxx @@ -204,9 +204,27 @@ bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, bool bKeyboard ) aOrigin.Y() += aLeftSize.Height(); aMapMode.SetOrigin( aOrigin ); -pNoteMarker = new ScNoteMarker( pLeft, pRight, pBottom, pDiagonal, +pNoteMarker = new ScNoteMarker( pLeft, pRight, pBottom, pDiagonal, pDoc, aCellPos, aTrackText, aMapMode, bLeftEdge, bFast, bKeyboard ); +if ( ScDrawView* pDrawView = pViewData->GetScDrawView() ) +{ +// get position for aCellPos +if ( pDoc ) +{ +// get draw position in hmm for aCellPos +Point aOldPos( pDoc->GetColOffset( aCellPos.Col(), aCellPos.Tab() ), pDoc->GetRowOffset( aCellPos.Row(), aCellPos.Tab() ) ); +aOldPos.X() = sc::TwipsToHMM( aOldPos.X() ); +aOldPos.Y() = sc::TwipsToHMM( aOldPos.Y() ); +// get screen pos in hmm for aCellPos +// and equiv screen pos +Point aScreenPos = pViewData->GetScrPos( aCellPos.Col(), aCellPos.Row(), eWhich, sal_True ); +MapMode aDrawMode = GetDrawMapMode(); +Point aCurPosHmm = PixelToLogic(aScreenPos, aDrawMode ); +Point aGridOff = aCurPosHmm -aOldPos; +pNoteMarker->SetGridOff( aGridOff ); +} +} } bDone = true; // something is shown (old or new) diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx index 0958d8d..2735a25 100644 --- a/sc/source/ui/view/notemark.cxx +++ b/sc/source/ui/view/notemark.cxx @@ -98,7 +98,10 @@ IMPL_LINK_NOARG(ScNoteMarker, TimeHdl) { pObject = ScNoteUtil::CreateTempCaption( *pDoc, aDocPos, *pPage, aUserText, aVisRect, bLeft ); if( pObject ) +{ +pObject->SetGridOffset( aGridOff ); aRect = pObject->GetCurrentBoundRect(); +} // Page einfuegen damit das Model sie kennt und auch deleted pModel->InsertPage( pPage ); diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx index e9ec827..86b04f6 100644 --- a/sc/source/ui/view/viewfun6.cxx +++ b/sc/source/ui/view/viewfun6.cxx @@ -42,6 +42,7 @@ #include "externalrefmgr.hxx" #include "cell.hxx" #include "markdata.hxx" +#include "drawview.hxx" #include @@ -313,6 +314,8 @@ void ScViewFunc::EditNote() return a caption object. */ if( SdrCaptionObj* pCaption = pNote->GetCaption() ) { +if ( ScDrawView* pScDrawView = GetScDrawView() ) + pScDrawView->SyncForGrid( pCaption ); // #i33764# enable the resize handles before starting edit mode if( FuPoor* pDraw = GetDrawFuncPtr() ) static_cast< FuSelection* >( pDraw )->ActivateNoteHandles( pCaption ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/excel/colrowst.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 150270b097a0da7963460d568d8e599db623af2d Author: Kohei Yoshida Date: Mon Dec 3 16:39:28 2012 -0500 Oops I didn't mean to change this. SetRowHidden() is more light-weight than ShowRows(). Let's stick with SetRowHidden() here. Change-Id: Ieb83078b5546107a3ee2ea3b8b73df9627525abe diff --git a/sc/source/filter/excel/colrowst.cxx b/sc/source/filter/excel/colrowst.cxx index 5483324..9d8ac10 100644 --- a/sc/source/filter/excel/colrowst.cxx +++ b/sc/source/filter/excel/colrowst.cxx @@ -346,7 +346,7 @@ void XclImpColRowSettings::ConvertHiddenFlags( SCTAB nScTab ) { if (bPrevHidden) { -rDoc.ShowRows(nPrevRow, nRow-1, nScTab, false); +rDoc.SetRowHidden(nPrevRow, nRow-1, nScTab, true); // #i38093# rows hidden by filter need extra flag if (nFirstFilterScRow <= nPrevRow && nPrevRow <= nLastFilterScRow) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/filter/excel/colrowst.cxx | 68 +++- sc/source/filter/inc/colrowst.hxx | 20 ++ 2 files changed, 64 insertions(+), 24 deletions(-) New commits: commit 2792670a53deca5ccd5b0f23faa7f1816684945d Author: Kohei Yoshida Date: Mon Dec 3 16:12:21 2012 -0500 Use mdds::flag_segment_tree to store column flags/widths. Just like we do with the row height / flags. Change-Id: Ia55dc81fa8d238251c800fe5f87890b9ae4b4901 diff --git a/sc/source/filter/excel/colrowst.cxx b/sc/source/filter/excel/colrowst.cxx index f9f..5483324 100644 --- a/sc/source/filter/excel/colrowst.cxx +++ b/sc/source/filter/excel/colrowst.cxx @@ -52,8 +52,8 @@ const sal_uInt8 EXC_COLROW_MAN = 0x08; XclImpColRowSettings::XclImpColRowSettings( const XclImpRoot& rRoot ) : XclImpRoot( rRoot ), -maWidths( MAXCOLCOUNT, 0 ), -maColFlags( MAXCOLCOUNT, 0 ), +maColWidths(0, MAXCOLCOUNT, 0), +maColFlags(0, MAXCOLCOUNT, 0), maRowHeights(0, MAXROWCOUNT, 0), maRowFlags(0, MAXROWCOUNT, 0), maHiddenRows(0, MAXROWCOUNT, false), @@ -88,7 +88,6 @@ void XclImpColRowSettings::SetDefWidth( sal_uInt16 nDefWidth, bool bStdWidthRec void XclImpColRowSettings::SetWidthRange( SCCOL nScCol1, SCCOL nScCol2, sal_uInt16 nWidth ) { -OSL_ENSURE( (nScCol1 <= nScCol2) && ValidCol( nScCol2 ), "XclImpColRowSettings::SetColWidthRange - invalid column range" ); nScCol2 = ::std::min( nScCol2, MAXCOL ); if (nScCol2 == 256) // In BIFF8, the column range is 0-255, and the use of 256 probably @@ -97,24 +96,28 @@ void XclImpColRowSettings::SetWidthRange( SCCOL nScCol1, SCCOL nScCol2, sal_uInt nScCol2 = MAXCOL; nScCol1 = ::std::min( nScCol1, nScCol2 ); -::std::fill( maWidths.begin() + nScCol1, maWidths.begin() + nScCol2 + 1, nWidth ); -for( ScfUInt8Vec::iterator aIt = maColFlags.begin() + nScCol1, aEnd = maColFlags.begin() + nScCol2 + 1; aIt != aEnd; ++aIt ) -::set_flag( *aIt, EXC_COLROW_USED ); +maColWidths.insert_back(nScCol1, nScCol2+1, nWidth); + +// We need to apply flag values individually since all flag values are aggregated for each column. +for (SCCOL nCol = nScCol1; nCol <= nScCol2; ++nCol) +ApplyColFlag(nCol, EXC_COLROW_USED); } void XclImpColRowSettings::HideCol( SCCOL nScCol ) { -if( ValidCol( nScCol ) ) -::set_flag( maColFlags[ nScCol ], EXC_COLROW_HIDDEN ); +if (!ValidCol(nScCol)) +return; + +ApplyColFlag(nScCol, EXC_COLROW_HIDDEN); } void XclImpColRowSettings::HideColRange( SCCOL nScCol1, SCCOL nScCol2 ) { -OSL_ENSURE( (nScCol1 <= nScCol2) && ValidCol( nScCol2 ), "XclImpColRowSettings::HideColRange - invalid column range" ); nScCol2 = ::std::min( nScCol2, MAXCOL ); nScCol1 = ::std::min( nScCol1, nScCol2 ); -for( ScfUInt8Vec::iterator aIt = maColFlags.begin() + nScCol1, aEnd = maColFlags.begin() + nScCol2 + 1; aIt != aEnd; ++aIt ) -::set_flag( *aIt, EXC_COLROW_HIDDEN ); + +for (SCCOL nCol = nScCol1; nCol <= nScCol2; ++nCol) +ApplyColFlag(nCol, EXC_COLROW_HIDDEN); } void XclImpColRowSettings::SetDefHeight( sal_uInt16 nDefHeight, sal_uInt16 nFlags ) @@ -207,15 +210,23 @@ void XclImpColRowSettings::Convert( SCTAB nScTab ) // column widths -- +maColWidths.build_tree(); for( SCCOL nScCol = 0; nScCol <= MAXCOL; ++nScCol ) { -sal_uInt16 nWidth = ::get_flag( maColFlags[ nScCol ], EXC_COLROW_USED ) ? maWidths[ nScCol ] : mnDefWidth; +sal_uInt16 nWidth = mnDefWidth; +if (GetColFlag(nScCol, EXC_COLROW_USED)) +{ +sal_uInt16 nTmp; +if (maColWidths.search_tree(nScCol, nTmp)) +nWidth = nTmp; +} + /* Hidden columns: remember hidden state, but do not set hidden state in document here. Needed for #i11776#, no HIDDEN flags in the document, until filters and outlines are inserted. */ if( nWidth == 0 ) { -::set_flag( maColFlags[ nScCol ], EXC_COLROW_HIDDEN ); +ApplyColFlag(nScCol, EXC_COLROW_HIDDEN); nWidth = mnDefWidth; } rDoc.SetColWidthOnly( nScCol, nScTab, nWidth ); @@ -233,7 +244,7 @@ void XclImpColRowSettings::Convert( SCTAB nScTab ) if (!maRowHeights.is_tree_valid()) return; -RowFlagsType::const_iterator itrFlags = maRowFlags.begin(), itrFlagsEnd = maRowFlags.end(); +ColRowFlagsType::const_iterator itrFlags = maRowFlags.begin(), itrFlagsEnd = maRowFlags.end(); SCROW nPrevRow = -1; sal_uInt8 nPrevFlags = 0; for (; itrFlags != itrFlagsEnd; ++itrFlags) @@ -295,7 +306,7 @@ void XclImpColRowSettings::ConvertHiddenFlags( SCTAB nScTab ) // hide the columns for( SCCOL nScCol = 0; nScCol <= MAXCOL; ++nScCol ) -if( ::get_flag( maColFlags[ nScCol ], EXC_COLROW_HIDDEN ) ) +if
[Libreoffice-commits] .: sc/source
sc/source/filter/orcus/interface.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit e93dd02e30fa6b06a04dcd83a1403a655cf08041 Author: Markus Mohrhard Date: Sun Dec 2 08:23:37 2012 +0100 workaround broken WaE eGrammar may be used uninitialized diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index 52072ad..2e99eaa 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -89,7 +89,7 @@ void ScOrcusSheet::set_formula( row_t row, col_t col, formula_grammar_t grammar, const char* p, size_t n) { OUString aFormula(p, n, RTL_TEXTENCODING_UTF8); -formula::FormulaGrammar::Grammar eGrammar; +formula::FormulaGrammar::Grammar eGrammar = formula::FormulaGrammar::GRAM_ODFF; switch(grammar) { case orcus::spreadsheet::ods: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/view/tabvwshc.cxx | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) New commits: commit 4026e1824de8ff9b5d006ae6eba491f91bc4e599 Author: Markus Mohrhard Date: Fri Nov 30 22:19:45 2012 +0100 prevent uncloseable cond format dlg diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 152a940..289e605 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -204,30 +204,31 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( } const ScConditionalFormat* pCondFormat = pDoc->GetCondFormat(aPos.Col(), aPos.Row(), aPos.Tab()); +condformat::dialog::ScCondFormatDialogType eType = condformat::dialog::NONE; +switch(nSlotId) +{ +case SID_OPENDLG_CONDFRMT: +eType = condformat::dialog::CONDITION; +break; +case SID_OPENDLG_COLORSCALE: +eType = condformat::dialog::COLORSCALE; +break; +case SID_OPENDLG_DATABAR: +eType = condformat::dialog::DATABAR; +break; +default: +break; +} + if(pCondFormat) { const ScRangeList& rCondFormatRange = pCondFormat->GetRange(); if(rCondFormatRange == aRangeList) -pResult = new ScCondFormatDlg( pB, pCW, pParent, pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE ); +pResult = new ScCondFormatDlg( pB, pCW, pParent, pDoc, pCondFormat, rCondFormatRange, aPos, eType ); } if(!pResult) { -condformat::dialog::ScCondFormatDialogType eType = condformat::dialog::NONE; -switch(nSlotId) -{ -case SID_OPENDLG_CONDFRMT: -eType = condformat::dialog::CONDITION; -break; -case SID_OPENDLG_COLORSCALE: -eType = condformat::dialog::COLORSCALE; -break; -case SID_OPENDLG_DATABAR: -eType = condformat::dialog::DATABAR; -break; -default: -break; -} pResult = new ScCondFormatDlg( pB, pCW, pParent, pDoc, NULL, aRangeList, aRangeList.GetTopLeftCorner(), eType ); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/view/drawview.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 1d6713a72631cf38267cc0a154a6c25244f26ab5 Author: Jan Holesovsky Date: Fri Nov 30 15:55:59 2012 +0100 Fix indentation. Change-Id: I49ebb9f7b1605884ebb2071b1017e9dec5d05577 diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 85e5402..1908fda 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -769,7 +769,9 @@ void ScDrawView::SyncForGrid( SdrObject* pObj ) { SdrObjList *pLst = ((SdrObjGroup*)pObj)->GetSubList(); for ( sal_uLong i = 0, nCount = pLst->GetObjCount(); i < nCount; ++i ) -SyncForGrid( pLst->GetObj( i ) ); } +SyncForGrid( pLst->GetObj( i ) ); +} + ScSplitPos eWhich = pViewData->GetActivePart(); ScGridWindow* pGridWin = (ScGridWindow*)pViewData->GetActiveWin(); ScDrawObjData* pData = ScDrawLayer::GetObjDataTab( pObj, nTab ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/xmlsource/xmlsourcedlg.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit cc486a467a722b039f4950feb21b7346a8d70a5b Author: Kohei Yoshida Date: Fri Nov 30 00:08:19 2012 -0500 Don't forget to clear this when loading a new XML file. Change-Id: I97a1e01e983660304e78f05d5a025080d30aab46 diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index fed942e..f746662 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -207,7 +207,7 @@ void ScXMLSourceDlg::SelectSourceFile() // There should only be one file returned from the file picker. maSrcPath = aFiles[0]; maFtSourceFile.SetText(maSrcPath); - +maHighlightedEntries.clear(); LoadSourceFileStructure(maSrcPath); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/xmlsource/xmlsourcedlg.cxx | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) New commits: commit 24a2e032ed0d5f1dcddf583424dfe9ab4c214ebf Author: Kohei Yoshida Date: Fri Nov 30 00:04:48 2012 -0500 Highlight the reference entry after ensuring that it's mappable. Change-Id: I9b245c56c58b2db741e7c69c5ad480179db25ee8 diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index c60cc1d..fed942e 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -304,17 +304,6 @@ void ScXMLSourceDlg::TreeItemSelected() } mpCurRefEntry = getReferenceEntry(maLbTree, pEntry); -if (mpCurRefEntry != pEntry) -{ -// Highlight the reference entry if it differs from the current entry. -SvViewDataEntry* pView = maLbTree.GetViewDataEntry(mpCurRefEntry); -if (pView) -{ -pView->SetHighlighted(true); -maLbTree.PaintEntry(mpCurRefEntry); -maHighlightedEntries.push_back(mpCurRefEntry); -} -} ScOrcusXMLTreeParam::EntryData* pUserData = ScOrcusXMLTreeParam::getUserData(*mpCurRefEntry); OSL_ASSERT(pUserData); @@ -404,6 +393,16 @@ void ScXMLSourceDlg::RepeatElementSelected(SvTreeListEntry& rEntry) return; } +SvViewDataEntry* p = maLbTree.GetViewDataEntry(&rEntry); +if (!p->IsHighlighted()) +{ +// Highlight the entry if not highlighted already. This can happen +// when the current entry is a child entry of a repeat element entry. +p->SetHighlighted(true); +maLbTree.PaintEntry(&rEntry); +maHighlightedEntries.push_back(&rEntry); +} + SelectAllChildEntries(rEntry); SetRangeLinkable(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/source
sc/source/ui/inc/xmlsourcedlg.hxx |2 sc/source/ui/xmlsource/xmlsourcedlg.cxx | 68 ++-- 2 files changed, 57 insertions(+), 13 deletions(-) New commits: commit 949a4e15de7560f72481f2ff90f9f3b3571a8e90 Author: Kohei Yoshida Date: Thu Nov 29 23:40:48 2012 -0500 Selecting a child entry of a recurring element should select all sub-tree. And use the parent element entry to set the mapped cell position. Change-Id: I1def045000e707903dcc91ab46da3c66195506da diff --git a/sc/source/ui/inc/xmlsourcedlg.hxx b/sc/source/ui/inc/xmlsourcedlg.hxx index 1914df1..95f379e 100644 --- a/sc/source/ui/inc/xmlsourcedlg.hxx +++ b/sc/source/ui/inc/xmlsourcedlg.hxx @@ -57,7 +57,7 @@ class ScXMLSourceDlg : public ScAnyRefDlg std::set maCellLinks; std::set maRangeLinks; std::vector maHighlightedEntries; - +SvTreeListEntry* mpCurRefEntry; boost::scoped_ptr mpXMLContext; ScDocument* mpDoc; diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index 3a15310..c60cc1d 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -83,6 +83,7 @@ ScXMLSourceDlg::ScXMLSourceDlg( maBtnOk(this, ScResId(BTN_OK)), maBtnCancel(this, ScResId(BTN_CANCEL)), maImgFileOpen(ScResId(IMG_FILE_OPEN)), +mpCurRefEntry(NULL), mpDoc(pDoc), mpActiveEdit(&maRefEdit), mbDlgLostFocus(false) @@ -256,6 +257,37 @@ public: } }; +/** + * When the current entry is a direct or indirect child of a mappable + * repeat element entry, that entry becomes the reference entry. + * Otherwise the reference entry equals the current entry. A reference + * entry is the entry that stores mapped cell position. + */ +SvTreeListEntry* getReferenceEntry(SvTreeListBox& rTree, SvTreeListEntry* pCurEntry) +{ +SvTreeListEntry* pParent = rTree.GetParent(pCurEntry); +SvTreeListEntry* pRefEntry = NULL; +while (pParent) +{ +ScOrcusXMLTreeParam::EntryData* pUserData = ScOrcusXMLTreeParam::getUserData(*pParent); +OSL_ASSERT(pUserData); +if (pUserData->meType == ScOrcusXMLTreeParam::ElementRepeat) +{ +// This is a repeat element. +if (pRefEntry) +{ +// Second repeat element encountered. Not good. +return pCurEntry; +} + +pRefEntry = pParent; +} +pParent = rTree.GetParent(pParent); +} + +return pRefEntry ? pRefEntry : pCurEntry; +} + } void ScXMLSourceDlg::TreeItemSelected() @@ -271,7 +303,20 @@ void ScXMLSourceDlg::TreeItemSelected() maHighlightedEntries.clear(); } -ScOrcusXMLTreeParam::EntryData* pUserData = ScOrcusXMLTreeParam::getUserData(*pEntry); +mpCurRefEntry = getReferenceEntry(maLbTree, pEntry); +if (mpCurRefEntry != pEntry) +{ +// Highlight the reference entry if it differs from the current entry. +SvViewDataEntry* pView = maLbTree.GetViewDataEntry(mpCurRefEntry); +if (pView) +{ +pView->SetHighlighted(true); +maLbTree.PaintEntry(mpCurRefEntry); +maHighlightedEntries.push_back(mpCurRefEntry); +} +} + +ScOrcusXMLTreeParam::EntryData* pUserData = ScOrcusXMLTreeParam::getUserData(*mpCurRefEntry); OSL_ASSERT(pUserData); const ScAddress& rPos = pUserData->maLinkedPos; @@ -287,13 +332,13 @@ void ScXMLSourceDlg::TreeItemSelected() switch (pUserData->meType) { case ScOrcusXMLTreeParam::Attribute: -AttributeSelected(*pEntry); +AttributeSelected(*mpCurRefEntry); break; case ScOrcusXMLTreeParam::ElementDefault: -DefaultElementSelected(*pEntry); +DefaultElementSelected(*mpCurRefEntry); break; case ScOrcusXMLTreeParam::ElementRepeat: -RepeatElementSelected(*pEntry); +RepeatElementSelected(*mpCurRefEntry); break; default: ; @@ -599,13 +644,12 @@ void ScXMLSourceDlg::RefEditModified() if (!bValid) aLinkedPos.SetInvalid(); -// Set this address to currently selected tree item. -SvTreeListEntry* pEntry = maLbTree.GetCurEntry(); -if (!pEntry) +// Set this address to the current reference entry. +if (!mpCurRefEntry) // This should never happen. return; -ScOrcusXMLTreeParam::EntryData* pUserData = ScOrcusXMLTreeParam::getUserData(*pEntry); +ScOrcusXMLTreeParam::EntryData* pUserData = ScOrcusXMLTreeParam::getUserData(*mpCurRefEntry); if (!pUserData) // This should never happen either. return; @@ -617,16 +661,16 @@ void ScXMLSourceDlg::RefEditModified() if (bRepeatElem) { if (bValid) -maRangeLinks.insert(pEntry); +maRangeLinks.insert(mpCurRefEntry); else -maRangeLinks.erase(pEntry); +