[Libreoffice-commits] .: 2 commits - libcmis/libcmis-0.3.0.patch libcmis/UnpackedTarball_cmis.mk sfx2/inc sfx2/Library_sfx.mk sfx2/source sfx2/uiconfig sfx2/UI_sfx.mk
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Nov 7 06:22:48 PST 2012
libcmis/UnpackedTarball_cmis.mk | 1
libcmis/libcmis-0.3.0.patch | 22 ++++++
sfx2/Library_sfx.mk | 1
sfx2/UI_sfx.mk | 1
sfx2/inc/sfx2/checkin.hxx | 35 ++++++++++
sfx2/source/dialog/checkin.cxx | 39 +++++++++++
sfx2/source/doc/objserv.cxx | 20 +++---
sfx2/uiconfig/ui/checkin.ui | 132 ++++++++++++++++++++++++++++++++++++++++
8 files changed, 243 insertions(+), 8 deletions(-)
New commits:
commit 207ed1b1a17ca6d785cad936ecadcd160acc2b83
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Wed Nov 7 15:18:59 2012 +0100
CMIS: added CheckIn dialog
Change-Id: Iba938986478b880b7026285f607972a2e4d72283
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index eae3511..8a12ad9 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -147,6 +147,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/control/unoctitm \
sfx2/source/dialog/alienwarn \
sfx2/source/dialog/basedlgs \
+ sfx2/source/dialog/checkin \
sfx2/source/dialog/dinfdlg \
sfx2/source/dialog/dinfedt \
sfx2/source/dialog/dockwin \
diff --git a/sfx2/UI_sfx.mk b/sfx2/UI_sfx.mk
index a084da1..c164884 100644
--- a/sfx2/UI_sfx.mk
+++ b/sfx2/UI_sfx.mk
@@ -10,6 +10,7 @@
$(eval $(call gb_UI_UI,sfx))
$(eval $(call gb_UI_add_uifiles,sfx,\
+ sfx2/uiconfig/ui/checkin \
sfx2/uiconfig/ui/password \
))
diff --git a/sfx2/inc/sfx2/checkin.hxx b/sfx2/inc/sfx2/checkin.hxx
new file mode 100644
index 0000000..65aa2e7
--- /dev/null
+++ b/sfx2/inc/sfx2/checkin.hxx
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+#ifndef _SFX_CHECKIN_HXX
+#define _SFX_CHECKIN_HXX
+
+#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/edit.hxx>
+
+class SfxCheckinDialog : public ModalDialog
+{
+ private:
+ Edit* m_pCommentED;
+ CheckBox* m_pMajorCB;
+
+ OKButton* m_pOKBtn;
+
+ DECL_DLLPRIVATE_LINK(OKHdl, void *);
+
+ public:
+ SfxCheckinDialog( Window* pParent );
+
+ rtl::OUString GetComment( );
+ bool IsMajor( );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/checkin.cxx b/sfx2/source/dialog/checkin.cxx
new file mode 100644
index 0000000..a2bac25
--- /dev/null
+++ b/sfx2/source/dialog/checkin.cxx
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#include <sfx2/checkin.hxx>
+#include <vcl/msgbox.hxx>
+
+SfxCheckinDialog::SfxCheckinDialog( Window* pParent ) :
+ ModalDialog( pParent, "CheckinDialog", "sfx/ui/checkin.ui" )
+{
+ get( m_pCommentED, "VersionComment" );
+ get( m_pMajorCB, "MajorVersion" );
+
+ get( m_pOKBtn, "ok" );
+ m_pOKBtn->SetClickHdl( LINK( this, SfxCheckinDialog, OKHdl ) );
+}
+
+rtl::OUString SfxCheckinDialog::GetComment( )
+{
+ return m_pCommentED->GetText( );
+}
+
+bool SfxCheckinDialog::IsMajor( )
+{
+ return m_pMajorCB->IsChecked( );
+}
+
+IMPL_LINK_NOARG( SfxCheckinDialog, OKHdl )
+{
+ EndDialog( RET_OK );
+ return 0;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 490a72b..2412dcc 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -87,6 +87,7 @@
#include "sfx2/sfxhelp.hxx"
#include <sfx2/msgpool.hxx>
#include <sfx2/objface.hxx>
+#include <sfx2/checkin.hxx>
#include "../appl/app.hrc"
#include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
@@ -366,7 +367,6 @@ void SfxObjectShell::CancelCheckOut( )
try
{
uno::Reference< document::XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY_THROW );
- // TODO Pop up dialog to ask whether to loose data or not
xCmisDoc->cancelCheckOut( );
}
catch ( const uno::RuntimeException& e )
@@ -382,13 +382,17 @@ void SfxObjectShell::CheckIn( )
try
{
uno::Reference< document::XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY_THROW );
- sal_Bool bIsMajor = sal_False;
- rtl::OUString sComment( "Some sample comment" );
- // TODO Pop up dialog to ask for comment and major
- xCmisDoc->checkIn( bIsMajor, sComment );
- uno::Reference< util::XModifiable > xModifiable( GetModel( ), uno::UNO_QUERY );
- if ( xModifiable.is( ) )
- xModifiable->setModified( sal_False );
+ // Pop up dialog to ask for comment and major
+ SfxCheckinDialog checkinDlg( &GetFrame( )->GetWindow( ) );
+ if ( checkinDlg.Execute( ) == RET_OK )
+ {
+ rtl::OUString sComment = checkinDlg.GetComment( );
+ sal_Bool bMajor = checkinDlg.IsMajor( );
+ xCmisDoc->checkIn( bMajor, sComment );
+ uno::Reference< util::XModifiable > xModifiable( GetModel( ), uno::UNO_QUERY );
+ if ( xModifiable.is( ) )
+ xModifiable->setModified( sal_False );
+ }
}
catch ( const uno::RuntimeException& e )
{
diff --git a/sfx2/uiconfig/ui/checkin.ui b/sfx2/uiconfig/ui/checkin.ui
new file mode 100644
index 0000000..c97657d
--- /dev/null
+++ b/sfx2/uiconfig/ui/checkin.ui
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="CheckinDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Check-in</property>
+ <property name="modal">True</property>
+ <property name="window_position">center-on-parent</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="ypad">8</property>
+ <property name="label" translatable="yes">Version comment</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkTextView" id="VersionComment">
+ <property name="width_request">300</property>
+ <property name="height_request">150</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="wrap_mode">word</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="MajorVersion">
+ <property name="label" translatable="yes">New major version</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">cancel</action-widget>
+ <action-widget response="0">ok</action-widget>
+ </action-widgets>
+ </object>
+</interface>
commit b7686e41f1bbf655a4e3a5f142a5520faecfa6bc
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Wed Nov 7 14:00:15 2012 +0100
CMIS: fixed <wsse:Expires> output: c_str() on a temp string object isn't good
Change-Id: I7de9dd2372cd7b61a3bc03bdca0023a3bc7484bd
diff --git a/libcmis/UnpackedTarball_cmis.mk b/libcmis/UnpackedTarball_cmis.mk
index 8739aa7..ce10efe 100644
--- a/libcmis/UnpackedTarball_cmis.mk
+++ b/libcmis/UnpackedTarball_cmis.mk
@@ -16,6 +16,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,cmis,0))
$(eval $(call gb_UnpackedTarball_add_patches,cmis, \
libcmis/libcmis-0.3.0-warnings.patch \
libcmis/libcmis-0.3.0-win.patch \
+ libcmis/libcmis-0.3.0.patch \
))
ifeq ($(OS)$(COM),WNTMSC)
diff --git a/libcmis/libcmis-0.3.0.patch b/libcmis/libcmis-0.3.0.patch
new file mode 100644
index 0000000..d9dc70f
--- /dev/null
+++ b/libcmis/libcmis-0.3.0.patch
@@ -0,0 +1,22 @@
+diff --git src/libcmis/ws-soap.cxx src/libcmis/ws-soap.cxx
+index e8efd67..decb79a 100644
+--- src/libcmis/ws-soap.cxx
++++ src/libcmis/ws-soap.cxx
+@@ -279,7 +279,7 @@ string SoapRequest::createEnvelope( string& username, string& password )
+ boost::posix_time::ptime expires( created );
+ expires = expires + boost::gregorian::days( 1 );
+ string createdStr = libcmis::writeDateTime( created );
+- xmlChar* expiresStr = BAD_CAST( libcmis::writeDateTime( expires ).c_str( ) );
++ string expiresStr = libcmis::writeDateTime( expires );
+
+ xmlTextWriterStartElement( writer, BAD_CAST( "S:Envelope" ) );
+ xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:S" ), BAD_CAST( NS_SOAP_ENV_URL ) );
+@@ -296,7 +296,7 @@ string SoapRequest::createEnvelope( string& username, string& password )
+ xmlTextWriterWriteRaw( writer, BAD_CAST( createdStr.c_str( ) ) );
+ xmlTextWriterEndElement( writer ); // End of Created
+ xmlTextWriterStartElement( writer, BAD_CAST( "wsse:Expires" ) );
+- xmlTextWriterWriteRaw( writer, expiresStr );
++ xmlTextWriterWriteRaw( writer, BAD_CAST( expiresStr.c_str() ) );
+ xmlTextWriterEndElement( writer ); // End of Expires
+ xmlTextWriterEndElement( writer ); // End of Timestamp
+
More information about the Libreoffice-commits
mailing list