bump product version to 5.0.4.1
[LibreOffice.git] / sfx2 / source / dialog / versdlg.cxx
blob47ec3a6c6f0be3e3382f62c21ff95b647bf5a8b9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sal/config.h>
22 #include <boost/noncopyable.hpp>
23 #include <boost/scoped_ptr.hpp>
24 #include <unotools/localedatawrapper.hxx>
25 #include <comphelper/processfactory.hxx>
26 #include <svl/eitem.hxx>
27 #include <svl/intitem.hxx>
28 #include <svl/stritem.hxx>
29 #include <svl/itemset.hxx>
30 #include <unotools/useroptions.hxx>
31 #include <vcl/layout.hxx>
32 #include <vcl/msgbox.hxx>
33 #include <vcl/svapp.hxx>
34 #include <vcl/settings.hxx>
35 #include <tools/datetime.hxx>
36 #include <svtools/treelistentry.hxx>
37 #include <svtools/miscopt.hxx>
39 #include "versdlg.hxx"
40 #include "dialog.hrc"
41 #include <sfx2/dialoghelper.hxx>
42 #include <sfx2/viewfrm.hxx>
43 #include <sfx2/sfxresid.hxx>
44 #include <sfx2/docfile.hxx>
45 #include <sfx2/objsh.hxx>
46 #include <sfx2/sfxsids.hrc>
47 #include <sfx2/dispatch.hxx>
48 #include <sfx2/request.hxx>
50 #include <sfx2/sfxuno.hxx>
51 #include <vector>
53 using namespace com::sun::star;
54 using ::std::vector;
56 // **************************************************************************
57 struct SfxVersionInfo
59 OUString aName;
60 OUString aComment;
61 OUString aAuthor;
62 DateTime aCreationDate;
64 SfxVersionInfo();
67 typedef vector< SfxVersionInfo* > _SfxVersionTable;
69 class SfxVersionTableDtor: private boost::noncopyable
71 private:
72 _SfxVersionTable aTableList;
73 public:
74 SfxVersionTableDtor( const uno::Sequence < util::RevisionTag >& rInfo );
75 SfxVersionTableDtor( const uno::Sequence < document::CmisVersion > & rInfo );
76 ~SfxVersionTableDtor()
77 { DelDtor(); }
79 void DelDtor();
81 size_t size() const
82 { return aTableList.size(); }
84 SfxVersionInfo* at( size_t i ) const
85 { return aTableList[ i ]; }
88 SfxVersionTableDtor::SfxVersionTableDtor( const uno::Sequence < util::RevisionTag >& rInfo )
90 for ( sal_Int32 n=0; n<(sal_Int32)rInfo.getLength(); n++ )
92 SfxVersionInfo* pInfo = new SfxVersionInfo;
93 pInfo->aName = rInfo[n].Identifier;
94 pInfo->aComment = rInfo[n].Comment;
95 pInfo->aAuthor = rInfo[n].Author;
97 pInfo->aCreationDate = DateTime( rInfo[n].TimeStamp );
98 aTableList.push_back( pInfo );
102 SfxVersionTableDtor::SfxVersionTableDtor( const uno::Sequence < document::CmisVersion >& rInfo )
104 for ( sal_Int32 n=0; n<(sal_Int32)rInfo.getLength(); n++ )
106 SfxVersionInfo* pInfo = new SfxVersionInfo;
107 pInfo->aName = rInfo[n].Id;
108 pInfo->aComment = rInfo[n].Comment;
109 pInfo->aAuthor = rInfo[n].Author;
111 pInfo->aCreationDate = DateTime( rInfo[n].TimeStamp );
112 aTableList.push_back( pInfo );
116 void SfxVersionTableDtor::DelDtor()
118 for ( size_t i = 0, n = aTableList.size(); i < n; ++i )
119 delete aTableList[ i ];
120 aTableList.clear();
123 SfxVersionInfo::SfxVersionInfo()
124 : aCreationDate( DateTime::EMPTY )
128 void SfxVersionsTabListBox_Impl::KeyInput(const KeyEvent& rKeyEvent)
130 const vcl::KeyCode& rCode = rKeyEvent.GetKeyCode();
131 switch (rCode.GetCode())
133 case KEY_RETURN :
134 case KEY_ESCAPE :
135 case KEY_TAB :
137 Dialog *pParent = GetParentDialog();
138 if (pParent)
139 pParent->KeyInput(rKeyEvent);
140 else
141 SvSimpleTable::KeyInput(rKeyEvent);
142 break;
144 default:
145 SvSimpleTable::KeyInput( rKeyEvent );
146 break;
150 void SfxVersionsTabListBox_Impl::Resize()
152 SvSimpleTable::Resize();
153 if (isInitialLayout(this))
154 setColSizes();
157 void SfxVersionsTabListBox_Impl::setColSizes()
159 HeaderBar &rBar = GetTheHeaderBar();
160 if (rBar.GetItemCount() < 3)
161 return;
163 // recalculate the datetime column width
164 long nWidestTime(GetTextWidth(getWidestTime(Application::GetSettings().GetLocaleDataWrapper())));
165 long nW1 = rBar.GetTextWidth(rBar.GetItemText(1));
167 long nMax = std::max(nWidestTime, nW1) + 12; // max width + a little offset
168 const long nRest = GetSizePixel().Width() - nMax;
170 std::set<OUString> aAuthors;
171 SfxVersionInfo aInfo;
172 aAuthors.insert(SvtUserOptions().GetFullName());
174 for (SvTreeListEntry* pEntry = First(); pEntry; pEntry = Next(pEntry))
176 aAuthors.insert(static_cast<SfxVersionInfo*>(pEntry->GetUserData())->aAuthor);
179 long nMaxAuthorWidth = nRest/4;
180 for (std::set<OUString>::iterator aI = aAuthors.begin(), aEnd = aAuthors.end(); aI != aEnd; ++aI)
182 nMaxAuthorWidth = std::max(nMaxAuthorWidth, GetTextWidth(*aI));
183 if (nMaxAuthorWidth > nRest/2)
185 nMaxAuthorWidth = nRest/2;
186 break;
190 long aStaticTabs[] = { 3, 0, 0, 0 };
191 aStaticTabs[2] = nMax;
192 aStaticTabs[3] = nMax + nMaxAuthorWidth;
193 SvSimpleTable::SetTabs(aStaticTabs, MAP_PIXEL);
196 SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, bool bIsSaveVersionOnClose )
197 : SfxModalDialog(NULL, "VersionsOfDialog", "sfx/ui/versionsofdialog.ui")
198 , pViewFrame(pVwFrame)
199 , m_pTable(NULL)
200 , m_bIsSaveVersionOnClose(bIsSaveVersionOnClose)
202 get(m_pSaveButton, "save");
203 get(m_pSaveCheckBox, "always");
204 get(m_pOpenButton, "open");
205 get(m_pViewButton, "show");
206 get(m_pDeleteButton, "delete");
207 get(m_pCompareButton, "compare");
208 get(m_pCmisButton, "cmis");
210 SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("versions");
211 Size aControlSize(260, 114);
212 aControlSize = pContainer->LogicToPixel(aControlSize, MAP_APPFONT);
213 pContainer->set_width_request(aControlSize.Width());
214 pContainer->set_height_request(aControlSize.Height());
216 m_pVersionBox = VclPtr<SfxVersionsTabListBox_Impl>::Create(*pContainer, WB_TABSTOP);
218 Link<> aClickLink = LINK( this, SfxVersionDialog, ButtonHdl_Impl );
219 m_pViewButton->SetClickHdl ( aClickLink );
220 m_pSaveButton->SetClickHdl ( aClickLink );
221 m_pDeleteButton->SetClickHdl ( aClickLink );
222 m_pCompareButton->SetClickHdl ( aClickLink );
223 m_pOpenButton->SetClickHdl ( aClickLink );
224 m_pSaveCheckBox->SetClickHdl ( aClickLink );
225 m_pCmisButton->SetClickHdl ( aClickLink );
227 m_pVersionBox->SetSelectHdl( LINK( this, SfxVersionDialog, SelectHdl_Impl ) );
228 m_pVersionBox->SetDoubleClickHdl( LINK( this, SfxVersionDialog, DClickHdl_Impl ) );
230 m_pVersionBox->GrabFocus();
231 m_pVersionBox->SetStyle( m_pVersionBox->GetStyle() | WB_HSCROLL | WB_CLIPCHILDREN );
232 m_pVersionBox->SetSelectionMode( SINGLE_SELECTION );
234 long nTabs_Impl[] = { 3, 0, 0, 0 };
237 m_pVersionBox->SvSimpleTable::SetTabs(&nTabs_Impl[0]);
238 OUString sHeader1(get<FixedText>("datetime")->GetText());
239 OUString sHeader2(get<FixedText>("savedby")->GetText());
240 OUString sHeader3(get<FixedText>("comments")->GetText());
241 OUStringBuffer sHeader;
242 sHeader.append(sHeader1).append("\t").append(sHeader2)
243 .append("\t ").append(sHeader3);
244 m_pVersionBox->InsertHeaderEntry(sHeader.makeStringAndClear());
246 HeaderBar &rBar = m_pVersionBox->GetTheHeaderBar();
247 HeaderBarItemBits nBits = rBar.GetItemBits(1) | HeaderBarItemBits::FIXEDPOS | HeaderBarItemBits::FIXED;
248 nBits &= ~HeaderBarItemBits::CLICKABLE;
249 rBar.SetItemBits(1, nBits);
250 rBar.SetItemBits(2, nBits);
251 rBar.SetItemBits(3, nBits);
253 m_pVersionBox->Resize(); // OS: Hack for correct selection
256 // set dialog title (filename or docinfo title)
257 OUString sText = GetText();
258 sText = sText + " " + pViewFrame->GetObjectShell()->GetTitle();
259 SetText( sText );
261 Init_Impl();
263 m_pVersionBox->setColSizes();
266 OUString ConvertWhiteSpaces_Impl( const OUString& rText )
268 // converted linebreaks and tabs to blanks; it's necessary for the display
269 OUStringBuffer sConverted;
270 const sal_Unicode* pChars = rText.getStr();
271 while ( *pChars )
273 switch ( *pChars )
275 case '\n' :
276 case '\t' :
277 sConverted.append(' ');
278 break;
280 default:
281 sConverted.append(*pChars);
284 ++pChars;
287 return sConverted.makeStringAndClear();
290 void SfxVersionDialog::Init_Impl()
292 SfxObjectShell *pObjShell = pViewFrame->GetObjectShell();
293 SfxMedium* pMedium = pObjShell->GetMedium();
294 uno::Sequence < util::RevisionTag > aVersions = pMedium->GetVersionList( true );
295 delete m_pTable;
296 m_pTable = new SfxVersionTableDtor( aVersions );
298 for ( size_t n = 0; n < m_pTable->size(); ++n )
300 SfxVersionInfo *pInfo = m_pTable->at( n );
301 OUString aEntry = formatTime(pInfo->aCreationDate, Application::GetSettings().GetLocaleDataWrapper());
302 aEntry += "\t";
303 aEntry += pInfo->aAuthor;
304 aEntry += "\t";
305 aEntry += ConvertWhiteSpaces_Impl( pInfo->aComment );
306 SvTreeListEntry *pEntry = m_pVersionBox->InsertEntry( aEntry );
307 pEntry->SetUserData( pInfo );
311 m_pSaveCheckBox->Check( m_bIsSaveVersionOnClose );
313 bool bEnable = !pObjShell->IsReadOnly();
314 m_pSaveButton->Enable( bEnable );
315 m_pSaveCheckBox->Enable( bEnable );
317 m_pOpenButton->Disable();
318 m_pViewButton->Disable();
319 m_pDeleteButton->Disable();
320 m_pCompareButton->Disable();
322 SvtMiscOptions miscOptions;
323 if ( !miscOptions.IsExperimentalMode() )
324 m_pCmisButton->Hide( );
325 m_pCmisButton->Enable();
327 SelectHdl_Impl(m_pVersionBox);
330 SfxVersionDialog::~SfxVersionDialog()
332 disposeOnce();
335 void SfxVersionDialog::dispose()
337 delete m_pTable;
338 m_pVersionBox.disposeAndClear();
339 m_pSaveButton.clear();
340 m_pSaveCheckBox.clear();
341 m_pOpenButton.clear();
342 m_pViewButton.clear();
343 m_pDeleteButton.clear();
344 m_pCompareButton.clear();
345 m_pCmisButton.clear();
346 SfxModalDialog::dispose();
349 void SfxVersionDialog::Open_Impl()
351 SfxObjectShell *pObjShell = pViewFrame->GetObjectShell();
353 SvTreeListEntry *pEntry = m_pVersionBox->FirstSelected();
354 sal_uIntPtr nPos = SvTreeList::GetRelPos( pEntry );
355 SfxInt16Item aItem( SID_VERSION, (short)nPos+1 );
356 SfxStringItem aTarget( SID_TARGETNAME, "_blank" );
357 SfxStringItem aReferer( SID_REFERER, "private:user" );
358 SfxStringItem aFile( SID_FILE_NAME, pObjShell->GetMedium()->GetName() );
360 uno::Sequence< beans::NamedValue > aEncryptionData;
361 if ( GetEncryptionData_Impl( pObjShell->GetMedium()->GetItemSet(), aEncryptionData ) )
363 // there is a password, it should be used during the opening
364 SfxUnoAnyItem aEncryptionDataItem( SID_ENCRYPTIONDATA, uno::makeAny( aEncryptionData ) );
365 pViewFrame->GetDispatcher()->Execute(
366 SID_OPENDOC, SfxCallMode::ASYNCHRON, &aFile, &aItem, &aTarget, &aReferer, &aEncryptionDataItem, 0L );
368 else
369 pViewFrame->GetDispatcher()->Execute(
370 SID_OPENDOC, SfxCallMode::ASYNCHRON, &aFile, &aItem, &aTarget, &aReferer, 0L );
372 Close();
375 IMPL_LINK_NOARG(SfxVersionDialog, DClickHdl_Impl)
377 Open_Impl();
378 return 0L;
381 IMPL_LINK_NOARG(SfxVersionDialog, SelectHdl_Impl)
383 bool bEnable = ( m_pVersionBox->FirstSelected() != NULL );
384 SfxObjectShell* pObjShell = pViewFrame->GetObjectShell();
385 m_pDeleteButton->Enable(bEnable && !pObjShell->IsReadOnly());
386 m_pOpenButton->Enable(bEnable);
387 m_pViewButton->Enable(bEnable);
389 const SfxPoolItem *pDummy=NULL;
390 SfxItemState eState = pViewFrame->GetDispatcher()->QueryState( SID_DOCUMENT_MERGE, pDummy );
391 eState = pViewFrame->GetDispatcher()->QueryState( SID_DOCUMENT_COMPARE, pDummy );
392 m_pCompareButton->Enable(bEnable && eState >= SfxItemState::DEFAULT);
394 return 0L;
397 IMPL_LINK( SfxVersionDialog, ButtonHdl_Impl, Button*, pButton )
399 SfxObjectShell *pObjShell = pViewFrame->GetObjectShell();
400 SvTreeListEntry *pEntry = m_pVersionBox->FirstSelected();
402 if (pButton == m_pSaveCheckBox)
404 m_bIsSaveVersionOnClose = m_pSaveCheckBox->IsChecked();
406 else if (pButton == m_pSaveButton)
408 SfxVersionInfo aInfo;
409 aInfo.aAuthor = SvtUserOptions().GetFullName();
410 VclPtrInstance< SfxViewVersionDialog_Impl > pDlg(this, aInfo, true);
411 short nRet = pDlg->Execute();
412 if ( nRet == RET_OK )
414 SfxStringItem aComment( SID_DOCINFO_COMMENTS, aInfo.aComment );
415 pObjShell->SetModified( true );
416 const SfxPoolItem* aItems[2];
417 aItems[0] = &aComment;
418 aItems[1] = NULL;
419 pViewFrame->GetBindings().ExecuteSynchron( SID_SAVEDOC, aItems, 0 );
420 m_pVersionBox->SetUpdateMode( false );
421 m_pVersionBox->Clear();
422 Init_Impl();
423 m_pVersionBox->SetUpdateMode( true );
426 if (pButton == m_pDeleteButton && pEntry)
428 pObjShell->GetMedium()->RemoveVersion_Impl( static_cast<SfxVersionInfo*>(pEntry->GetUserData())->aName );
429 pObjShell->SetModified( true );
430 m_pVersionBox->SetUpdateMode( false );
431 m_pVersionBox->Clear();
432 Init_Impl();
433 m_pVersionBox->SetUpdateMode( true );
435 else if (pButton == m_pOpenButton && pEntry)
437 Open_Impl();
439 else if (pButton == m_pViewButton && pEntry)
441 SfxVersionInfo* pInfo = static_cast<SfxVersionInfo*>(pEntry->GetUserData());
442 VclPtrInstance<SfxViewVersionDialog_Impl> pDlg(this, *pInfo, false);
443 pDlg->Execute();
445 else if (pEntry && pButton == m_pCompareButton)
447 SfxAllItemSet aSet( pObjShell->GetPool() );
448 sal_uIntPtr nPos = SvTreeList::GetRelPos( pEntry );
449 aSet.Put( SfxInt16Item( SID_VERSION, (short)nPos+1 ) );
450 aSet.Put( SfxStringItem( SID_FILE_NAME, pObjShell->GetMedium()->GetName() ) );
452 SfxItemSet* pSet = pObjShell->GetMedium()->GetItemSet();
453 SFX_ITEMSET_ARG( pSet, pFilterItem, SfxStringItem, SID_FILTER_NAME, false );
454 SFX_ITEMSET_ARG( pSet, pFilterOptItem, SfxStringItem, SID_FILE_FILTEROPTIONS, false );
455 if ( pFilterItem )
456 aSet.Put( *pFilterItem );
457 if ( pFilterOptItem )
458 aSet.Put( *pFilterOptItem );
460 pViewFrame->GetDispatcher()->Execute( SID_DOCUMENT_COMPARE, SfxCallMode::ASYNCHRON, aSet );
461 Close();
463 else if (pButton == m_pCmisButton)
465 VclPtrInstance< SfxCmisVersionsDialog > pDlg(pViewFrame, false);
466 pDlg->Execute();
469 return 0L;
472 SfxViewVersionDialog_Impl::SfxViewVersionDialog_Impl(vcl::Window *pParent, SfxVersionInfo& rInfo, bool bEdit)
473 : SfxModalDialog(pParent, "VersionCommentDialog", "sfx/ui/versioncommentdialog.ui")
474 , m_rInfo(rInfo)
476 get(m_pDateTimeText, "timestamp");
477 get(m_pSavedByText, "author");
478 get(m_pEdit, "textview");
479 get(m_pOKButton, "ok");
480 get(m_pCancelButton, "cancel");
481 get(m_pCloseButton, "close");
483 OUString sAuthor = rInfo.aAuthor.isEmpty() ? SfxResId(STR_NO_NAME_SET) : rInfo.aAuthor;
485 const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() );
486 m_pDateTimeText->SetText(m_pDateTimeText->GetText() + formatTime(rInfo.aCreationDate, rLocaleWrapper));
487 m_pSavedByText->SetText(m_pSavedByText->GetText() + sAuthor);
488 m_pEdit->SetText(rInfo.aComment);
489 m_pEdit->set_height_request(7 * m_pEdit->GetTextHeight());
490 m_pEdit->set_width_request(40 * m_pEdit->approximate_char_width());
491 m_pOKButton->SetClickHdl(LINK(this, SfxViewVersionDialog_Impl, ButtonHdl));
493 if (!bEdit)
495 m_pOKButton->Hide();
496 m_pCancelButton->Hide();
497 m_pEdit->SetReadOnly(true);
498 SetText(SfxResId(STR_VIEWVERSIONCOMMENT));
499 m_pCloseButton->GrabFocus();
501 else
503 m_pDateTimeText->Hide();
504 m_pCloseButton->Hide();
505 m_pEdit->GrabFocus();
509 SfxViewVersionDialog_Impl::~SfxViewVersionDialog_Impl()
511 disposeOnce();
514 void SfxViewVersionDialog_Impl::dispose()
516 m_pDateTimeText.clear();
517 m_pSavedByText.clear();
518 m_pEdit.clear();
519 m_pOKButton.clear();
520 m_pCancelButton.clear();
521 m_pCloseButton.clear();
522 SfxModalDialog::dispose();
525 IMPL_LINK(SfxViewVersionDialog_Impl, ButtonHdl, Button*, pButton)
527 assert(pButton == m_pOKButton);
528 (void)pButton;
529 m_rInfo.aComment = m_pEdit->GetText();
530 EndDialog(RET_OK);
531 return 0L;
534 SfxCmisVersionsDialog::SfxCmisVersionsDialog ( SfxViewFrame* pVwFrame, bool bIsSaveVersionOnClose )
535 : SfxModalDialog(NULL, "VersionsCmisDialog", "sfx/ui/versionscmis.ui")
536 , pViewFrame(pVwFrame)
537 , m_pTable(NULL)
538 , m_bIsSaveVersionOnClose(bIsSaveVersionOnClose)
540 get(m_pOpenButton, "open");
541 get(m_pViewButton, "show");
542 get(m_pDeleteButton, "delete");
543 get(m_pCompareButton, "compare");
545 SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("versions");
546 Size aControlSize(260, 114);
547 aControlSize = pContainer->LogicToPixel(aControlSize, MAP_APPFONT);
548 pContainer->set_width_request(aControlSize.Width());
549 pContainer->set_height_request(aControlSize.Height());
551 m_pVersionBox = VclPtr<SfxVersionsTabListBox_Impl>::Create(*pContainer, WB_TABSTOP);
553 m_pVersionBox->GrabFocus();
554 m_pVersionBox->SetStyle( m_pVersionBox->GetStyle() | WB_HSCROLL | WB_CLIPCHILDREN );
555 m_pVersionBox->SetSelectionMode( SINGLE_SELECTION );
557 long nTabs_Impl[] = { 3, 0, 0, 0 };
559 m_pVersionBox->SvSimpleTable::SetTabs(&nTabs_Impl[0]);
560 OUString sHeader1(get<FixedText>("datetime")->GetText());
561 OUString sHeader2(get<FixedText>("savedby")->GetText());
562 OUString sHeader3(get<FixedText>("comments")->GetText());
563 OUStringBuffer sHeader;
564 sHeader.append(sHeader1).append("\t").append(sHeader2)
565 .append("\t ").append(sHeader3);
566 m_pVersionBox->InsertHeaderEntry(sHeader.makeStringAndClear());
568 HeaderBar &rBar = m_pVersionBox->GetTheHeaderBar();
569 HeaderBarItemBits nBits = rBar.GetItemBits(1) | HeaderBarItemBits::FIXEDPOS | HeaderBarItemBits::FIXED;
570 nBits &= ~HeaderBarItemBits::CLICKABLE;
571 rBar.SetItemBits(1, nBits);
572 rBar.SetItemBits(2, nBits);
573 rBar.SetItemBits(3, nBits);
575 m_pVersionBox->Resize();
577 OUString sText = GetText();
578 sText = sText + " " + pViewFrame->GetObjectShell()->GetTitle();
579 SetText( sText );
581 LoadVersions();
583 m_pVersionBox->setColSizes();
587 SfxCmisVersionsDialog::~SfxCmisVersionsDialog()
589 disposeOnce();
592 void SfxCmisVersionsDialog::dispose()
594 delete m_pTable;
595 m_pVersionBox.disposeAndClear();
596 m_pOpenButton.clear();
597 m_pViewButton.clear();
598 m_pDeleteButton.clear();
599 m_pCompareButton.clear();
600 SfxModalDialog::dispose();
603 void SfxCmisVersionsDialog::LoadVersions()
605 SfxObjectShell *pObjShell = pViewFrame->GetObjectShell();
606 uno::Sequence < document::CmisVersion > aVersions = pObjShell->GetCmisVersions( );
607 delete m_pTable;
608 m_pTable = new SfxVersionTableDtor( aVersions );
610 for ( size_t n = 0; n < m_pTable->size(); ++n )
612 SfxVersionInfo *pInfo = m_pTable->at( n );
613 OUString aEntry = formatTime(pInfo->aCreationDate, Application::GetSettings().GetLocaleDataWrapper());
614 aEntry += "\t";
615 aEntry += pInfo->aAuthor;
616 aEntry += "\t";
617 aEntry += ConvertWhiteSpaces_Impl( pInfo->aComment );
618 SvTreeListEntry *pEntry = m_pVersionBox->InsertEntry( aEntry );
619 pEntry->SetUserData( pInfo );
625 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */