[Libreoffice-commits] core.git: 3 commits - icon-themes/galaxy include/svtools include/svx svtools/source svx/source sw/source

Jan Holesovsky kendy at collabora.com
Sat Jan 3 17:15:41 PST 2015


 icon-themes/galaxy/sw/res/redline_deleted.png  |binary
 icon-themes/galaxy/sw/res/redline_inserted.png |binary
 include/svtools/simptabl.hxx                   |    2 
 include/svtools/svtabbx.hxx                    |    2 
 include/svx/ctredlin.hxx                       |   59 +++++++-------
 svtools/source/contnr/simptabl.cxx             |    2 
 svtools/source/contnr/svtabbx.cxx              |    2 
 svx/source/dialog/ctredlin.cxx                 |  101 ++++++++++---------------
 sw/source/ui/shells/shells.src                 |   30 +++++++
 sw/source/uibase/inc/redlndlg.hxx              |    1 
 sw/source/uibase/inc/shells.hrc                |    7 +
 sw/source/uibase/misc/redlndlg.cxx             |   41 ++++++----
 12 files changed, 145 insertions(+), 102 deletions(-)

New commits:
commit 2d59c0c940ac61240992502256c966b2cb4f9daa
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Sun Jan 4 02:10:44 2015 +0100

    changes sidebar: Make the "Action" narrower when we use bitmaps now.
    
    Change-Id: I6ccf65308b7339768e9e0cc3c0b43fefc926f7e8

diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index b39052b..586077f 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -387,9 +387,6 @@ SvxTPView::SvxTPView(vcl::Window *pParent, VclBuilderContainer *pTopLevel)
     m_pReject->SetClickHdl(aLink);
     m_pRejectAll->SetClickHdl(aLink);
     m_pUndo->SetClickHdl(aLink);
-
-    const long pTabs[] = { 5, 10, 65, 120, 170, 220 };
-    m_pViewData->SetTabs(pTabs);
 }
 
 void SvxTPView::ActivatePage()
