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

(-)svx/inc/srchdlg.hxx (+2 lines)
Lines 160-165 public: Link Here
160
160
161
    INT32			GetTransliterationFlags() const;
161
    INT32			GetTransliterationFlags() const;
162
162
163
    void            SetSaveToModule(bool b);
164
163
private:
165
private:
164
    FixedText       aSearchText;
166
    FixedText       aSearchText;
165
    ComboBox        aSearchLB;
167
    ComboBox        aSearchLB;
(-)svx/source/dialog/srchdlg.cxx (-7 / +43 lines)
Lines 659-664 INT32 SvxSearchDialog::GetTransliterationFlags() const Link Here
659
    return nTransliterationFlags;
659
    return nTransliterationFlags;
660
}
660
}
661
661
662
void SvxSearchDialog::SetSaveToModule(bool b)
663
{
664
    pImpl->bSaveToModule = b;
665
}
666
662
// -----------------------------------------------------------------------
667
// -----------------------------------------------------------------------
663
668
664
void SvxSearchDialog::ApplyTransliterationFlags_Impl( INT32 nSettings )
669
void SvxSearchDialog::ApplyTransliterationFlags_Impl( INT32 nSettings )
Lines 914-922 void SvxSearchDialog::CalculateDelta_Impl() Link Here
914
919
915
// -----------------------------------------------------------------------
920
// -----------------------------------------------------------------------
916
921
922
namespace {
923
924
class ToggleSaveToModule
925
{
926
public:
927
    ToggleSaveToModule(SvxSearchDialog& rDialog, bool bValue) :
928
        mrDialog(rDialog), mbValue(bValue)
929
    {
930
        mrDialog.SetSaveToModule(mbValue);
931
    }
932
933
    ~ToggleSaveToModule()
934
    {
935
        mrDialog.SetSaveToModule(!mbValue);
936
    }
937
private:
938
    SvxSearchDialog& mrDialog;
939
    bool mbValue;
940
};
941
942
}
943
917
void SvxSearchDialog::Init_Impl( int bSearchPattern )
944
void SvxSearchDialog::Init_Impl( int bSearchPattern )
918
{
945
{
919
    DBG_ASSERT( pSearchItem, "SearchItem == 0" );
946
    DBG_ASSERT( pSearchItem, "SearchItem == 0" );
947
948
    // We don't want to save any intermediate state to the module while the
949
    // dialog is being initialized.
950
    ToggleSaveToModule aNoModuleSave(*this, false);
951
920
    bWriter = ( pSearchItem->GetAppFlag() == SVX_SEARCHAPP_WRITER );
952
    bWriter = ( pSearchItem->GetAppFlag() == SVX_SEARCHAPP_WRITER );
921
953
922
    pImpl->bMultiLineEdit = FALSE;
954
    pImpl->bMultiLineEdit = FALSE;
Lines 1064-1073 void SvxSearchDialog::Init_Impl( int bSearchPattern ) Link Here
1064
        aSimilarityBox.Check( pSearchItem->IsLevenshtein() );
1096
        aSimilarityBox.Check( pSearchItem->IsLevenshtein() );
1065
    bSet = TRUE;
1097
    bSet = TRUE;
1066
1098
1067
    pImpl->bSaveToModule = FALSE;
1068
    FlagHdl_Impl( &aSimilarityBox );
1099
    FlagHdl_Impl( &aSimilarityBox );
1069
    FlagHdl_Impl( &aJapOptionsCB );
1100
    FlagHdl_Impl( &aJapOptionsCB );
1070
    pImpl->bSaveToModule = TRUE;
1071
1101
1072
    FASTBOOL bDisableSearch = FALSE;
1102
    FASTBOOL bDisableSearch = FALSE;
1073
    SfxViewShell* pViewShell = SfxViewShell::Current();
1103
    SfxViewShell* pViewShell = SfxViewShell::Current();
Lines 1595-1610 IMPL_LINK( SvxSearchDialog, ModifyHdl_Impl, ComboBox *, pEd ) Link Here
1595
    else
1625
    else
1596
        bSet = FALSE;
1626
        bSet = FALSE;
1597
1627
1628
    // Calc allows searching for empty cells.
1629
    bool bAllowEmptySearch = (pSearchItem->GetAppFlag() == SVX_SEARCHAPP_CALC);
1630
1598
    if ( pEd == &aSearchLB || pEd == &aReplaceLB )
1631
    if ( pEd == &aSearchLB || pEd == &aReplaceLB )
1599
    {
1632
    {
1600
        xub_StrLen nLBTxtLen = aSearchLB.GetText().Len(), nTxtLen;
1633
        xub_StrLen nSrchTxtLen = aSearchLB.GetText().Len();
1634
        xub_StrLen nReplTxtLen = 0;
1635
        if (bAllowEmptySearch)
1636
            nReplTxtLen = aReplaceLB.GetText().Len();
1637
        xub_StrLen nAttrTxtLen = 0;
1601
1638
1602
        if ( !pImpl->bMultiLineEdit )
1639
        if ( !pImpl->bMultiLineEdit )
1603
           nTxtLen = aSearchAttrText.GetText().Len();
1640
           nAttrTxtLen = aSearchAttrText.GetText().Len();
1604
        else
1641
        else
1605
            nTxtLen = pImpl->aSearchFormats.GetText().Len();
1642
            nAttrTxtLen = pImpl->aSearchFormats.GetText().Len();
1606
1643
1607
        if ( nLBTxtLen || nTxtLen )
1644
        if (nSrchTxtLen || nReplTxtLen || nAttrTxtLen)
1608
        {
1645
        {
1609
            EnableControl_Impl( &aSearchBtn );
1646
            EnableControl_Impl( &aSearchBtn );
1610
            EnableControl_Impl( &aReplaceBtn );
1647
            EnableControl_Impl( &aReplaceBtn );
1611
- 

Return to issue 49380