diff --git sc/inc/unonames.hxx sc/inc/unonames.hxx index f36690b..9ecc0b2 100644 --- sc/inc/unonames.hxx +++ sc/inc/unonames.hxx @@ -360,6 +360,7 @@ #define SC_UNO_SRCHSTYLES "SearchStyles" #define SC_UNO_SRCHTYPE "SearchType" #define SC_UNO_SRCHWORDS "SearchWords" +#define SC_UNO_SRCHFILTERED "SearchFiltered" // old (5.2) property names for page styles - for compatibility only! #define OLD_UNO_PAGE_BACKCOLOR "BackgroundColor" diff --git sc/source/core/data/table6.cxx sc/source/core/data/table6.cxx index a1bd279..81ba723 100644 --- sc/source/core/data/table6.cxx +++ sc/source/core/data/table6.cxx @@ -298,6 +298,7 @@ BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, SCCOL nLastCol; SCROW nLastRow; GetLastDataPos(nLastCol, nLastRow); + bool bSkipFiltered = !rSearchItem.IsSearchFiltered(); if (!bAll && rSearchItem.GetBackward()) { SCROW nLastNonFilteredRow = MAXROW + 1; @@ -308,7 +309,8 @@ BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, nCol--; while (!bFound && ((SCsROW)nRow >= 0)) { - SkipFilteredRows(nRow, nLastNonFilteredRow, false); + if (bSkipFiltered) + SkipFilteredRows(nRow, nLastNonFilteredRow, false); while (!bFound && ((SCsCOL)nCol >= 0)) { @@ -341,7 +343,8 @@ BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, { while (!bFound && ((SCsROW)nRow >= 0)) { - SkipFilteredRows(nRow, nLastNonFilteredRow, false); + if (bSkipFiltered) + SkipFilteredRows(nRow, nLastNonFilteredRow, false); bFound = SearchCell(rSearchItem, nCol, nRow, rMark, rUndoStr, pUndoDoc); if (!bFound) @@ -377,7 +380,8 @@ BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, nCol++; while (!bFound && (nRow <= nLastRow)) { - SkipFilteredRows(nRow, nLastNonFilteredRow, true); + if (bSkipFiltered) + SkipFilteredRows(nRow, nLastNonFilteredRow, true); while (!bFound && (nCol <= nLastCol)) { @@ -402,7 +406,8 @@ BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, { while (!bFound && (nRow <= nLastRow)) { - SkipFilteredRows(nRow, nLastNonFilteredRow, true); + if (bSkipFiltered) + SkipFilteredRows(nRow, nLastNonFilteredRow, true); bFound = SearchCell(rSearchItem, nCol, nRow, rMark, rUndoStr, pUndoDoc); if (!bFound) @@ -849,6 +854,7 @@ bool ScTable::SearchRangeForEmptyCell( SCCOL& rCol, SCROW& rRow, String& rUndoStr, ScDocument* /*pUndoDoc*/) { sal_uInt16 nCmd = rSearchItem.GetCommand(); + bool bSkipFiltered = rSearchItem.IsSearchFiltered(); if (rSearchItem.GetBackward()) { // backward search @@ -859,7 +865,8 @@ bool ScTable::SearchRangeForEmptyCell( SCROW nBeginRow = rRange.aEnd.Row() > rRow ? rRow : rRange.aEnd.Row(); for (SCROW nRow = nBeginRow; nRow >= rRange.aStart.Row(); --nRow) { - SkipFilteredRows(nRow, nLastNonFilteredRow, false); + if (bSkipFiltered) + SkipFilteredRows(nRow, nLastNonFilteredRow, false); if (nRow < rRange.aStart.Row()) break; @@ -888,7 +895,8 @@ bool ScTable::SearchRangeForEmptyCell( nBeginRow = rRow - (nCmd == SVX_SEARCHCMD_FIND ? 1 : 0); for (SCROW nRow = nBeginRow; nRow >= rRange.aStart.Row(); --nRow) { - SkipFilteredRows(nRow, nLastNonFilteredRow, false); + if (bSkipFiltered) + SkipFilteredRows(nRow, nLastNonFilteredRow, false); if (nRow < rRange.aStart.Row()) break; @@ -908,7 +916,8 @@ bool ScTable::SearchRangeForEmptyCell( SCROW nBeginRow = rRange.aStart.Row() < rRow ? rRow : rRange.aStart.Row(); for (SCROW nRow = nBeginRow; nRow <= rRange.aEnd.Row(); ++nRow) { - SkipFilteredRows(nRow, nLastNonFilteredRow, true); + if (bSkipFiltered) + SkipFilteredRows(nRow, nLastNonFilteredRow, true); if (nRow > rRange.aEnd.Row()) break; @@ -936,7 +945,8 @@ bool ScTable::SearchRangeForEmptyCell( nBeginRow = rRow + (nCmd == SVX_SEARCHCMD_FIND ? 1 : 0); for (SCROW nRow = nBeginRow; nRow <= rRange.aEnd.Row(); ++nRow) { - SkipFilteredRows(nRow, nLastNonFilteredRow, true); + if (bSkipFiltered) + SkipFilteredRows(nRow, nLastNonFilteredRow, true); if (nRow > rRange.aEnd.Row()) break; @@ -956,6 +966,7 @@ bool ScTable::SearchRangeForAllEmptyCells( bool bFound = false; bool bReplace = (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE_ALL) && (rSearchItem.GetReplaceString().Len() > 0); + bool bSkipFiltered = rSearchItem.IsSearchFiltered(); for (SCCOL nCol = rRange.aStart.Col(); nCol <= rRange.aEnd.Col(); ++nCol) { @@ -993,7 +1004,8 @@ bool ScTable::SearchRangeForAllEmptyCells( for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); ++nRow) { - SkipFilteredRows(nRow, nLastNonFilteredRow, true); + if (bSkipFiltered) + SkipFilteredRows(nRow, nLastNonFilteredRow, true); if (nRow > rRange.aEnd.Row()) break; diff --git sc/source/ui/unoobj/srchuno.cxx sc/source/ui/unoobj/srchuno.cxx index 61d81f1..2e3fc59 100644 --- sc/source/ui/unoobj/srchuno.cxx +++ sc/source/ui/unoobj/srchuno.cxx @@ -175,6 +175,7 @@ void SAL_CALL ScCellSearchObj::setPropertyValue( else if (aString.EqualsAscii( SC_UNO_SRCHSIMEX )) pSearchItem->SetLEVOther( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); else if (aString.EqualsAscii( SC_UNO_SRCHSIMREM )) pSearchItem->SetLEVShorter( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); else if (aString.EqualsAscii( SC_UNO_SRCHTYPE )) pSearchItem->SetCellType( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); + else if (aString.EqualsAscii( SC_UNO_SRCHFILTERED )) pSearchItem->SetSearchFiltered( ScUnoHelpFunctions::GetBoolFromAny(aValue) ); } uno::Any SAL_CALL ScCellSearchObj::getPropertyValue( const rtl::OUString& aPropertyName ) @@ -197,6 +198,7 @@ uno::Any SAL_CALL ScCellSearchObj::getPropertyValue( const rtl::OUString& aPrope else if (aString.EqualsAscii( SC_UNO_SRCHSIMEX )) aRet <<= (sal_Int16) pSearchItem->GetLEVOther(); else if (aString.EqualsAscii( SC_UNO_SRCHSIMREM )) aRet <<= (sal_Int16) pSearchItem->GetLEVShorter(); else if (aString.EqualsAscii( SC_UNO_SRCHTYPE )) aRet <<= (sal_Int16) pSearchItem->GetCellType(); + else if (aString.EqualsAscii( SC_UNO_SRCHFILTERED )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsSearchFiltered() ); return aRet; }