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

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Tue Mar 15 11:42:53 UTC 2016


 sw/source/uibase/inc/content.hxx   |   18 +++++++++-----
 sw/source/uibase/inc/conttree.hxx  |   22 ++++++++++++++++-
 sw/source/uibase/utlui/content.cxx |   47 +------------------------------------
 3 files changed, 35 insertions(+), 52 deletions(-)

New commits:
commit 77db147eeff5643338c678ec73b6ca962b6c162f
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date:   Tue Mar 15 11:59:23 2016 +0100

    Fix some comments
    
    * Format some comments as doxygen comments
    * Remove some unnecessary comments
    
    Change-Id: I2a33ee70f73bef565bff662f77e13a15f32df253
    Reviewed-on: https://gerrit.libreoffice.org/23266
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/sw/source/uibase/inc/content.hxx b/sw/source/uibase/inc/content.hxx
index 85a20ec..10b547d 100644
--- a/sw/source/uibase/inc/content.hxx
+++ b/sw/source/uibase/inc/content.hxx
@@ -141,13 +141,15 @@ public:
 
     const SwTOXBase* GetTOXBase() const {return pBase;}
 };
-/*
-    class ContentType contains information to one type of content.
-    MemberArray is only populated if the content is requested by
-    GetMember. It is reloaded after Invalidate() only if the content
-    should be read again.
-*/
 
+/**
+ * Content type, knows it's contents and the WrtShell.
+ *
+ * The class ContentType contains information to one type of content.
+ * MemberArray is only populated if the content is requested by
+ * GetMember. It is reloaded after Invalidate() only if the content
+ * should be read again.
+*/
 class SwContentType : public SwTypeNumber
 {
     SwWrtShell*         pWrtShell;
@@ -168,10 +170,14 @@ public:
         virtual ~SwContentType();
 
         void                Init(bool* pbInvalidateWindow = nullptr);
+
+        /** Fill the List of contents */
         void                FillMemberList(bool* pbLevelChanged = nullptr);
         size_t              GetMemberCount() const
                                 {return nMemberCount;};
         ContentTypeId       GetType() const {return nContentType;}
+
+        /** Deliver content, for that if necessary fill the list */
         const SwContent*    GetMember(size_t nIndex);
         const OUString&     GetName() {return sContentTypeName;}
         const OUString&     GetSingleName() const {return sSingleContentTypeName;}
diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx
index 33cf7dd..2634ea4 100644
--- a/sw/source/uibase/inc/conttree.hxx
+++ b/sw/source/uibase/inc/conttree.hxx
@@ -50,6 +50,7 @@ enum class EditEntryMode
     RENAME        = 5,
 };
 
+/** TreeListBox for content indicator */
 class SwContentTree
     : public SvTreeListBox
     , public SfxListener
@@ -101,6 +102,10 @@ class SwContentTree
     bool                m_bIsKeySpace;
     Rectangle           m_aOldRectangle;
 
+    /**
+     * Before any data will be deleted, the last active entry has to be found.
+     * After this the UserData will be deleted
+     */
     void                FindActiveTypeAndRemoveUserData();
 
     using SvTreeListBox::ExecuteDrop;
@@ -121,6 +126,8 @@ protected:
 
     bool        FillTransferData( TransferDataContainer& rTransfer,
                                             sal_Int8& rDragMode );
