[Libreoffice-commits] core.git: 3 commits - svx/README sw/source

Tor Lillqvist tml at collabora.com
Mon Apr 28 08:06:55 PDT 2014


 svx/README                                |    3 ---
 sw/source/core/uibase/uiview/view0.cxx    |    2 ++
 sw/source/core/uibase/uiview/viewsrch.cxx |   28 ++++++++++++++++++++++++++--
 sw/source/core/view/viewsh.cxx            |    2 ++
 4 files changed, 30 insertions(+), 5 deletions(-)

New commits:
commit d87b312bcc8a5e64d9a5d0ea647a1050629421bd
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Apr 28 16:45:06 2014 +0300

    Avoid SvxSearchDialogWrapper for non-desktop
    
    Change-Id: Ie602ac05caafba132d9c41333d034a5621664c13

diff --git a/sw/source/core/uibase/uiview/viewsrch.cxx b/sw/source/core/uibase/uiview/viewsrch.cxx
index d9bb583..6dd8370 100644
--- a/sw/source/core/uibase/uiview/viewsrch.cxx
+++ b/sw/source/core/uibase/uiview/viewsrch.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <config_features.h>
+
 #include <string>
 
 #include <boost/scoped_ptr.hpp>
@@ -189,6 +191,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
                 if( bRet )
                     Scroll(m_pWrtShell->GetCharRect().SVRect());
                 rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
+#if HAVE_FEATURE_DESKTOP
                 {
                     const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId();
                     SvxSearchDialogWrapper *pDlgWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nChildId);
@@ -199,6 +202,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
                         m_pSrchDlg->SetSrchFlag();
                     }
                 }
+#endif
             }
             break;
             case SVX_SEARCHCMD_FIND_ALL:
@@ -206,11 +210,14 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
                 sal_Bool bRet = SearchAll();
                 if( !bRet )
                 {
+#if HAVE_FEATURE_DESKTOP
                     if( !bApi )
                         SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
+#endif
                     m_bFound = sal_False;
                 }
                 rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
+#if HAVE_FEATURE_DESKTOP
                 {
                     const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId();
                     SvxSearchDialogWrapper *pDlgWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nChildId);
@@ -222,6 +229,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
                         m_pSrchDlg->SetSrchFlag();
                     }
                 }
+#endif
             }
             break;
             case SVX_SEARCHCMD_REPLACE:
@@ -270,6 +278,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
                     m_pSrchItem->SetCommand( nOldCmd );
                     rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
                 }
+#if HAVE_FEATURE_DESKTOP
                 {
                     const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId();
                     SvxSearchDialogWrapper *pDlgWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nChildId);
@@ -281,6 +290,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
                         m_pSrchDlg->SetSrchFlag();
                     }
                 }
+#endif
                 break;
 
             case SVX_SEARCHCMD_REPLACE_ALL:
@@ -322,8 +332,10 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
                     rReq.SetReturnValue(SfxBoolItem(nSlot, nFound != 0 && ULONG_MAX != nFound));
                     if( !nFound )
                     {
+#if HAVE_FEATURE_DESKTOP
                         if( !bApi )
                             SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
+#endif
                         m_bFound = sal_False;
                         return;
                     }
@@ -336,6 +348,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
                         InfoBox( pParentWindow, aText ).Execute();
                     }
                 }
+#if HAVE_FEATURE_DESKTOP
                 const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId();
                 SvxSearchDialogWrapper *pDlgWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nChildId);
 
@@ -345,6 +358,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
                     m_pSrchDlg->SetDocWin( (Window*)m_pEditWin);
                     m_pSrchDlg->SetSrchFlag();
                 }
+#endif
                 break;
             }
 
@@ -494,7 +508,11 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi)
     {
         m_pWrtShell->EndAllAction();
         if( !bApi )
+        {
+#if HAVE_FEATURE_DESKTOP
             SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
+#endif
+        }
         m_bFound = sal_False;
         m_pWrtShell->Pop();
         return sal_False;
@@ -523,11 +541,12 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi)
     m_bFound = bool(FUNC_Search( aOpts ));
     m_pWrtShell->EndAllAction();
     pWait.reset();
