sw: prefix members of SdrHHCWrapper, SwAutoTextEventDescriptor, ...

... SwFlyNotify and SwHyphWrapper

See tdf#94879 for motivation.

Change-Id: Ib1508f7a97cedebd70186e379f5f7e571cd1f60a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127133
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 1ef396a..c7177379 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -261,8 +261,8 @@ public:

class SwFlyNotify : public SwLayNotify
{
    SwPageFrame *pOldPage;
    const SwRect aFrameAndSpace;
    SwPageFrame *m_pOldPage;
    const SwRect m_aFrameAndSpace;

    void ImplDestroy();

diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 2b21809..3a62692 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -657,8 +657,8 @@ SwFlyNotify::SwFlyNotify( SwFlyFrame *pFlyFrame ) :
    SwLayNotify( pFlyFrame ),
    // #115759# - keep correct page frame - the page frame
    // the Writer fly frame is currently registered at.
    pOldPage( pFlyFrame->GetPageFrame() ),
    aFrameAndSpace( pFlyFrame->GetObjRectWithSpaces() )
    m_pOldPage( pFlyFrame->GetPageFrame() ),
    m_aFrameAndSpace( pFlyFrame->GetObjRectWithSpaces() )
{
}

@@ -673,11 +673,11 @@ void SwFlyNotify::ImplDestroy()
        {
            //If in the LayAction the IsAgain is set it can be
            //that the old page is destroyed in the meantime!
            ::Notify( pFly, pOldPage, aFrameAndSpace, &maPrt );
            ::Notify( pFly, m_pOldPage, m_aFrameAndSpace, &maPrt );
            // #i35640# - additional notify anchor text frame,
            // if Writer fly frame has changed its page
            if ( pFly->GetAnchorFrame()->IsTextFrame() &&
                 pFly->GetPageFrame() != pOldPage )
                 pFly->GetPageFrame() != m_pOldPage )
            {
                pFly->AnchorFrame()->Prepare( PrepareHint::FlyFrameLeave );
            }
diff --git a/sw/source/uibase/inc/hyp.hxx b/sw/source/uibase/inc/hyp.hxx
index acec1b2..bbe8208 100644
--- a/sw/source/uibase/inc/hyp.hxx
+++ b/sw/source/uibase/inc/hyp.hxx
@@ -28,12 +28,12 @@ class SwView;

class SW_DLLPUBLIC SwHyphWrapper final : public SvxSpellWrapper {
private:
    SwView* pView;
    sal_uInt16      nPageCount;     // page count for progress view
    sal_uInt16      nPageStart;     // 1st checked page
    bool            bInSelection : 1; // separating selected text
    bool            bAutomatic : 1; // insert separators without further inquiry
    bool            bInfoBox : 1;   // display info-box when ending
    SwView* m_pView;
    sal_uInt16      m_nPageCount;     // page count for progress view
    sal_uInt16      m_nPageStart;     // 1st checked page
    bool            m_bInSelection : 1; // separating selected text
    bool            m_bAutomatic : 1; // insert separators without further inquiry
    bool            m_bInfoBox : 1;   // display info-box when ending

    virtual void SpellStart( SvxSpellArea eSpell ) override;
    virtual void SpellContinue() override;
diff --git a/sw/source/uibase/inc/unoatxt.hxx b/sw/source/uibase/inc/unoatxt.hxx
index 376b1dc..633a063 100644
--- a/sw/source/uibase/inc/unoatxt.hxx
+++ b/sw/source/uibase/inc/unoatxt.hxx
@@ -239,7 +239,7 @@ public:
/** Implement the XNameAccess for the AutoText events */
class SwAutoTextEventDescriptor final : public SvBaseEventDescriptor
{
    SwXAutoTextEntry& rAutoTextEntry;
    SwXAutoTextEntry& m_rAutoTextEntry;

    using SvBaseEventDescriptor::replaceByName;
    using SvBaseEventDescriptor::getByName;
diff --git a/sw/source/uibase/lingu/hyp.cxx b/sw/source/uibase/lingu/hyp.cxx
index d7d0c87..7a9a21b 100644
--- a/sw/source/uibase/lingu/hyp.cxx
+++ b/sw/source/uibase/lingu/hyp.cxx
@@ -31,7 +31,7 @@

#include <memory>

#define PSH         (&pView->GetWrtShell())
#define PSH         (&m_pView->GetWrtShell())

using namespace ::com::sun::star;

@@ -40,44 +40,44 @@ SwHyphWrapper::SwHyphWrapper( SwView* pVw,
            uno::Reference< linguistic2::XHyphenator > const &rxHyph,
            bool bStart, bool bOther, bool bSelect ) :
    SvxSpellWrapper( pVw->GetEditWin().GetFrameWeld(), rxHyph, bStart, bOther ),
    pView( pVw ),
    nPageCount( 0 ),
    nPageStart( 0 ),
    bInSelection( bSelect ),
    bInfoBox( false )
    m_pView( pVw ),
    m_nPageCount( 0 ),
    m_nPageStart( 0 ),
    m_bInSelection( bSelect ),
    m_bInfoBox( false )
{
    uno::Reference< linguistic2::XLinguProperties >  xProp( GetLinguPropertySet() );
    bAutomatic = xProp.is() && xProp->getIsHyphAuto();
    m_bAutomatic = xProp.is() && xProp->getIsHyphAuto();
}

void SwHyphWrapper::SpellStart( SvxSpellArea eSpell )
{
    if( SvxSpellArea::Other == eSpell && nPageCount )
    if( SvxSpellArea::Other == eSpell && m_nPageCount )
    {
        ::EndProgress( pView->GetDocShell() );
        nPageCount = 0;
        nPageStart = 0;
        ::EndProgress( m_pView->GetDocShell() );
        m_nPageCount = 0;
        m_nPageStart = 0;
    }
    pView->HyphStart( eSpell );
    m_pView->HyphStart( eSpell );
}

void SwHyphWrapper::SpellContinue()
{
    // for automatic separation, make actions visible only at the end
    std::unique_ptr<SwWait> pWait;
    if( bAutomatic )
    if( m_bAutomatic )
    {
        PSH->StartAllAction();
        pWait.reset(new SwWait( *pView->GetDocShell(), true ));
        pWait.reset(new SwWait( *m_pView->GetDocShell(), true ));
    }

    uno::Reference< uno::XInterface >  xHyphWord = bInSelection ?
    uno::Reference< uno::XInterface >  xHyphWord = m_bInSelection ?
                PSH->HyphContinue( nullptr, nullptr ) :
                PSH->HyphContinue( &nPageCount, &nPageStart );
                PSH->HyphContinue( &m_nPageCount, &m_nPageStart );
    SetLast( xHyphWord );

    // for automatic separation, make actions visible only at the end
    if( bAutomatic )
    if( m_bAutomatic )
    {
        PSH->EndAllAction();
        pWait.reset();
@@ -93,7 +93,7 @@ void SwHyphWrapper::SpellEnd()
bool SwHyphWrapper::SpellMore()
{
    PSH->Push();
    bInfoBox = true;
    m_bInfoBox = true;
    PSH->Combine();
    return false;
}
@@ -110,11 +110,11 @@ void SwHyphWrapper::InsertHyphen( const sal_Int32 nPos )

SwHyphWrapper::~SwHyphWrapper()
{
    if( nPageCount )
        ::EndProgress( pView->GetDocShell() );
    if( bInfoBox && !Application::IsHeadlessModeEnabled() )
    if( m_nPageCount )
        ::EndProgress( m_pView->GetDocShell() );
    if( m_bInfoBox && !Application::IsHeadlessModeEnabled() )
    {
        std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pView->GetEditWin().GetFrameWeld(),
        std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(m_pView->GetEditWin().GetFrameWeld(),
                                                      VclMessageType::Info, VclButtonsType::Ok,
                                                      SwResId(STR_HYP_OK)));
        xInfoBox->run();
diff --git a/sw/source/uibase/lingu/sdrhhcwrap.cxx b/sw/source/uibase/lingu/sdrhhcwrap.cxx
index 8106f0b..6df5911 100644
--- a/sw/source/uibase/lingu/sdrhhcwrap.cxx
+++ b/sw/source/uibase/lingu/sdrhhcwrap.cxx
@@ -43,16 +43,16 @@ SdrHHCWrapper::SdrHHCWrapper( SwView* pVw,
    SdrOutliner(pVw->GetDocShell()->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->
                             GetDrawOutliner().GetEmptyItemSet().GetPool(),
                OutlinerMode::TextObject ),
    pView( pVw ),
    pTextObj( nullptr ),
    nOptions( nConvOptions ),
    nDocIndex( 0 ),
    nSourceLang( nSourceLanguage ),
    nTargetLang( nTargetLanguage ),
    pTargetFont( pTargetFnt ),
    bIsInteractive( bInteractive )
    m_pView( pVw ),
    m_pTextObj( nullptr ),
    m_nOptions( nConvOptions ),
    m_nDocIndex( 0 ),
    m_nSourceLang( nSourceLanguage ),
    m_nTargetLang( nTargetLanguage ),
    m_pTargetFont( pTargetFnt ),
    m_bIsInteractive( bInteractive )
{
    SetRefDevice( pView->GetDocShell()->GetDoc()->getIDocumentDeviceAccess().getPrinter( false ) );
    SetRefDevice( m_pView->GetDocShell()->GetDoc()->getIDocumentDeviceAccess().getPrinter( false ) );

    MapMode aMapMode (MapUnit::MapTwip);
    SetRefMapMode(aMapMode);
@@ -60,62 +60,62 @@ SdrHHCWrapper::SdrHHCWrapper( SwView* pVw,
    Size aSize( 1, 1 );
    SetPaperSize( aSize );

    pOutlView.reset( new OutlinerView( this, &(pView->GetEditWin()) ) );
    pOutlView->GetOutliner()->SetRefDevice(pView->GetWrtShell().getIDocumentDeviceAccess().getPrinter( false ));
    m_pOutlView.reset( new OutlinerView( this, &(m_pView->GetEditWin()) ) );
    m_pOutlView->GetOutliner()->SetRefDevice(m_pView->GetWrtShell().getIDocumentDeviceAccess().getPrinter( false ));

    // Hack: all SdrTextObj attributes should be transferred to EditEngine
    pOutlView->SetBackgroundColor( COL_WHITE );
    m_pOutlView->SetBackgroundColor( COL_WHITE );

    InsertView( pOutlView.get() );
    InsertView( m_pOutlView.get() );
    Point aPoint( 0, 0 );
    tools::Rectangle aRect( aPoint, aSize );
    pOutlView->SetOutputArea( aRect );
    m_pOutlView->SetOutputArea( aRect );
//  SetText( NULL );
    ClearModifyFlag();
}

SdrHHCWrapper::~SdrHHCWrapper()
{
    if (pTextObj)
    if (m_pTextObj)
    {
        SdrView *pSdrView = pView->GetWrtShell().GetDrawView();
        SdrView *pSdrView = m_pView->GetWrtShell().GetDrawView();
        OSL_ENSURE( pSdrView, "SdrHHCWrapper without DrawView?" );
        pSdrView->SdrEndTextEdit( true );
        SetUpdateLayout(false);
        pOutlView->SetOutputArea( tools::Rectangle( Point(), Size(1, 1) ) );
        m_pOutlView->SetOutputArea( tools::Rectangle( Point(), Size(1, 1) ) );
    }
    RemoveView( pOutlView.get() );
    pOutlView.reset();
    RemoveView( m_pOutlView.get() );
    m_pOutlView.reset();
}

void SdrHHCWrapper::StartTextConversion()
{
    pOutlView->StartTextConversion(pView->GetFrameWeld(), nSourceLang, nTargetLang, pTargetFont, nOptions, bIsInteractive, true);
    m_pOutlView->StartTextConversion(m_pView->GetFrameWeld(), m_nSourceLang, m_nTargetLang, m_pTargetFont, m_nOptions, m_bIsInteractive, true);
}

bool SdrHHCWrapper::ConvertNextDocument()
{
    bool bNextDoc = false;

    if ( pTextObj )
    if ( m_pTextObj )
    {
        SdrView *pSdrView = pView->GetWrtShell().GetDrawView();
        SdrView *pSdrView = m_pView->GetWrtShell().GetDrawView();
        OSL_ENSURE( pSdrView, "SdrHHCWrapper without DrawView?" );
        pSdrView->SdrEndTextEdit( true );
        SetUpdateLayout(false);
        pOutlView->SetOutputArea( tools::Rectangle( Point(), Size(1, 1) ) );
        m_pOutlView->SetOutputArea( tools::Rectangle( Point(), Size(1, 1) ) );
        SetPaperSize( Size(1, 1) );
        Clear();
        pTextObj = nullptr;
        m_pTextObj = nullptr;
    }

    const auto n = nDocIndex;
    const auto n = m_nDocIndex;

    std::list<SdrTextObj*> aTextObjs;
    SwDrawContact::GetTextObjectsFromFormat(aTextObjs, *pView->GetDocShell()->GetDoc());
    SwDrawContact::GetTextObjectsFromFormat(aTextObjs, *m_pView->GetDocShell()->GetDoc());
    for (auto const& textObj : aTextObjs)
    {
        pTextObj = textObj;
        m_pTextObj = textObj;
        if (textObj)
        {
            OutlinerParaObject* pParaObj = textObj->GetOutlinerParaObject();
@@ -132,26 +132,26 @@ bool SdrHHCWrapper::ConvertNextDocument()
                //!! formatted when some information is accessed, and thus
                //!! incorrect results get returned.
                SetUpdateLayout(true);
                if (HasConvertibleTextPortion( nSourceLang ))
                if (HasConvertibleTextPortion( m_nSourceLang ))
                {
                    SdrView *pSdrView = pView->GetWrtShell().GetDrawView();
                    SdrView *pSdrView = m_pView->GetWrtShell().GetDrawView();
                    OSL_ENSURE( pSdrView, "SdrHHCWrapper without DrawView?" );
                    SdrPageView* pPV = pSdrView->GetSdrPageView();
                    nDocIndex = n;
                    m_nDocIndex = n;
                    bNextDoc = true;
                    pOutlView->SetOutputArea( tools::Rectangle( Point(), Size(1,1)));
                    SetPaperSize( pTextObj->GetLogicRect().GetSize() );
                    m_pOutlView->SetOutputArea( tools::Rectangle( Point(), Size(1,1)));
                    SetPaperSize( m_pTextObj->GetLogicRect().GetSize() );
                    SetUpdateLayout(true);
                    pView->GetWrtShell().MakeVisible(SwRect(pTextObj->GetLogicRect()));
                    m_pView->GetWrtShell().MakeVisible(SwRect(m_pTextObj->GetLogicRect()));

                    pSdrView->SdrBeginTextEdit(pTextObj, pPV, &pView->GetEditWin(), false, this, pOutlView.get(), true, true);
                    pSdrView->SdrBeginTextEdit(m_pTextObj, pPV, &m_pView->GetEditWin(), false, this, m_pOutlView.get(), true, true);
                }
                else
                    SetUpdateLayout(false);
            }

            if ( !bNextDoc )
                pTextObj = nullptr;
                m_pTextObj = nullptr;
            else
                break;
        }
diff --git a/sw/source/uibase/lingu/sdrhhcwrap.hxx b/sw/source/uibase/lingu/sdrhhcwrap.hxx
index acef5a4..4965bb5 100644
--- a/sw/source/uibase/lingu/sdrhhcwrap.hxx
+++ b/sw/source/uibase/lingu/sdrhhcwrap.hxx
@@ -28,15 +28,15 @@ class SdrHHCWrapper : public SdrOutliner
{
    // modified version of SdrSpeller

    SwView*             pView;
    SdrTextObj*         pTextObj;
    std::unique_ptr<OutlinerView> pOutlView;
    sal_Int32           nOptions;
    sal_uInt16          nDocIndex;
    LanguageType        nSourceLang;
    LanguageType        nTargetLang;
    const vcl::Font*    pTargetFont;
    bool                bIsInteractive;
    SwView*             m_pView;
    SdrTextObj*         m_pTextObj;
    std::unique_ptr<OutlinerView> m_pOutlView;
    sal_Int32           m_nOptions;
    sal_uInt16          m_nDocIndex;
    LanguageType        m_nSourceLang;
    LanguageType        m_nTargetLang;
    const vcl::Font*    m_pTargetFont;
    bool                m_bIsInteractive;

public:
    SdrHHCWrapper( SwView* pVw,
diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx
index 28a12c6..e045d21 100644
--- a/sw/source/uibase/uno/unoatxt.cxx
+++ b/sw/source/uibase/uno/unoatxt.cxx
@@ -923,7 +923,7 @@ const struct SvEventDescription aAutotextEvents[] =
SwAutoTextEventDescriptor::SwAutoTextEventDescriptor(
    SwXAutoTextEntry& rAutoText ) :
        SvBaseEventDescriptor(aAutotextEvents),
        rAutoTextEntry(rAutoText)
        m_rAutoTextEntry(rAutoText)
{
}

@@ -940,23 +940,23 @@ void SwAutoTextEventDescriptor::replaceByName(
    const SvMacroItemId nEvent,
    const SvxMacro& rMacro)
{
    OSL_ENSURE( nullptr != rAutoTextEntry.GetGlossaries(),
    OSL_ENSURE( nullptr != m_rAutoTextEntry.GetGlossaries(),
                "Strangely enough, the AutoText vanished!" );
    OSL_ENSURE( (nEvent == SvMacroItemId::SwEndInsGlossary) ||
                (nEvent == SvMacroItemId::SwStartInsGlossary) ,
                "Unknown event ID" );

    SwGlossaries *const pGlossaries =
        const_cast<SwGlossaries*>(rAutoTextEntry.GetGlossaries());
        const_cast<SwGlossaries*>(m_rAutoTextEntry.GetGlossaries());
    std::unique_ptr<SwTextBlocks> pBlocks(
        pGlossaries->GetGroupDoc( rAutoTextEntry.GetGroupName() ));
        pGlossaries->GetGroupDoc( m_rAutoTextEntry.GetGroupName() ));
    OSL_ENSURE( pBlocks,
                "can't get autotext group; SwAutoTextEntry has illegal name?");

    if( !pBlocks || pBlocks->GetError())
        return;

    sal_uInt16 nIndex = pBlocks->GetIndex( rAutoTextEntry.GetEntryName() );
    sal_uInt16 nIndex = pBlocks->GetIndex( m_rAutoTextEntry.GetEntryName() );
    if( nIndex != USHRT_MAX )
    {
        SvxMacroTableDtor aMacroTable;
@@ -973,15 +973,15 @@ void SwAutoTextEventDescriptor::getByName(
    SvxMacro& rMacro,
    const SvMacroItemId nEvent )
{
    OSL_ENSURE( nullptr != rAutoTextEntry.GetGlossaries(), "no AutoText" );
    OSL_ENSURE( nullptr != m_rAutoTextEntry.GetGlossaries(), "no AutoText" );
    OSL_ENSURE( (nEvent == SvMacroItemId::SwEndInsGlossary) ||
                (nEvent == SvMacroItemId::SwStartInsGlossary) ,
                "Unknown event ID" );

    SwGlossaries *const pGlossaries =
        const_cast<SwGlossaries*>(rAutoTextEntry.GetGlossaries());
        const_cast<SwGlossaries*>(m_rAutoTextEntry.GetGlossaries());
    std::unique_ptr<SwTextBlocks> pBlocks(
        pGlossaries->GetGroupDoc( rAutoTextEntry.GetGroupName() ));
        pGlossaries->GetGroupDoc( m_rAutoTextEntry.GetGroupName() ));
    OSL_ENSURE( pBlocks,
                "can't get autotext group; SwAutoTextEntry has illegal name?");

@@ -993,7 +993,7 @@ void SwAutoTextEventDescriptor::getByName(
    if ( !pBlocks || pBlocks->GetError())
        return;

    sal_uInt16 nIndex = pBlocks->GetIndex( rAutoTextEntry.GetEntryName() );
    sal_uInt16 nIndex = pBlocks->GetIndex( m_rAutoTextEntry.GetEntryName() );
    if( nIndex != USHRT_MAX )
    {
        SvxMacroTableDtor aMacroTable;