+
+    /** Check if the displayed content is valid. */
     bool            HasContentChanged();
 
     virtual DragDropMode NotifyStartDrag( TransferDataContainer& rData,
@@ -156,14 +163,24 @@ public:
     OUString        GetEntryLongDescription( SvTreeListEntry* pEntry ) const override;
     SdrObject*      GetDrawingObjectsByContent(const SwContent *pCnt);
 
+    /** Switch the display to Root */
     void            ToggleToRoot();
     void            SetRootType(ContentTypeId nType);
+
+    /** Show the file */
     void            Display( bool bActiveView );
+    /** In the Clear the content types have to be deleted, also. */
     void            Clear();
+
+    /** After a file is dropped on the Navigator, the new shell will be set */
     void            SetHiddenShell(SwWrtShell* pSh);
     void            ShowHiddenShell();
     void            ShowActualView();
+
+    /** Document change - set new Shell */
     void            SetActiveShell(SwWrtShell* pSh);
+
+    /** Set an open view as active. */
     void            SetConstantShell(SwWrtShell* pSh);
 
     SwWrtShell*     GetWrtShell()
@@ -176,13 +193,16 @@ public:
     sal_uInt8       GetOutlineLevel()const {return m_nOutlineLevel;}
     void            SetOutlineLevel(sal_uInt8 nSet);
 
+    /** Expand - Remember the state for content types */
     virtual bool    Expand( SvTreeListEntry* pParent ) override;
-
+    /** Collapse - Remember the state for content types. */
     virtual bool    Collapse( SvTreeListEntry* pParent ) override;
 
+    /** Execute commands of the Navigator */
     void            ExecCommand(sal_uInt16 nCmd, bool bModifier);
 
     void            ShowTree();
+    /** folded together will not be glidled */
     void            HideTree();
 
     bool            IsConstantView() {return m_bIsConstant;}
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index a2f7ba2..2e226c6 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -217,8 +217,6 @@ SwTOXBaseContent::~SwTOXBaseContent()
 {
 }
 
-// Content type, knows it's contents and the WrtShell.
-
 SwContentType::SwContentType(SwWrtShell* pShell, ContentTypeId nType, sal_uInt8 nLevel) :
     SwTypeNumber(CTYPE_CTT),
     pWrtShell(pShell),
@@ -457,8 +455,6 @@ SwContentType::~SwContentType()
     delete pMember;
 }
 
-// Deliver content, for that if necessary fill the list
-
 const SwContent* SwContentType::GetMember(size_t nIndex)
 {
     if(!bDataValid || !pMember)
@@ -476,8 +472,6 @@ void    SwContentType::Invalidate()
     bDataValid = false;
 }
 
-// Fill the List of contents
-
 void    SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
 {
     SwContentArr*   pOldMember = nullptr;
@@ -778,8 +772,6 @@ void    SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
 
 }
 
-// TreeListBox for content indicator
-
 SwContentTree::SwContentTree(vcl::Window* pParent, const ResId& rResId)
     : SvTreeListBox(pParent, rResId)
     , m_sSpace(OUString("                    "))
@@ -884,9 +876,7 @@ OUString SwContentTree::GetEntryAltText( SvTreeListEntry* pEntry ) const
                         case OBJ_wegFITTEXT:
                         case OBJ_LINE:
                         case OBJ_RECT:
-                            //caoxueqin added custom shape
                         case OBJ_CUSTOMSHAPE:
-                            //end 2005/08/05
                         case OBJ_CIRC:
                         case OBJ_SECT:
                         case OBJ_CARC:
@@ -909,7 +899,6 @@ OUString SwContentTree::GetEntryAltText( SvTreeListEntry* pEntry ) const
                         {
                             return pTemp->GetTitle();
                         }
-                        //Commented End
                     }
                 }
             }
@@ -971,9 +960,7 @@ OUString SwContentTree::GetEntryLongDescription( SvTreeListEntry* pEntry ) const
                         case OBJ_wegFITTEXT:
                         case OBJ_LINE:
                         case OBJ_RECT:
-                            //caoxueqin added custom shape
                         case OBJ_CUSTOMSHAPE:
-                            //end 2005/08/05
                         case OBJ_CIRC:
                         case OBJ_SECT:
                         case OBJ_CARC:
@@ -996,7 +983,6 @@ OUString SwContentTree::GetEntryLongDescription( SvTreeListEntry* pEntry ) const
                         {
                             return pTemp->GetDescription();
                         }
-                        //Commented End
                     }
                 }
             }
@@ -1383,7 +1369,6 @@ void  SwContentTree::RequestingChildren( SvTreeListEntry* pParent )
     }
 }
 
-//Get drawing Objects by content .
 SdrObject* SwContentTree::GetDrawingObjectsByContent(const SwContent *pCnt)
 {
     SdrObject *pRetObj = nullptr;
@@ -1416,8 +1401,6 @@ SdrObject* SwContentTree::GetDrawingObjectsByContent(const SwContent *pCnt)
     return pRetObj;
 }
 