@@ -419,6 +416,9 @@ SvxTPView::~SvxTPView()
 
 void SvxTPView::InsertWriterHeader()
 {
+    const long pTabs[] = { 5, 10, 20, 70, 120, 170 };
+    m_pViewData->SetTabs(pTabs);
+
     OUString aStrTab('\t');
     OUString aString(get<FixedText>("action")->GetText());
     aString += aStrTab;
@@ -433,6 +433,9 @@ void SvxTPView::InsertWriterHeader()
 
 void SvxTPView::InsertCalcHeader()
 {
+    const long pTabs[] = { 5, 10, 65, 120, 170, 220 };
+    m_pViewData->SetTabs(pTabs);
+
     OUString aStrTab('\t');
     OUString aString(get<FixedText>("action")->GetText());
     aString += aStrTab;
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index 18ecbc4..fe613d4 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -191,13 +191,6 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(vcl::Window *pParent, VclBuilderContainer
     pTable->SetSelectionMode(MULTIPLE_SELECTION);
     pTable->SetHighlightRange(1);
 
-    static long aStaticTabs[]=
-    {
-        4,10,70,120,170
-    };
-
-    pTable->SetTabs(aStaticTabs);
-
     pTable->SortByCol(nSortMode, bSortDir);
 
     aOldSelectHdl = pTable->GetSelectHdl();
commit 5badba2028ebf3ce399ed659c78b3590f364c67e
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Sat Jan 3 23:50:02 2015 +0100

    A bit of cleanup.
    
    Change-Id: Ia7c5cf07dba7f65ee65dab67a0a32975c8026dce

diff --git a/include/svtools/simptabl.hxx b/include/svtools/simptabl.hxx
index 821a1d7..0069734 100644
--- a/include/svtools/simptabl.hxx
+++ b/include/svtools/simptabl.hxx
@@ -96,7 +96,7 @@ public:
                             sal_uInt16 nCol=HEADERBAR_APPEND,
                             HeaderBarItemBits nBits = HIB_STDSTYLE);
 
-    void            SetTabs( long* pTabs, MapUnit = MAP_APPFONT );
+    void            SetTabs(const long* pTabs, MapUnit = MAP_APPFONT);
 
     void            ClearHeader();
 
diff --git a/include/svtools/svtabbx.hxx b/include/svtools/svtabbx.hxx
index 24450a3..807eef9 100644
--- a/include/svtools/svtabbx.hxx
+++ b/include/svtools/svtabbx.hxx
@@ -65,7 +65,7 @@ protected:
 public:
     SvTabListBox( vcl::Window* pParent, WinBits = WB_BORDER );
     virtual ~SvTabListBox();
-    void            SetTabs( long* pTabs, MapUnit = MAP_APPFONT );
+    void            SetTabs(const long* pTabs, MapUnit = MAP_APPFONT);
     sal_uInt16          TabCount() const { return (sal_uInt16)nTabCount; }
     using SvTreeListBox::GetTab;
     long            GetTab( sal_uInt16 nTab ) const;
diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx
index 2eb1f17..9d8d3c7 100644
--- a/include/svx/ctredlin.hxx
+++ b/include/svx/ctredlin.hxx
@@ -42,9 +42,7 @@
 #define FLT_DATE_BETWEEN    4
 #define FLT_DATE_SAVE       5
 
-
-//  Struct for sorting data
-
+/// Struct for sorting data.
 class SVX_DLLPUBLIC RedlinData
 {
 public:
@@ -55,6 +53,7 @@ public:
     void*           pData;
 };
 
+/// Entries for list.
 class SvxRedlinEntry : public SvTreeListEntry
 {
 public:
@@ -62,7 +61,7 @@ public:
         virtual     ~SvxRedlinEntry();
 };
 
-// Class for the representation of Strings depending on the font
+/// Class for the representation of Strings depending on the font.
 class SvLBoxColorString : public SvLBoxString
 {
 private:
@@ -75,6 +74,10 @@ public:
                     SvLBoxColorString();
                     virtual ~SvLBoxColorString();
 
+    /** Paint function of the SvLBoxColorString class.
+
+        The relevant text with the selected color is drawn in the output device.
+    */
     virtual void Paint(
         const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE;
 
@@ -109,8 +112,6 @@ protected:
     virtual sal_Int32       ColCompare(SvTreeListEntry*,SvTreeListEntry*) SAL_OVERRIDE;
     virtual void            InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind) SAL_OVERRIDE;
 
-
-
 public:
 
     SvxRedlinTable(SvSimpleTableContainer& rParent, WinBits nBits = WB_BORDER);
@@ -165,9 +166,7 @@ public:
     const Link&     GetColCompareHdl() const { return aColCompareLink; }
 };
 
-
-//  Filter- Tabpage
-
+/// Tabpage with the filter text entries etc.
 class SVX_DLLPUBLIC SvxTPFilter: public TabPage
 {
 private:
@@ -208,7 +207,6 @@ private:
     DECL_LINK( ModifyDate, void* );
     DECL_LINK( RefHandle, PushButton* );
 
-
 protected:
 
     void            ShowDateFields(sal_uInt16 nKind);
@@ -232,7 +230,7 @@ public:
     void            SetLastTime(const tools::Time &aTime);
 
     void            SetDateMode(sal_uInt16 nMode);
-    sal_uInt16          GetDateMode();
+    sal_uInt16      GetDateMode();
 
     void            ClearAuthors();
     void            InsertAuthor( const OUString& rString, sal_Int32  nPos = LISTBOX_APPEND );
@@ -242,7 +240,6 @@ public:
     void            SetComment(const OUString& rComment);
     OUString        GetComment()const;
 
-
     // Methods for Calc {
     void            SetRange(const OUString& rString);
     OUString        GetRange() const;
@@ -293,15 +290,10 @@ public:
 
     void            Enable( bool bEnable = true, bool bChild = true );
     void            Disable( bool bChild = true );
-
     // } Methods for Calc
 };
 
-
-
-//  View- Tabpage
-
-
+/// Tabpage with the redlining entries.
 class SVX_DLLPUBLIC SvxTPView: public TabPage
 {
 private:
@@ -399,7 +391,6 @@ public:
     SvxRedlinTable* GetViewTable();
 };
 
-
 #endif // INCLUDED_SVX_CTREDLIN_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/contnr/simptabl.cxx b/svtools/source/contnr/simptabl.cxx
index c5d024c..8e7d7ad 100644
--- a/svtools/source/contnr/simptabl.cxx
+++ b/svtools/source/contnr/simptabl.cxx
@@ -168,7 +168,7 @@ void SvSimpleTable::SetTabs()
     }
 }
 
