Revert "tdf#98458 sw: make search in shape text optional"

Actually there seems to be a simpler solution to the immediate performance
problem which I'll commit next.

It still might be necessary to introduce the search switch at some stage, but
first let's see if there are complaints.

This reverts commit 8e0b08c305.
This commit is contained in:
Jan Holesovsky
2016-03-17 15:43:32 +01:00
parent 547617955a
commit 43c64fa24d
7 changed files with 5 additions and 28 deletions

View File

@@ -146,7 +146,7 @@ SFX_DECL_TYPE(13); // for SwAddPrinterItem, Sd...
SFX_DECL_TYPE(14); SFX_DECL_TYPE(14);
SFX_DECL_TYPE(16); // for SwDocDisplayItem SFX_DECL_TYPE(16); // for SwDocDisplayItem
SFX_DECL_TYPE(17); // for SvxAddressItem SFX_DECL_TYPE(17); // for SvxAddressItem
SFX_DECL_TYPE(24); // for SvxSearchItem SFX_DECL_TYPE(23); // for SvxSearchItem
// all SfxTypes must be in this header // all SfxTypes must be in this header
#undef SFX_DECL_TYPE #undef SFX_DECL_TYPE

View File

@@ -61,7 +61,6 @@
#define MID_SEARCH_STARTPOINTY 21 #define MID_SEARCH_STARTPOINTY 21
#define MID_SEARCH_SEARCHFORMATTED 22 #define MID_SEARCH_SEARCHFORMATTED 22
#define MID_SEARCH_ALGORITHMTYPE2 23 #define MID_SEARCH_ALGORITHMTYPE2 23
#define MID_SEARCH_INSHAPES 24
#endif #endif

View File

@@ -90,9 +90,6 @@ class SVL_DLLPUBLIC SvxSearchItem :
sal_Int32 m_nStartPointX; sal_Int32 m_nStartPointX;
sal_Int32 m_nStartPointY; sal_Int32 m_nStartPointY;
/// Writer-specific: search in shape text.
bool m_bSearchInShapes;
virtual void ImplCommit() override; virtual void ImplCommit() override;
public: public:
@@ -201,7 +198,6 @@ public:
sal_Int32 GetStartPointY() const; sal_Int32 GetStartPointY() const;
/// Either x or y start point is set. /// Either x or y start point is set.
bool HasStartPoint() const; bool HasStartPoint() const;
bool IsSearchInShapes() const;
}; };
const OUString& SvxSearchItem::GetSearchString() const const OUString& SvxSearchItem::GetSearchString() const

View File

@@ -91,7 +91,6 @@
INT32 SearchStartPointY MID_SEARCH_STARTPOINTY; INT32 SearchStartPointY MID_SEARCH_STARTPOINTY;
BOOL SearchFormatted MID_SEARCH_SEARCHFORMATTED; BOOL SearchFormatted MID_SEARCH_SEARCHFORMATTED;
INT16 AlgorithmType2 MID_SEARCH_ALGORITHMTYPE2; INT16 AlgorithmType2 MID_SEARCH_ALGORITHMTYPE2;
BOOL SearchInShapes MID_SEARCH_INSHAPES;
}; };
item SvxSearch SvxSearchItem; item SvxSearch SvxSearchItem;

View File

