View | Details | Raw Unified | Return to issue 49380
Collapse All | Expand All

(-)svx/inc/srchdlg.hxx (+2 lines)
Lines 177-182 public: Link Here
177
177
178
	INT32			GetTransliterationFlags() const;
178
	INT32			GetTransliterationFlags() const;
179
179
180
    void            SetSaveToModule(bool b);
181
    
180
private:
182
private:
181
	FixedText       aSearchText;
183
	FixedText       aSearchText;
182
	ComboBox        aSearchLB;
184
	ComboBox        aSearchLB;
(-)svx/source/dialog/srchdlg.cxx (-6 / +43 lines)
Lines 704-709 INT32 SvxSearchDialog::GetTransliterationFlags() const Link Here
704
	return nTransliterationFlags;
704
	return nTransliterationFlags;
705
}
705
}
706
706
707
void SvxSearchDialog::SetSaveToModule(bool b)
708
{
709
    pImpl->bSaveToModule = b;
710
}
711
707
// -----------------------------------------------------------------------
712
// -----------------------------------------------------------------------
708
713
709
void SvxSearchDialog::ApplyTransliterationFlags_Impl( INT32 nSettings )
714
void SvxSearchDialog::ApplyTransliterationFlags_Impl( INT32 nSettings )
Lines 956-964 void SvxSearchDialog::CalculateDelta_Impl() Link Here
956
961
957
// -----------------------------------------------------------------------
962
// -----------------------------------------------------------------------
958
963
964
namespace {
965
966
class ToggleSaveToModule
967
{
968
public:
969
    ToggleSaveToModule(SvxSearchDialog& rDialog, bool bValue) :
970
        mrDialog(rDialog), mbValue(bValue)
971
    {
972
        mrDialog.SetSaveToModule(mbValue);
973
    }
974
975
    ~ToggleSaveToModule()
976
    {
977
        mrDialog.SetSaveToModule(!mbValue);
978
    }
979
private:
980
    SvxSearchDialog& mrDialog;
981
    bool mbValue;
982
};
983
984
}
985
959
void SvxSearchDialog::Init_Impl( int bSearchPattern )
986
void SvxSearchDialog::Init_Impl( int bSearchPattern )
960
{
987
{
961
	DBG_ASSERT( pSearchItem, "SearchItem == 0" );
988
	DBG_ASSERT( pSearchItem, "SearchItem == 0" );
989
990
    // We don't want to save any intermediate state to the module while the 
991
    // dialog is being initialized.
992
    ToggleSaveToModule aNoModuleSave(*this, false);
993
962
	bWriter = ( pSearchItem->GetAppFlag() == SVX_SEARCHAPP_WRITER );
994
	bWriter = ( pSearchItem->GetAppFlag() == SVX_SEARCHAPP_WRITER );
963
995
964
	pImpl->bMultiLineEdit = FALSE;
996
	pImpl->bMultiLineEdit = FALSE;
Lines 1106-1115 void SvxSearchDialog::Init_Impl( int bSearchPattern ) Link Here
1106
		aSimilarityBox.Check( pSearchItem->IsLevenshtein() );
1138
		aSimilarityBox.Check( pSearchItem->IsLevenshtein() );
1107
	bSet = TRUE;
1139
	bSet = TRUE;
1108
1140
1109
	pImpl->bSaveToModule = FALSE;
1110
	FlagHdl_Impl( &aSimilarityBox );
1141
	FlagHdl_Impl( &aSimilarityBox );
1111
	FlagHdl_Impl( &aJapOptionsCB );
1142
	FlagHdl_Impl( &aJapOptionsCB );
1112
	pImpl->bSaveToModule = TRUE;
1113
1143
1114
	FASTBOOL bDisableSearch = FALSE;
1144
	FASTBOOL bDisableSearch = FALSE;
1115
	SfxViewShell* pViewShell = SfxViewShell::Current();
1145
	SfxViewShell* pViewShell = SfxViewShell::Current();
Lines 1638-1653 IMPL_LINK( SvxSearchDialog, ModifyHdl_Impl, ComboBox *, pEd ) Link Here
1638
	else
1668
	else
1639
		bSet = FALSE;
1669
		bSet = FALSE;
1640
1670
1671
    // Calc allows searching for empty cells.
1672
    bool bAllowEmptySearch = (pSearchItem->GetAppFlag() == SVX_SEARCHAPP_CALC);
1673
1641
	if ( pEd == &aSearchLB || pEd == &aReplaceLB )
1674
	if ( pEd == &aSearchLB || pEd == &aReplaceLB )
1642
	{
1675
	{
1643
		xub_StrLen nLBTxtLen = aSearchLB.GetText().Len(), nTxtLen;
1676
		xub_StrLen nSrchTxtLen = aSearchLB.GetText().Len();
1677
        xub_StrLen nReplTxtLen = 0;
1678
        if (bAllowEmptySearch)
1679
            nReplTxtLen = aReplaceLB.GetText().Len();
1680
        xub_StrLen nAttrTxtLen = 0;
1644
1681
1645
		if ( !pImpl->bMultiLineEdit )
1682
		if ( !pImpl->bMultiLineEdit )
1646
		   nTxtLen = aSearchAttrText.GetText().Len();
1683
		   nAttrTxtLen = aSearchAttrText.GetText().Len();
1647
		else
1684
		else
1648
			nTxtLen = pImpl->aSearchFormats.GetText().Len();
1685
			nAttrTxtLen = pImpl->aSearchFormats.GetText().Len();
1649
1686
1650
		if ( nLBTxtLen || nTxtLen )
1687
		if (nSrchTxtLen || nReplTxtLen || nAttrTxtLen)
1651
		{
1688
		{
1652
			EnableControl_Impl( &aSearchBtn );
1689
			EnableControl_Impl( &aSearchBtn );
1653
			EnableControl_Impl( &aReplaceBtn );
1690
			EnableControl_Impl( &aReplaceBtn );

Return to issue 49380