diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-02-21 15:54:57 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-02-21 16:46:12 +0000 |
commit | 38302b308559b8e34916a07ea3a160085c596c2e (patch) | |
tree | ea288c40d34202626bb08a6b8aee9a9bccee00c6 /svx/source/dialog | |
parent | 4870fc155ff789a1d002eebe3d2bd7e199ea0e28 (diff) |
split up redline dialog and adapt redline view code
Change-Id: Ib185eacbd0b4123ec947d116076358794bf42d46
Diffstat (limited to 'svx/source/dialog')
-rw-r--r-- | svx/source/dialog/ctredlin.cxx | 169 | ||||
-rw-r--r-- | svx/source/dialog/ctredlin.hrc | 22 | ||||
-rw-r--r-- | svx/source/dialog/ctredlin.src | 99 |
3 files changed, 61 insertions, 229 deletions
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index b9f5faf6a1d9..1c2fe8211aae 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <vcl/layout.hxx> #include <vcl/svapp.hxx> #include <tools/shl.hxx> #include <sfx2/app.hxx> @@ -486,170 +487,121 @@ void SvxRedlinTable::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, //---------------------------------------------------------------------------- SvxTPView::SvxTPView( Window * pParent) - : TabPage( pParent, SVX_RES(SID_REDLIN_VIEW_PAGE)), - m_aViewDataContainer(this, SVX_RES(DG_VIEW)), - aViewData(m_aViewDataContainer), - PbAccept ( this, SVX_RES(PB_ACCEPT ) ), - PbReject ( this, SVX_RES(PB_REJECT ) ), - PbAcceptAll ( this, SVX_RES(PB_ACCEPTALL ) ), - PbRejectAll ( this, SVX_RES(PB_REJECTALL ) ), - PbUndo ( this, SVX_RES(PB_UNDO ) ), - aTitle1 ( SVX_RES( STR_TITLE1 ) ), // local resource - aTitle2 ( SVX_RES( STR_TITLE2 ) ), - aTitle3 ( SVX_RES( STR_TITLE3 ) ), - aTitle4 ( SVX_RES( STR_TITLE4 ) ), - aTitle5 ( SVX_RES( STR_TITLE5 ) ) -{ - aViewData.SetAccessibleName(String(SVX_RES(STR_TREE))); - FreeResource(); - - aViewData.SetHelpId(HID_REDLINING_VIEW_DG_VIEW_TABLE); - aViewData.SetHeaderBarHelpId(HID_REDLINING_VIEW_DG_VIEW_HEADER); - - aMinSize=GetSizePixel(); + : TabPage(pParent, "RedlineViewPage", "svx/ui/redlineviewpage.ui") +{ + get(m_pAccept, "accept"); + get(m_pReject, "reject"); + get(m_pAcceptAll, "acceptall"); + get(m_pRejectAll, "rejectall"); + get(m_pUndo, "undo"); + + SvxSimpleTableContainer* pTable = get<SvxSimpleTableContainer>("changes"); + Size aControlSize(221, 130); + aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); + pTable->set_width_request(aControlSize.Width()); + pTable->set_height_request(aControlSize.Height()); + m_pViewData = new SvxRedlinTable(*pTable, 0); Link aLink=LINK( this, SvxTPView, PbClickHdl); - PbAccept.SetClickHdl(aLink); - PbAcceptAll.SetClickHdl(aLink); - PbReject.SetClickHdl(aLink); - PbRejectAll.SetClickHdl(aLink); - PbUndo.SetClickHdl(aLink); + m_pAccept->SetClickHdl(aLink); + m_pAcceptAll->SetClickHdl(aLink); + m_pReject->SetClickHdl(aLink); + m_pRejectAll->SetClickHdl(aLink); + m_pUndo->SetClickHdl(aLink); - nDistance=PbAccept.GetSizePixel().Height()+2*MIN_DISTANCE; - aViewData.SetTabs(nStaticTabs); + m_pViewData->SetTabs(nStaticTabs); } -void SvxTPView::Resize() +SvxTPView::~SvxTPView() { - Size aSize=GetOutputSizePixel(); - Point aPos = m_aViewDataContainer.GetPosPixel(); - aSize.Height()-=aPos.Y()+nDistance; - aSize.Width()-=2*aPos.X(); - - long newY=aPos.Y()+aSize.Height()+MIN_DISTANCE; - aPos=PbAccept.GetPosPixel(); - aPos.Y()=newY; - PbAccept.SetPosPixel(aPos); - aPos=PbAcceptAll.GetPosPixel(); - aPos.Y()=newY; - PbAcceptAll.SetPosPixel(aPos); - aPos=PbReject.GetPosPixel(); - aPos.Y()=newY; - PbReject.SetPosPixel(aPos); - aPos=PbRejectAll.GetPosPixel(); - aPos.Y()=newY; - PbRejectAll.SetPosPixel(aPos); - - if(PbUndo.IsVisible()) - { - aPos=PbUndo.GetPosPixel(); - aPos.Y()=newY; - PbUndo.SetPosPixel(aPos); - } - m_aViewDataContainer.SetSizePixel(aSize); + delete m_pViewData; } void SvxTPView::InsertWriterHeader() { - rtl::OUString aStrTab('\t'); - String aString(aTitle1); - aString+=aStrTab; - aString+=aTitle3; - aString+=aStrTab; - aString+=aTitle4; - aString+=aStrTab; - aString+=aTitle5; - aViewData.ClearHeader(); - aViewData.InsertHeaderEntry(aString); + OUString aStrTab('\t'); + OUString aString(get<FixedText>("action")->GetText()); + aString += aStrTab; + aString += get<FixedText>("author")->GetText(); + aString += aStrTab; + aString += get<FixedText>("date")->GetText(); + aString += aStrTab; + aString += get<FixedText>("comment")->GetText(); + m_pViewData->ClearHeader(); + m_pViewData->InsertHeaderEntry(aString); } void SvxTPView::InsertCalcHeader() { - rtl::OUString aStrTab('\t'); - String aString(aTitle1); - aString+=aStrTab; - aString+=aTitle2; - aString+=aStrTab; - aString+=aTitle3; - aString+=aStrTab; - aString+=aTitle4; - aString+=aStrTab; - aString+=aTitle5; - aViewData.ClearHeader(); - aViewData.InsertHeaderEntry(aString); + OUString aStrTab('\t'); + OUString aString(get<FixedText>("action")->GetText()); + aString += aStrTab; + aString += get<FixedText>("position")->GetText(); + aString += aStrTab; + aString += get<FixedText>("author")->GetText(); + aString += aStrTab; + aString += get<FixedText>("date")->GetText(); + aString += aStrTab; + aString += get<FixedText>("comment")->GetText(); + m_pViewData->ClearHeader(); + m_pViewData->InsertHeaderEntry(aString); } void SvxTPView::EnableAccept(sal_Bool nFlag) { - PbAccept.Enable(nFlag); + m_pAccept->Enable(nFlag); } void SvxTPView::EnableAcceptAll(sal_Bool nFlag) { - PbAcceptAll.Enable(nFlag); + m_pAcceptAll->Enable(nFlag); } void SvxTPView::EnableReject(sal_Bool nFlag) { - PbReject.Enable(nFlag); + m_pReject->Enable(nFlag); } void SvxTPView::EnableRejectAll(sal_Bool nFlag) { - PbRejectAll.Enable(nFlag); + m_pRejectAll->Enable(nFlag); } void SvxTPView::ShowUndo(sal_Bool nFlag) { - PbUndo.Show(nFlag); + m_pUndo->Show(nFlag); } void SvxTPView::EnableUndo(sal_Bool nFlag) { - PbUndo.Enable(nFlag); + m_pUndo->Enable(nFlag); } -Size SvxTPView::GetMinSizePixel() -{ - Size aSize=aMinSize; - if(PbUndo.IsVisible()) - { - sal_uIntPtr nSize=PbUndo.GetSizePixel().Width() - +PbUndo.GetPosPixel().X() - +PbAccept.GetPosPixel().X(); - - aSize.Width()=nSize; - } - - return aSize; -} - - SvxRedlinTable* SvxTPView::GetTableControl() { - return &aViewData; + return m_pViewData; } IMPL_LINK( SvxTPView, PbClickHdl, PushButton*, pPushB ) { - if(pPushB==&PbAccept) + if (pPushB == m_pAccept) { AcceptClickLk.Call(this); } - else if(pPushB==&PbAcceptAll) + else if (pPushB == m_pAcceptAll) { AcceptAllClickLk.Call(this); } - else if(pPushB==&PbReject) + else if (pPushB == m_pReject) { RejectClickLk.Call(this); } - else if(pPushB==&PbRejectAll) + else if (pPushB == m_pRejectAll) { RejectAllClickLk.Call(this); } - else if(pPushB==&PbUndo) + else if (pPushB == m_pUndo) { UndoClickLk.Call(this); } @@ -1212,7 +1164,8 @@ SvxAcceptChgCtr::SvxAcceptChgCtr( Window* pParent, const ResId& rResId ) { pTPFilter=new SvxTPFilter(&aTCAccept); pTPView=new SvxTPView(&aTCAccept); - aMinSize=pTPView->GetMinSizePixel(); + + aMinSize = VclContainer::getLayoutRequisition(*pTPView); aTCAccept.InsertPage( TP_VIEW, SVX_RESSTR(RID_SVXSTR_VIEW)); aTCAccept.InsertPage( TP_FILTER, SVX_RESSTR(RID_SVXSTR_FILTER)); @@ -1244,7 +1197,7 @@ SvxAcceptChgCtr::~SvxAcceptChgCtr() void SvxAcceptChgCtr::Resize() { - aMinSize=pTPView->GetMinSizePixel(); + aMinSize = VclContainer::getLayoutRequisition(*pTPView); Size aSize=GetOutputSizePixel(); sal_Bool bFlag=sal_False; @@ -1272,7 +1225,7 @@ void SvxAcceptChgCtr::Resize() Size SvxAcceptChgCtr::GetMinSizePixel() const { - Size aSize=pTPView->GetMinSizePixel(); + Size aSize = VclContainer::getLayoutRequisition(*pTPView); aSize.Height()+=gDiffSize.Height(); aSize.Width()+=gDiffSize.Width(); return aSize; diff --git a/svx/source/dialog/ctredlin.hrc b/svx/source/dialog/ctredlin.hrc index 603c52cd1edd..f71c10ec9fa4 100644 --- a/svx/source/dialog/ctredlin.hrc +++ b/svx/source/dialog/ctredlin.hrc @@ -16,27 +16,5 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <svx/svxids.hrc> // ->SID_REDLIN_VIEW_PAGE - #define TP_FILTER 11 #define TP_VIEW 12 - -#define DG_VIEW 2 -#define PB_ACCEPT 3 -#define PB_ACCEPTALL 4 -#define PB_REJECT 5 -#define PB_REJECTALL 6 -#define PB_UNDO 7 -#define STR_VIEW 8 - -#define STR_TITLE1 1 -#define STR_TITLE2 2 -#define STR_TITLE3 3 -#define STR_TITLE4 4 -#define STR_TITLE5 5 -#define STR_DATE_COMBOX 6 -#define STR_DATE_SPIN 7 -#define STR_DATE_SPIN1 8 -#define STR_DATE_TIME_SPIN 9 -#define STR_DATE_TIME_SPIN1 10 -#define STR_TREE 11 diff --git a/svx/source/dialog/ctredlin.src b/svx/source/dialog/ctredlin.src deleted file mode 100644 index 57035a9072e2..000000000000 --- a/svx/source/dialog/ctredlin.src +++ /dev/null @@ -1,99 +0,0 @@ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "ctredlin.hrc" -#include "helpid.hrc" - -#define MASKCOLOR MaskColor = Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; } ; - -TabPage SID_REDLIN_VIEW_PAGE -{ - HelpId = HID_REDLINING_VIEW_PAGE ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 270 , 126 ) ; - Hide = TRUE ; - Control DG_VIEW - { - HelpId = HID_REDLINING_VIEW_DG_VIEW ; - Pos = MAP_APPFONT ( 3 , 1 ) ; - Size = MAP_APPFONT ( 221 , 65 ) ; - Border = TRUE ; - }; - PushButton PB_ACCEPT - { - HelpId = HID_REDLINING_VIEW_PB_ACCEPT ; - Pos = MAP_APPFONT ( 3 , 69 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "~Accept" ; - }; - PushButton PB_REJECT - { - HelpId = HID_REDLINING_VIEW_PB_REJECT ; - Pos = MAP_APPFONT ( 69 , 69 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "~Reject" ; - }; - PushButton PB_ACCEPTALL - { - HelpId = HID_REDLINING_VIEW_PB_ACCEPTALL ; - Pos = MAP_APPFONT ( 141 , 69 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "A~ccept All" ; - }; - PushButton PB_REJECTALL - { - HelpId = HID_REDLINING_VIEW_PB_REJECTALL ; - Pos = MAP_APPFONT ( 207 , 69 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "R~eject All" ; - }; - - PushButton PB_UNDO - { - HelpId = HID_REDLINING_VIEW_PB_UNDO ; - Hide = TRUE; - Pos = MAP_APPFONT ( 279 , 69 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "Undo"; - }; - String STR_TITLE1 - { - Text [ en-US ] = "Action" ; - }; - String STR_TITLE2 - { - Text [ en-US ] = "Position" ; - }; - String STR_TITLE3 - { - Text [ en-US ] = "Author" ; - }; - String STR_TITLE4 - { - Text [ en-US ] = "Date" ; - }; - String STR_TITLE5 - { - Text [ en-US ] = "Comment" ; - }; - String STR_TREE - { - Text [ en-US ] = "Changes" ; - }; -}; |