@@ -127,8 +127,7 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) :
m_bContent ( false ), m_bContent ( false ),
m_bAsianOptions ( false ), m_bAsianOptions ( false ),
m_nStartPointX(0), m_nStartPointX(0),
m_nStartPointY(0), m_nStartPointY(0)
m_bSearchInShapes(false)
{ {
EnableNotification( lcl_GetNotifyNames() ); EnableNotification( lcl_GetNotifyNames() );
@@ -227,8 +226,7 @@ SvxSearchItem::SvxSearchItem( const SvxSearchItem& rItem ) :
m_bContent ( rItem.m_bContent ), m_bContent ( rItem.m_bContent ),
m_bAsianOptions ( rItem.m_bAsianOptions ), m_bAsianOptions ( rItem.m_bAsianOptions ),
m_nStartPointX(rItem.m_nStartPointX), m_nStartPointX(rItem.m_nStartPointX),
m_nStartPointY(rItem.m_nStartPointY), m_nStartPointY(rItem.m_nStartPointY)
m_bSearchInShapes(rItem.m_bSearchInShapes)
{ {
EnableNotification( lcl_GetNotifyNames() ); EnableNotification( lcl_GetNotifyNames() );
} }
@@ -672,11 +670,6 @@ bool SvxSearchItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
bRet = (rVal >>= m_nStartPointY); bRet = (rVal >>= m_nStartPointY);
break; break;
} }
case MID_SEARCH_INSHAPES:
{
bRet = (rVal >>= m_bSearchInShapes);
break;
}
default: default:
OSL_FAIL( "Unknown MemberId" ); OSL_FAIL( "Unknown MemberId" );
} }
@@ -699,9 +692,4 @@ bool SvxSearchItem::HasStartPoint() const
return m_nStartPointX > 0 || m_nStartPointY > 0; return m_nStartPointX > 0 || m_nStartPointY > 0;
} }
bool SvxSearchItem::IsSearchInShapes() const
{
return m_bSearchInShapes;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -328,8 +328,7 @@ void lcl_search(bool bBackward)
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence( uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
{ {
{"SearchItem.SearchString", uno::makeAny(OUString("shape"))}, {"SearchItem.SearchString", uno::makeAny(OUString("shape"))},
{"SearchItem.Backward", uno::makeAny(bBackward)}, {"SearchItem.Backward", uno::makeAny(bBackward)}
{"SearchItem.SearchInShapes", uno::makeAny(true)}
})); }));
comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues); comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
} }

View File

@@ -301,10 +301,6 @@ bool SwPaM::Find( const SearchOptions2& rSearchOpt, bool bSearchInNotes , utl::T
SwWrtShell *const pWrtShell = (pDocShell) ? pDocShell->GetWrtShell() : nullptr; SwWrtShell *const pWrtShell = (pDocShell) ? pDocShell->GetWrtShell() : nullptr;
SwPostItMgr *const pPostItMgr = (pWrtShell) ? pWrtShell->GetPostItMgr() : nullptr; SwPostItMgr *const pPostItMgr = (pWrtShell) ? pWrtShell->GetPostItMgr() : nullptr;
SvxSearchItem* pSearchItem = SwView::GetSearchItem();
if (pSearchItem && pSearchItem->IsSearchInShapes())
{
// Search in shapes only if explicitly requested.
SvxSearchItem aSearchItem(SID_SEARCH_ITEM); SvxSearchItem aSearchItem(SID_SEARCH_ITEM);
aSearchItem.SetSearchOptions(rSearchOpt); aSearchItem.SetSearchOptions(rSearchOpt);
aSearchItem.SetBackward(!bSrchForward); aSearchItem.SetBackward(!bSrchForward);
@@ -348,6 +344,7 @@ bool SwPaM::Find( const SearchOptions2& rSearchOpt, bool bSearchInNotes , utl::T
} }
// Writer and editeng selections are not supported in parallel. // Writer and editeng selections are not supported in parallel.
SvxSearchItem* pSearchItem = SwView::GetSearchItem();
// If we just finished search in shape text, don't attempt to do that again. // If we just finished search in shape text, don't attempt to do that again.
if (!bEndedTextEdit && !(pSearchItem && pSearchItem->GetCommand() == SvxSearchCmd::FIND_ALL)) if (!bEndedTextEdit && !(pSearchItem && pSearchItem->GetCommand() == SvxSearchCmd::FIND_ALL))
{ {
@@ -378,7 +375,6 @@ bool SwPaM::Find( const SearchOptions2& rSearchOpt, bool bSearchInNotes , utl::T
} }
} }
} }
}
sal_Int32 aStart = 0; sal_Int32 aStart = 0;
// do we need to finish a note? // do we need to finish a note?