-void SvSimpleTable::SetTabs( long* pTabs, MapUnit eMapUnit)
+void SvSimpleTable::SetTabs(const long* pTabs, MapUnit eMapUnit)
 {
     SvHeaderTabListBox::SetTabs(pTabs,eMapUnit);
 }
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx
index 88c7b10..5c00f09 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -118,7 +118,7 @@ SvTabListBox::~SvTabListBox()
 #endif
 }
 
-void SvTabListBox::SetTabs( long* pTabs, MapUnit eMapUnit )
+void SvTabListBox::SetTabs(const long* pTabs, MapUnit eMapUnit)
 {
     DBG_ASSERT(pTabs,"SetTabs:NULL-Ptr");
     if( !pTabs )
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 57fd00e..b39052b 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -33,33 +33,19 @@
 #include <svx/ctredlin.hxx>
 #include "helpid.hrc"
 
-
-//  Local Defines and Function
-
-
-static long nStaticTabs[]=
-{
-    5,10,65,120,170,220
-};
-
 #define WRITER_DATE     2
 #define CALC_DATE       3
 
-RedlinData::RedlinData()
-    :
-        aDateTime( DateTime::EMPTY )
+RedlinData::RedlinData() : aDateTime(DateTime::EMPTY)
 {
     bDisabled=false;
     pData=NULL;
 }
+
 RedlinData::~RedlinData()
 {
 }
 
-
-//  class SvxRedlinEntry (Entries for list)
-
-
 SvxRedlinEntry::SvxRedlinEntry()
     : SvTreeListEntry()
 {
@@ -71,9 +57,6 @@ SvxRedlinEntry::~SvxRedlinEntry()
     delete pRedDat;
 }
 
-// Functions in the inserts Items of SvxRedlinTable
-
-
 SvLBoxColorString::SvLBoxColorString(SvTreeListEntry*pEntry, sal_uInt16 nFlags, const OUString& rStr,
     const Color& rCol)
     : SvLBoxString(pEntry, nFlags, rStr)
@@ -99,12 +82,6 @@ SvLBoxItem* SvLBoxColorString::Create() const
 void SvLBoxColorString::Paint(
     const Point& rPos, SvTreeListBox& rDev,
     const SvViewDataEntry* pView, const SvTreeListEntry* pEntry)
-/* [Description]
-
-   Paint function of the SvLBoxColorString class. The relevant text with the
-   selected color is drawn in the output device.
-*/
-
 {
     Color aColor=rDev.GetTextColor();
     Color a2Color=aColor;
@@ -192,7 +169,6 @@ void SvxRedlinTable::SetCalcView(bool bFlag)
     }
 }
 
-
 void SvxRedlinTable::UpdateFilterTest()
 {
     Date aDateMax( Date::SYSTEM );
@@ -202,7 +178,6 @@ void SvxRedlinTable::UpdateFilterTest()
     tools::Time aTMin(0);
     tools::Time aTMax(23,59,59);
 
-
     DateTime aDTMin(aDateMin);
     DateTime aDTMax(aDateMax);
 
@@ -236,7 +211,6 @@ void SvxRedlinTable::UpdateFilterTest()
     }
 }
 
-
 void SvxRedlinTable::SetFilterDate(bool bFlag)
 {
     bDate=bFlag;
@@ -414,7 +388,8 @@ SvxTPView::SvxTPView(vcl::Window *pParent, VclBuilderContainer *pTopLevel)
     m_pRejectAll->SetClickHdl(aLink);
     m_pUndo->SetClickHdl(aLink);
 
-    m_pViewData->SetTabs(nStaticTabs);
+    const long pTabs[] = { 5, 10, 65, 120, 170, 220 };
+    m_pViewData->SetTabs(pTabs);
 }
 
 void SvxTPView::ActivatePage()
@@ -1102,8 +1077,6 @@ void SvxAcceptChgCtr::ShowViewPage()
     SetCurPageId(m_nViewPageId);
 }
 