-
+#if HAVE_FEATURE_DESKTOP
     if (m_bFound)
         SvxSearchDialogWrapper::SetSearchLabel(SL_End);
     else if(!bApi)
         SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
+#endif
     return m_bFound;
 }
 
@@ -669,8 +688,9 @@ SwSearchOptions::SwSearchOptions( SwWrtShell* pSh, sal_Bool bBackward )
 
 sal_uLong SwView::FUNC_Search( const SwSearchOptions& rOptions )
 {
+#if HAVE_FEATURE_DESKTOP
     SvxSearchDialogWrapper::SetSearchLabel(SL_Empty);
-
+#endif
     sal_Bool bDoReplace = m_pSrchItem->GetCommand() == SVX_SEARCHCMD_REPLACE ||
                       m_pSrchItem->GetCommand() == SVX_SEARCHCMD_REPLACE_ALL;
 
@@ -756,10 +776,14 @@ sal_uLong SwView::FUNC_Search( const SwSearchOptions& rOptions )
 
 SvxSearchDialog* SwView::GetSearchDialog()
 {
+#if HAVE_FEATURE_DESKTOP
     const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId();
     SvxSearchDialogWrapper *pWrp = (SvxSearchDialogWrapper*) SfxViewFrame::Current()->GetChildWindow(nId);
     m_pSrchDlg = pWrp ? pWrp->getDialog () : 0;
     return m_pSrchDlg;
+#else
+    return NULL;
+#endif
 }
 
 void SwView::StateSearch(SfxItemSet &rSet)
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 5edacae..b46d071 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -556,12 +556,14 @@ Window* SwViewShell::CareChildWin(SwViewShell& rVSh)
 {
     if(rVSh.mpSfxViewShell)
     {
+#if HAVE_FEATURE_DESKTOP
         const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId();
         SfxViewFrame* pVFrame = rVSh.mpSfxViewShell->GetViewFrame();
         const SfxChildWindow* pChWin = pVFrame->GetChildWindow( nId );
         Window *pWin = pChWin ? pChWin->GetWindow() : NULL;
         if ( pWin && pWin->IsVisible() )
             return pWin;
+#endif
     }
     return NULL;
 }
commit c921717bbe4102e6ff86e914209a844639c510a0
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Apr 28 16:14:07 2014 +0300

    I think we don't need to register the 'child windows' for non-desktop
    
    Change-Id: I49be529a1b203685718019c3d4531e39064471b9

diff --git a/sw/source/core/uibase/uiview/view0.cxx b/sw/source/core/uibase/uiview/view0.cxx
index 6bc6c19..a681c09 100644
--- a/sw/source/core/uibase/uiview/view0.cxx
+++ b/sw/source/core/uibase/uiview/view0.cxx
@@ -92,6 +92,7 @@ SFX_IMPL_INTERFACE(SwView, SfxViewShell, SW_RES(RID_TOOLS_TOOLBOX) )
 
 void SwView::InitInterface_Impl()
 {
+#if HAVE_FEATURE_DESKTOP
     GetStaticInterface()->RegisterChildWindow(SID_NAVIGATOR, true);
 
     GetStaticInterface()->RegisterChildWindow(::sfx2::sidebar::SidebarChildWindow::GetChildWindowId());
@@ -113,6 +114,7 @@ void SwView::InitInterface_Impl()
 
     GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS|SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_SERVER,
                                             SW_RES(RID_TOOLS_TOOLBOX));
+#endif
 }
 
 TYPEINIT1(SwView,SfxViewShell)
commit 00566c14c115bbdf36a66a7e58b6b7da01db64b8
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Apr 28 13:03:02 2014 +0300

    Don't repeat yourself
    
    Change-Id: I1e5dca798eee45c961024771d276a00a5499efaa

diff --git a/svx/README b/svx/README
index c953e78..e78bb84 100644
--- a/svx/README
+++ b/svx/README
@@ -6,9 +6,6 @@ this is where a lot of wht work would happen to move to the canvas. (what does t
 svdraw
 transparent gradient stuff.
 
-Lots of the draw and impress code is in this shared library.
-
-
 Drawing Layer Object diagram:
 
 .------- Model ------------.     .------- View -----------------------------------------.


More information about the Libreoffice-commits mailing list