-// Expand - Remember the state for content types.
-
 bool  SwContentTree::Expand( SvTreeListEntry* pParent )
 {
     if(!m_bIsRoot || (static_cast<SwContentType*>(pParent->GetUserData())->GetType() == ContentTypeId::OUTLINE) ||
@@ -1473,8 +1456,6 @@ bool  SwContentTree::Expand( SvTreeListEntry* pParent )
     return SvTreeListBox::Expand(pParent);
 }
 
-// Collapse - Remember the state for content types.
-
 bool  SwContentTree::Collapse( SvTreeListEntry* pParent )
 {
     if(!m_bIsRoot || (static_cast<SwContentType*>(pParent->GetUserData())->GetType() == ContentTypeId::OUTLINE) ||
@@ -1534,8 +1515,6 @@ IMPL_LINK_NOARG_TYPED(SwContentTree, ContentDoubleClickHdl, SvTreeListBox*, bool
     return false;
 }
 
-// Show the file
-
 void SwContentTree::Display( bool bActive )
 {
     if(!m_bIsImageListInitialized)
@@ -1743,8 +1722,6 @@ void SwContentTree::Display( bool bActive )
     m_bActiveDocModified = false;
 }
 
-// In the Clear the content types have to be deleted, also.
-
 void SwContentTree::Clear()
 {
     SetUpdateMode(false);
@@ -1804,7 +1781,7 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer,
         case ContentTypeId::POSTIT:
         case ContentTypeId::INDEX:
         case ContentTypeId::REFERENCE :
-            // cannot inserted as URL or as  koennen weder als URL noch als region
+            // cannot be inserted, neither as URL nor as region
         break;
         case ContentTypeId::URLFIELD:
             sUrl = static_cast<SwURLFieldContent*>(pCnt)->GetURL();
@@ -1887,8 +1864,6 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer,
     return bRet;
 }
 
-// Switch the display to Root
-
 void SwContentTree::ToggleToRoot()
 {
     if(!m_bIsRoot)
@@ -1923,8 +1898,6 @@ void SwContentTree::ToggleToRoot()
     GetParentWindow()->m_aContentToolBox->CheckItem(FN_SHOW_ROOT, m_bIsRoot);
 }
 
-// Check if the displayed content is valid.
-
 bool SwContentTree::HasContentChanged()
 {
 
@@ -2138,9 +2111,6 @@ bool SwContentTree::HasContentChanged()
     return bRepaint;
 }
 
-// Before any data will be deleted, the last active entry has to be found.
-// After this the UserData will be deleted
-
 void SwContentTree::FindActiveTypeAndRemoveUserData()
 {
     SvTreeListEntry* pEntry = FirstSelected();
@@ -2162,9 +2132,6 @@ void SwContentTree::FindActiveTypeAndRemoveUserData()
     }
 }
 
-// After a file is dropped on the Navigator,
-// the new shell will be set.
-
 void SwContentTree::SetHiddenShell(SwWrtShell* pSh)
 {
     m_pHiddenShell = pSh;
@@ -2180,8 +2147,6 @@ void SwContentTree::SetHiddenShell(SwWrtShell* pSh)
     GetParentWindow()->UpdateListBox();
 }
 
-//  Document change - set new Shell
-
 void SwContentTree::SetActiveShell(SwWrtShell* pSh)
 {
     if(m_bIsInternalDrag)
@@ -2219,8 +2184,6 @@ void SwContentTree::SetActiveShell(SwWrtShell* pSh)
     }
 }
 
-// Set an open view as active.
-
 void SwContentTree::SetConstantShell(SwWrtShell* pSh)
 {
     if (m_pActiveShell)
@@ -2262,8 +2225,6 @@ void SwContentTree::Notify(SfxBroadcaster & rBC, SfxHint const& rHint)
     }
 }
 
-// Execute commands of the Navigator
-
 void SwContentTree::ExecCommand(sal_uInt16 nCmd, bool bModifier)
 {
     bool bMove = false;
@@ -2427,16 +2388,13 @@ void SwContentTree::Paint( vcl::RenderContext& rRenderContext,
     SvTreeListBox::Paint( rRenderContext, rRect );
 }
 
-// folded together will not be glidled
-
 void    SwContentTree::HideTree()
 {
     m_aUpdTimer.Stop();
     SvTreeListBox::Hide();
 }
 
-// No idle with focus or while dragging.
-
+/** No idle with focus or while dragging */
 IMPL_LINK_NOARG_TYPED(SwContentTree, TimerUpdate, Timer *, void)
 {
     if (IsDisposed())
@@ -3378,7 +3336,6 @@ void SwContentTree::GotoContent(SwContent* pCnt)
                 for( size_t i=0; i<nCount; ++i )
                 {
                     SdrObject* pTemp = pPage->GetObj(i);
-                    // #i51726# - all drawing objects can be named now
                     if (pTemp->GetName().equals(pCnt->GetName()))
                     {
                         SdrPageView* pPV = pDrawView->GetSdrPageView();


More information about the Libreoffice-commits mailing list