-
-
 SvxRedlinTable* SvxAcceptChgCtr::GetViewTable()
 {
     return pTPView ? pTPView->GetTableControl() : NULL;
commit 5f363ce8bc563f64271744026cf0e16830cf9b06
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Jan 2 02:32:25 2015 +0100

    changes sidebar: Use images instead of texts for types of changes in Writer.
    
    This is a Writer-only change because:
    
    1) Calc does not have the changes sidebar yet.
    
    2) The redlines in Calc have more complex descriptions (like 'Deleted
       column'), so postponing that for now until I have a good list of the
       possible values there so that I can ask for the icons.
    
    Change-Id: I2d9860261d0b690012c3c11cdd97a140f48842bf

diff --git a/icon-themes/galaxy/sw/res/redline_deleted.png b/icon-themes/galaxy/sw/res/redline_deleted.png
new file mode 100644
index 0000000..e4e1ee6
Binary files /dev/null and b/icon-themes/galaxy/sw/res/redline_deleted.png differ
diff --git a/icon-themes/galaxy/sw/res/redline_inserted.png b/icon-themes/galaxy/sw/res/redline_inserted.png
new file mode 100644
index 0000000..c85ef5f
Binary files /dev/null and b/icon-themes/galaxy/sw/res/redline_inserted.png differ
diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx
index 8d0f3191..2eb1f17 100644
--- a/include/svx/ctredlin.hxx
+++ b/include/svx/ctredlin.hxx
@@ -98,8 +98,9 @@ private:
     DateTime        aDaTiFilterFirst;
     DateTime        aDaTiFilterLast;
     OUString        aAuthor;
-    Color           aEntryColor;
-    OUString        aCurEntry;
+    Color           maEntryColor;
+    Image           maEntryImage;
+    OUString        maEntryString;
     utl::TextSearch* pCommentSearcher;
     Link            aColCompareLink;
 
@@ -136,19 +137,32 @@ public:
     bool            IsValidEntry(const OUString &rAuthor, const DateTime &rDateTime);
     bool            IsValidComment(const OUString &rComment);
 
-    SvTreeListEntry*    InsertEntry(const OUString& ,RedlinData *pUserData,
-                                SvTreeListEntry* pParent=NULL,sal_uIntPtr nPos=TREELIST_APPEND);
+    /** Insert a redline entry.
 
-    SvTreeListEntry*    InsertEntry(const OUString& ,RedlinData *pUserData,const Color&,
-                                SvTreeListEntry* pParent=NULL,sal_uIntPtr nPos=TREELIST_APPEND);
+        The rStr contains the entire redline entry; the columns are delimited by '\t'.
+    */
+    SvTreeListEntry* InsertEntry(const OUString &rStr, RedlinData *pUserData,
+                                 SvTreeListEntry* pParent = NULL, sal_uIntPtr nPos = TREELIST_APPEND);
 
+    /** Insert a redline entry.
+
+        The rStr contains the entire redline entry; the columns are delimited by '\t'.
+    */
+    SvTreeListEntry* InsertEntry(const OUString &rStr, RedlinData *pUserData, const Color&,
+                                 SvTreeListEntry* pParent = NULL, sal_uIntPtr nPos = TREELIST_APPEND);
+
+    /** Insert a redline entry.
+
+        rRedlineType contains the image for this redline entry (plus for insertion, minus for deletion etc.).
+        rStr contains the rest of the redline entry; the columns are delimited by '\t'.
+    */
+    SvTreeListEntry* InsertEntry(const Image &rRedlineType, const OUString &rStr, RedlinData *pUserData,
+                                 SvTreeListEntry* pParent = NULL, sal_uIntPtr nPos = TREELIST_APPEND);
 
     virtual SvTreeListEntry* CreateEntry() const SAL_OVERRIDE;
 
     void            SetColCompareHdl(const Link& rLink ) { aColCompareLink = rLink; }
     const Link&     GetColCompareHdl() const { return aColCompareLink; }
-
-
 };
 
 
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index a6165b5..57fd00e 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -321,23 +321,35 @@ bool SvxRedlinTable::IsValidComment(const OUString &rCommentStr)
     return pCommentSearcher->SearchForward( rCommentStr, &nStartPos, &nEndPos);
 }
 
-SvTreeListEntry* SvxRedlinTable::InsertEntry(const OUString& rStr,RedlinData *pUserData,
-                                SvTreeListEntry* pParent,sal_uIntPtr nPos)
+SvTreeListEntry* SvxRedlinTable::InsertEntry(const OUString& rStr,
+        RedlinData *pUserData, SvTreeListEntry* pParent, sal_uIntPtr nPos)
 {
     const Color aColor = (pUserData && pUserData->bDisabled) ? Color(COL_GRAY) : GetTextColor();
+
     return InsertEntry(rStr, pUserData, aColor, pParent, nPos);
 }
 
-SvTreeListEntry* SvxRedlinTable::InsertEntry(const OUString& rStr,RedlinData *pUserData,const Color& aColor,
-                                SvTreeListEntry* pParent,sal_uIntPtr nPos)
+SvTreeListEntry* SvxRedlinTable::InsertEntry(const OUString& rStr,
+        RedlinData *pUserData, const Color& rColor, SvTreeListEntry* pParent, sal_uIntPtr nPos)
 {
-    aEntryColor=aColor;
+    maEntryColor = rColor;
+    maEntryImage = Image();
 
     sal_Int32 nIndex = 0;
-    const OUString aFirstStr( rStr.getToken(0, '\t', nIndex ) );
-    aCurEntry = nIndex>0 ? rStr.copy(nIndex) : OUString();
+    const OUString aFirstStr(rStr.getToken(0, '\t', nIndex));
+    maEntryString = nIndex > 0 ? rStr.copy(nIndex) : OUString();
+
+    return SvSimpleTable::InsertEntry(aFirstStr, pParent, false, nPos, pUserData);
+}
+
+SvTreeListEntry* SvxRedlinTable::InsertEntry(const Image &rRedlineType, const OUString& rStr,
+        RedlinData *pUserData, SvTreeListEntry* pParent, sal_uIntPtr nPos)
+{
+    maEntryColor = (pUserData && pUserData->bDisabled) ? Color(COL_GRAY) : GetTextColor();
+    maEntryImage = rRedlineType;
+    maEntryString = rStr;
 
-    return SvSimpleTable::InsertEntry( aFirstStr, pParent, false, nPos, pUserData );
+    return SvSimpleTable::InsertEntry(OUString(), pParent, false, nPos, pUserData);
 }
 
 SvTreeListEntry* SvxRedlinTable::CreateEntry() const
@@ -346,31 +358,30 @@ SvTreeListEntry* SvxRedlinTable::CreateEntry() const
 }
 
 void SvxRedlinTable::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr,
-    const Image& rColl, const Image& rExp, SvLBoxButtonKind eButtonKind)
+        const Image& rColl, const Image& rExp, SvLBoxButtonKind eButtonKind)
 {
-    SvLBoxString* pString;
-    SvLBoxContextBmp* pContextBmp;
-
-    if( nTreeFlags & TREEFLAG_CHKBTN )
+    if (nTreeFlags & TREEFLAG_CHKBTN)
     {
-        SvLBoxButton* pButton= new SvLBoxButton( pEntry,eButtonKind,0,pCheckButtonData );
-        pEntry->AddItem( pButton );
+        pEntry->AddItem(new SvLBoxButton(pEntry, eButtonKind, 0, pCheckButtonData));
     }
 
-    pContextBmp= new SvLBoxContextBmp(pEntry,0, rColl,rExp, true);
-    pEntry->AddItem( pContextBmp );
+    pEntry->AddItem(new SvLBoxContextBmp(pEntry, 0, rColl, rExp, true));
 
-    pString = new SvLBoxColorString( pEntry, 0, rStr ,aEntryColor);
-    pEntry->AddItem( pString );
+    // the type of the change
+    assert((rStr.isEmpty() && !!maEntryImage) || (!rStr.isEmpty() && !maEntryImage));
+
+    if (rStr.isEmpty())
+        pEntry->AddItem(new SvLBoxContextBmp(pEntry, 0, maEntryImage, maEntryImage, true));
+    else
+        pEntry->AddItem(new SvLBoxColorString(pEntry, 0, rStr, maEntryColor));
 
+    // the change tracking entries
     sal_Int32 nIndex = 0;
-    // TODO: verify if TabCount() is always >0 here!
-    const sal_uInt16 nCount = TabCount()-1;
-    for( sal_uInt16 nToken = 0; nToken < nCount; nToken++ )
+    const sal_uInt16 nCount = TabCount() - 1;
+    for (sal_uInt16 nToken = 0; nToken < nCount; nToken++)
     {
-        const OUString aToken = GetToken(aCurEntry, nIndex);
-        SvLBoxColorString* pStr = new SvLBoxColorString( pEntry, 0, aToken, aEntryColor);
-        pEntry->AddItem( pStr );
+        const OUString aToken = GetToken(maEntryString, nIndex);
+        pEntry->AddItem(new SvLBoxColorString(pEntry, 0, aToken, maEntryColor));
     }
 }
 
diff --git a/sw/source/ui/shells/shells.src b/sw/source/ui/shells/shells.src
index 4bb18b3..8db9032 100644
--- a/sw/source/ui/shells/shells.src
+++ b/sw/source/ui/shells/shells.src
@@ -71,6 +71,36 @@ String STR_REDLINE_AUTOFMT
 {
         Text [ en-US ] = "AutoCorrect";
 };
+
+Image IMG_REDLINE_INSERTED
+{
+    ImageBitmap = Bitmap{File = "redline_inserted.png";};
+};
+Image IMG_REDLINE_DELETED
+{
+    ImageBitmap = Bitmap{File = "redline_deleted.png";};
+};
+Image IMG_REDLINE_FORMATED
+{
+    // FIXME
+    ImageBitmap = Bitmap{File = "redline_inserted.png";};
+};
+Image IMG_REDLINE_TABLECHG
+{
+    // FIXME
+    ImageBitmap = Bitmap{File = "redline_inserted.png";};
+};
+Image IMG_REDLINE_FMTCOLLSET
+{
+    // FIXME
+    ImageBitmap = Bitmap{File = "redline_inserted.png";};
+};
+Image IMG_REDLINE_AUTOFMT
+{
+    // FIXME
+    ImageBitmap = Bitmap{File = "redline_inserted.png";};
+};
+
 String STR_REDLINE_FORMATED
 {
         Text [ en-US ] = "Formats" ;
diff --git a/sw/source/uibase/inc/redlndlg.hxx b/sw/source/uibase/inc/redlndlg.hxx
index f26b023..97cffe6 100644
--- a/sw/source/uibase/inc/redlndlg.hxx
+++ b/sw/source/uibase/inc/redlndlg.hxx
@@ -110,6 +110,7 @@ class SW_DLLPUBLIC SwRedlineAcceptDlg
     SAL_DLLPRIVATE void          InitAuthors();
 
     SAL_DLLPRIVATE OUString      GetRedlineText(const SwRangeRedline& rRedln, DateTime &rDateTime, sal_uInt16 nStack = 0);
+    SAL_DLLPRIVATE Image         GetActionImage(const SwRangeRedline& rRedln, sal_uInt16 nStack = 0);
     SAL_DLLPRIVATE OUString      GetActionText(const SwRangeRedline& rRedln, sal_uInt16 nStack = 0);
     SAL_DLLPRIVATE sal_uInt16    GetRedlinePos( const SvTreeListEntry& rEntry) const;
 
diff --git a/sw/source/uibase/inc/shells.hrc b/sw/source/uibase/inc/shells.hrc
index 685b0e2..5383769 100644
--- a/sw/source/uibase/inc/shells.hrc
+++ b/sw/source/uibase/inc/shells.hrc
@@ -45,6 +45,13 @@
 #define RID_OLE_TOOLBOX            (RC_SHELLS_BEGIN +  22)
 #define RID_TOOLS_TOOLBOX          (RC_SHELLS_BEGIN +  23)
 
+#define IMG_REDLINE_INSERTED       (RC_SHELLS_BEGIN + 24)
+#define IMG_REDLINE_DELETED        (RC_SHELLS_BEGIN + 25)
+#define IMG_REDLINE_FORMATED       (RC_SHELLS_BEGIN + 26)
+#define IMG_REDLINE_TABLECHG       (RC_SHELLS_BEGIN + 27)
+#define IMG_REDLINE_FMTCOLLSET     (RC_SHELLS_BEGIN + 28)
+#define IMG_REDLINE_AUTOFMT        (RC_SHELLS_BEGIN + 29)
+
 #define RID_BEZIER_TOOLBOX         (RC_SHELLS_BEGIN +  33)
 
 #define STR_SWBG_PARAGRAPH         (RC_SHELLS_BEGIN +  37)
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index ef6c96a..18ecbc4 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -312,12 +312,9 @@ void SwRedlineAcceptDlg::InitAuthors()
                                 !bOnlyFormatedRedlines );
 }
 
-OUString SwRedlineAcceptDlg::GetRedlineText( const SwRangeRedline& rRedln,
-                                        DateTime &rDateTime, sal_uInt16 nStack)
+OUString SwRedlineAcceptDlg::GetRedlineText(const SwRangeRedline& rRedln, DateTime &rDateTime, sal_uInt16 nStack)
 {
-    OUString sEntry(GetActionText(rRedln, nStack));
-    sEntry += "\t";
-    sEntry += rRedln.GetAuthorString(nStack);
+    OUString sEntry(rRedln.GetAuthorString(nStack));
     sEntry += "\t";
 
     const DateTime &rDT = rRedln.GetTimeStamp(nStack);
@@ -331,6 +328,28 @@ OUString SwRedlineAcceptDlg::GetRedlineText( const SwRangeRedline& rRedln,
     return sEntry;
 }
 
+Image SwRedlineAcceptDlg::GetActionImage(const SwRangeRedline& rRedln, sal_uInt16 nStack)
+{
+    const static Image aInserted(SW_RES(IMG_REDLINE_INSERTED));
+    const static Image aDeleted(SW_RES(IMG_REDLINE_DELETED));
+    const static Image aFormated(SW_RES(IMG_REDLINE_FORMATED));
+    const static Image aTableChgd(SW_RES(IMG_REDLINE_TABLECHG));
+    const static Image aFmtCollSet(SW_RES(IMG_REDLINE_FMTCOLLSET));
+    const static Image aAutoFormat(SW_RES(IMG_REDLINE_AUTOFMT));
+
+    switch (rRedln.GetType(nStack))
+    {
+        case nsRedlineType_t::REDLINE_INSERT:  return aInserted;
+        case nsRedlineType_t::REDLINE_DELETE:  return aDeleted;
+        case nsRedlineType_t::REDLINE_FORMAT:  return aFormated;
+        case nsRedlineType_t::REDLINE_PARAGRAPH_FORMAT: return aFormated;
+        case nsRedlineType_t::REDLINE_TABLE:   return aTableChgd;
+        case nsRedlineType_t::REDLINE_FMTCOLL: return aFmtCollSet;
+    }
+
+    return Image();
+}
+
 OUString SwRedlineAcceptDlg::GetActionText(const SwRangeRedline& rRedln, sal_uInt16 nStack)
 {
     switch( rRedln.GetType(nStack) )
@@ -585,7 +604,8 @@ void SwRedlineAcceptDlg::InsertChildren(SwRedlineDataParent *pParent, const SwRa
             pData->bDisabled = true;
             sChild = GetRedlineText(rRedln, pData->aDateTime, nStack);
 
-            SvTreeListEntry* pChild = pTable->InsertEntry(sChild, pData, pParent->pTLBParent);
+            SvTreeListEntry* pChild = pTable->InsertEntry(GetActionImage(rRedln, nStack),
+                    sChild, pData, pParent->pTLBParent);
 
             pRedlineChild->pTLBChild = pChild;
             if (!bValidParent)
@@ -731,7 +751,7 @@ void SwRedlineAcceptDlg::InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd)
         pData->bDisabled = false;
 
         sParent = GetRedlineText(rRedln, pData->aDateTime);
-        pParent = pTable->InsertEntry(sParent, pData, 0, i);
+        pParent = pTable->InsertEntry(GetActionImage(rRedln), sParent, pData, 0, i);
         if( pCurrRedline == &rRedln )
         {
             pTable->SetCurEntry( pParent );


More information about the Libreoffice-commits mailing list