[API CHANGE] remove MacroMigrationWizard

https://wiki.openoffice.org/wiki/Macros_in_Database_Documents

Prior to OpenOffice 3 (2008) base didn't support macros, but
subdocuments might have had macros. since OOo3 base supported macros
and subdocuments not, and a migration wizard is available to update
pre OOo3 documents to the new scheme.

Here I presume whatever is going to get migrated has been migrated
at this point and drop the migration wizard

This undoes the addition of the idl for
sdb::application::MacroMigrationWizard of

commit 5b982b6936
Date:   Mon Mar 11 17:51:56 2013 +0200

so flag as an api change, though not to anything published

Change-Id: I37271752234dda4e7e8f033e0136825fd356439b
Reviewed-on: https://gerrit.libreoffice.org/78326
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2019-08-31 15:07:47 +02:00
parent 6cc5baa0a1
commit 0e944350e9
44 changed files with 0 additions and 5857 deletions
-1
View File
@@ -352,7 +352,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
$(call gb_Helper_optional,DBCONNECTIVITY, \
dba \
dbase \
dbmm \
dbaxml \
dbahsql) \
dbtools \
-1
View File
@@ -65,7 +65,6 @@ DEFAULTS = \
'cui.cui' : ( 8, EXCLUDE, INCLUDE, EXCLUDE), # 19.7
'dbaccess.dba' : ( 6, EXCLUDE, INCLUDE, INCLUDE), # 13.8
'dbaccess.dbaxml' : ( 2, EXCLUDE, EXCLUDE, EXCLUDE), # 6.5
'dbaccess.dbmm' : (10, EXCLUDE, INCLUDE, EXCLUDE), # 4.3
'dbaccess.dbu' : (12, EXCLUDE, EXCLUDE, EXCLUDE), # 23.6
'dbaccess.sdbt' : ( 1, EXCLUDE, INCLUDE, EXCLUDE), # 2.9
'desktop.deployment' : ( 3, EXCLUDE, EXCLUDE, EXCLUDE), # 6.1
-56
View File
@@ -1,56 +0,0 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# 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/.
#
$(eval $(call gb_Library_Library,dbmm))
$(eval $(call gb_Library_set_include,dbmm,\
$$(INCLUDE) \
-I$(SRCDIR)/dbaccess/inc \
))
$(eval $(call gb_Library_use_external,dbmm,boost_headers))
$(eval $(call gb_Library_set_precompiled_header,dbmm,$(SRCDIR)/dbaccess/inc/pch/precompiled_dbmm))
$(eval $(call gb_Library_use_sdk_api,dbmm))
$(eval $(call gb_Library_use_libraries,dbmm,\
comphelper \
cppu \
cppuhelper \
dba \
sal \
svl \
svt \
svxcore \
svx \
tl \
tk \
ucbhelper \
utl \
vcl \
xmlscript \
))
$(eval $(call gb_Library_set_componentfile,dbmm,dbaccess/source/ext/macromigration/dbmm))
$(eval $(call gb_Library_add_exception_objects,dbmm,\
dbaccess/source/ext/macromigration/dbmm_services \
dbaccess/source/ext/macromigration/dbmm_types \
dbaccess/source/ext/macromigration/docinteraction \
dbaccess/source/ext/macromigration/macromigrationdialog \
dbaccess/source/ext/macromigration/macromigrationpages \
dbaccess/source/ext/macromigration/macromigrationwizard \
dbaccess/source/ext/macromigration/migrationengine \
dbaccess/source/ext/macromigration/migrationlog \
dbaccess/source/ext/macromigration/progresscapture \
dbaccess/source/ext/macromigration/progressmixer \
))
# vim: set noet sw=4 ts=4:
-1
View File
@@ -15,7 +15,6 @@ $(eval $(call gb_Module_add_targets,dbaccess,\
$(if $(filter WNT,$(OS)),Executable_odbcconfig) \
Library_dba \
Library_dbaxml \
Library_dbmm \
Library_dbu \
Library_sdbt \
Library_dbahsql \
-4
View File
@@ -15,7 +15,6 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \
dbaccess/uiconfig/ui/applycolpage \
dbaccess/uiconfig/ui/authentificationpage \
dbaccess/uiconfig/ui/autocharsetpage \
dbaccess/uiconfig/ui/backuppage \
dbaccess/uiconfig/ui/choosedatasourcedialog \
dbaccess/uiconfig/ui/collectionviewdialog \
dbaccess/uiconfig/ui/colwidthdialog \
@@ -46,14 +45,12 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \
dbaccess/uiconfig/ui/keymenu \
dbaccess/uiconfig/ui/ldapconnectionpage \
dbaccess/uiconfig/ui/ldappage \
dbaccess/uiconfig/ui/migratepage \
dbaccess/uiconfig/ui/mysqlnativepage \
dbaccess/uiconfig/ui/mysqlnativesettings \
dbaccess/uiconfig/ui/namematchingpage \
dbaccess/uiconfig/ui/odbcpage \
dbaccess/uiconfig/ui/parametersdialog \
dbaccess/uiconfig/ui/password \
dbaccess/uiconfig/ui/preparepage \
dbaccess/uiconfig/ui/querycolmenu \
dbaccess/uiconfig/ui/queryfilterdialog \
dbaccess/uiconfig/ui/queryfuncmenu \
@@ -68,7 +65,6 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \
dbaccess/uiconfig/ui/specialsettingspage \
dbaccess/uiconfig/ui/sortdialog \
dbaccess/uiconfig/ui/sqlexception \
dbaccess/uiconfig/ui/summarypage \
dbaccess/uiconfig/ui/tabledesignrowmenu \
dbaccess/uiconfig/ui/tabledesignsavemodifieddialog \
dbaccess/uiconfig/ui/tablesfilterdialog \
-12
View File
@@ -1,12 +0,0 @@
/* -*- 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 "precompiled_dbmm.hxx"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-105
View File
@@ -1,105 +0,0 @@
/* -*- 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/.
*/
/*
This file has been autogenerated by update_pch.sh. It is possible to edit it
manually (such as when an include file has been moved/renamed/removed). All such
manual changes will be rewritten by the next run of update_pch.sh (which presumably
also fixes all possible problems, so it's usually better to use it).
Generated on 2019-05-12 16:56:51 using:
./bin/update_pch dbaccess dbmm --cutoff=10 --exclude:system --include:module --exclude:local
If after updating build fails, use the following command to locate conflicting headers:
./bin/update_pch_bisect ./dbaccess/inc/pch/precompiled_dbmm.hxx "make dbaccess.build" --find-conflicts
*/
#if PCH_LEVEL >= 1
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstring>
#include <functional>
#include <iomanip>
#include <limits.h>
#include <limits>
#include <math.h>
#include <memory>
#include <new>
#include <ostream>
#include <stddef.h>
#include <string.h>
#include <type_traits>
#include <utility>
#include <vector>
#endif // PCH_LEVEL >= 1
#if PCH_LEVEL >= 2
#include <osl/diagnose.h>
#include <osl/endian.h>
#include <osl/interlck.h>
#include <osl/mutex.h>
#include <osl/thread.h>
#include <rtl/alloc.h>
#include <rtl/math.h>
#include <rtl/math.hxx>
#include <rtl/ref.hxx>
#include <rtl/strbuf.h>
#include <rtl/strbuf.hxx>
#include <rtl/string.h>
#include <rtl/string.hxx>
#include <rtl/stringutils.hxx>
#include <rtl/textcvt.h>
#include <rtl/textenc.h>
#include <rtl/unload.h>
#include <rtl/ustrbuf.h>
#include <rtl/ustrbuf.hxx>
#include <rtl/ustring.h>
#include <rtl/ustring.hxx>
#include <sal/config.h>
#include <sal/macros.h>
#include <sal/mathconf.h>
#include <sal/saldllapi.h>
#include <sal/types.h>
#include <sal/typesizes.h>
#include <vcl/dllapi.h>
#endif // PCH_LEVEL >= 2
#if PCH_LEVEL >= 3
#include <basegfx/basegfxdllapi.h>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/tuple/b2dtuple.hxx>
#include <basegfx/tuple/b2ituple.hxx>
#include <basegfx/vector/b2enums.hxx>
#include <com/sun/star/uno/Any.h>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/Type.h>
#include <com/sun/star/uno/Type.hxx>
#include <com/sun/star/uno/TypeClass.hdl>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uno/genfunc.h>
#include <com/sun/star/uno/genfunc.hxx>
#include <cppu/cppudllapi.h>
#include <cppu/unotype.hxx>
#include <o3tl/cow_wrapper.hxx>
#include <o3tl/typed_flags_set.hxx>
#include <o3tl/underlyingenumvalue.hxx>
#include <tools/gen.hxx>
#include <tools/toolsdllapi.h>
#include <typelib/typeclass.h>
#include <typelib/typedescription.h>
#include <typelib/uik.h>
#include <uno/any2.h>
#include <uno/data.h>
#include <uno/sequence2.h>
#endif // PCH_LEVEL >= 3
#if PCH_LEVEL >= 4
#endif // PCH_LEVEL >= 4
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
* 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 .
-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="dbmm" xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.dbaccess.macromigration.MacroMigrationDialogService">
<service name="com.sun.star.sdb.application.MacroMigrationWizard"/>
</implementation>
</component>
@@ -1,41 +0,0 @@
/* -*- 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/.
*
* 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 <cppuhelper/factory.hxx>
#include "macromigrationwizard.hxx"
extern "C" SAL_DLLPUBLIC_EXPORT void* dbmm_component_getFactory(
const sal_Char* pImplementationName, SAL_UNUSED_PARAMETER void*,
SAL_UNUSED_PARAMETER void* )
{
css::uno::Reference<css::uno::XInterface> xRet;
if (dbmm::MacroMigrationDialogService::getImplementationName_static() == OUString::createFromAscii(pImplementationName))
{
xRet = ::cppu::createSingleComponentFactory(dbmm::MacroMigrationDialogService::Create,
dbmm::MacroMigrationDialogService::getImplementationName_static(),
dbmm::MacroMigrationDialogService::getSupportedServiceNames_static(), nullptr);
}
if (xRet.is())
xRet->acquire();
return xRet.get();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,48 +0,0 @@
/* -*- 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/.
*
* 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 <osl/diagnose.h>
#include <core_resource.hxx>
#include "dbmm_types.hxx"
#include <strings.hrc>
namespace dbmm
{
// helper
OUString getScriptTypeDisplayName( const ScriptType _eType )
{
const char *pResId = nullptr;
switch ( _eType )
{
case eBasic: pResId = STR_OOO_BASIC; break;
case eBeanShell: pResId = STR_BEAN_SHELL; break;
case eJavaScript: pResId = STR_JAVA_SCRIPT; break;
case ePython: pResId = STR_PYTHON; break;
case eJava: pResId = STR_JAVA; break;
case eDialog: pResId = STR_DIALOG; break;
}
OSL_ENSURE( pResId != nullptr, "getScriptTypeDisplayName: illegal script type!" );
return pResId ? DBA_RES(pResId) : OUString();
}
} // namespace dbmm
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,53 +0,0 @@
/* -*- 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/.
*
* 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 .
*/
#ifndef INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_DBMM_TYPES_HXX
#define INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_DBMM_TYPES_HXX
#include <rtl/ustring.hxx>
namespace dbmm
{
// ScriptType
enum ScriptType
{
eBasic,
eBeanShell,
eJavaScript,
ePython,
eJava,
eDialog
};
// SubDocumentType
enum SubDocumentType
{
eForm,
eReport
};
// helper
OUString getScriptTypeDisplayName( const ScriptType _eType );
} // namespace dbmm
#endif // INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_DBMM_TYPES_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,108 +0,0 @@
/* -*- 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/.
*
* 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 "docinteraction.hxx"
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/task/InteractionHandler.hpp>
#include <com/sun/star/task/DocumentPasswordRequest.hpp>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/interaction.hxx>
#include <rtl/ref.hxx>
#include <tools/diagnose_ex.h>
namespace dbmm
{
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::makeAny;
using ::com::sun::star::uno::XComponentContext;
using ::com::sun::star::task::XInteractionHandler;
using ::com::sun::star::frame::XModel;
using ::com::sun::star::task::DocumentPasswordRequest;
using ::com::sun::star::task::InteractionClassification_QUERY;
using ::com::sun::star::task::PasswordRequestMode_PASSWORD_ENTER;
using ::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER;
// InteractionHandler_Data
struct InteractionHandler_Data
{
Reference< XInteractionHandler > xHandler;
explicit InteractionHandler_Data( const Reference<XComponentContext>& _rContext )
:xHandler( css::task::InteractionHandler::createWithParent(_rContext, nullptr) )
{
}
};
// InteractionHandler
InteractionHandler::InteractionHandler( const Reference<XComponentContext>& _rContext, const Reference< XModel >& _rxDocument )
:m_pData( new InteractionHandler_Data( _rContext ) )
{
// check whether the document has its own interaction handler set
::comphelper::NamedValueCollection aDocArgs( _rxDocument->getArgs() );
m_pData->xHandler = aDocArgs.getOrDefault( "InteractionHandler", m_pData->xHandler );
}
InteractionHandler::~InteractionHandler()
{
}
bool InteractionHandler::requestDocumentPassword( const OUString& _rDocumentName, OUString& _io_rPassword )
{
// create request
DocumentPasswordRequest aRequest(
OUString(), nullptr,
InteractionClassification_QUERY,
_io_rPassword.isEmpty() ? PasswordRequestMode_PASSWORD_ENTER : PasswordRequestMode_PASSWORD_REENTER,
_rDocumentName
);
::rtl::Reference pRequest( new ::comphelper::OInteractionRequest( makeAny( aRequest ) ) );
::rtl::Reference pPassword( new ::comphelper::OInteractionPassword( _io_rPassword ) );
::rtl::Reference pAbort( new ::comphelper::OInteractionAbort );
pRequest->addContinuation( pPassword.get() );
pRequest->addContinuation( pAbort.get() );
// handle
m_pData->xHandler->handle( pRequest.get() );
// finish up
if ( pAbort->wasSelected() )
return false;
_io_rPassword = pPassword->getPassword();
return true;
}
void InteractionHandler::reportError( const Any& _rError )
{
::rtl::Reference pRequest( new ::comphelper::OInteractionRequest( _rError ) );
::rtl::Reference pApprove( new ::comphelper::OInteractionApprove );
pRequest->addContinuation( pApprove.get() );
m_pData->xHandler->handle( pRequest.get() );
}
} // namespace dbmm
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,80 +0,0 @@
/* -*- 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/.
*
* 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 .
*/
#ifndef INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_DOCINTERACTION_HXX
#define INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_DOCINTERACTION_HXX
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <memory>
namespace dbmm
{
// DocumentErrorHandling
struct InteractionHandler_Data;
/** wraps common operations with an interaction handler.
*/
class InteractionHandler
{
public:
/** creates an interaction handler by instantiating a css.task.InteractionHandler
component at the given component context, or using the given document's interaction handler,
if one is specified in the document's media descriptor.
*/
InteractionHandler(
const css::uno::Reference< css::uno::XComponentContext >& _rContext,
const css::uno::Reference< css::frame::XModel >& _rxDocument );
/** destructor
*/
~InteractionHandler();
/** requests a document password
@param _rDocumentName
the document name
@param _io_rPassword
the initial password on method entry, the password as entered by the user on method leave
@return
<TRUE/> if and only if the user entered a password, and confirmed with OK, <FALSE/>
if the user aborted the request.
*/
bool requestDocumentPassword(
const OUString& _rDocumentName,
OUString& _io_rPassword
);
/** reports the given error (usually an exception caught on the caller's side)
to the user
*/
void reportError(
const css::uno::Any& _rError
);
private:
std::unique_ptr< InteractionHandler_Data > m_pData;
};
} // namespace dbmm
#endif // INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_DOCINTERACTION_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,556 +0,0 @@
/* -*- 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/.
*
* 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 "docinteraction.hxx"
#include <core_resource.hxx>
#include <strings.hrc>
#include "macromigrationdialog.hxx"
#include "macromigrationpages.hxx"
#include "migrationengine.hxx"
#include "migrationerror.hxx"
#include "migrationlog.hxx"
#include <com/sun/star/sdb/application/XDatabaseDocumentUI.hpp>
#include <com/sun/star/frame/XModel2.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/util/CloseVetoException.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/ucb/UniversalContentBroker.hpp>
#include <com/sun/star/ucb/XContent.hpp>
#include <comphelper/namedvaluecollection.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <rtl/ref.hxx>
#include <svl/filenotation.hxx>
#include <tools/diagnose_ex.h>
#include <ucbhelper/content.hxx>
#include <vcl/weld.hxx>
#include <vcl/svapp.hxx>
#include <vector>
namespace dbmm
{
#define STATE_CLOSE_SUB_DOCS 0
#define STATE_BACKUP_DBDOC 1
#define STATE_MIGRATE 2
#define STATE_SUMMARY 3
#define PATH_DEFAULT 1
// height and width of tab pages
#define TAB_PAGE_WIDTH 280
#define TAB_PAGE_HEIGHT 185
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::XComponentContext;
using ::com::sun::star::uno::XInterface;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::UNO_QUERY_THROW;
using ::com::sun::star::uno::UNO_SET_THROW;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::Any;
using ::com::sun::star::sdb::application::XDatabaseDocumentUI;
using ::com::sun::star::sdb::XOfficeDatabaseDocument;
using ::com::sun::star::frame::XModel2;
using ::com::sun::star::frame::XController2;
using ::com::sun::star::container::XEnumeration;
using ::com::sun::star::frame::XStorable;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::beans::PropertyValue;
using ::com::sun::star::frame::XFrame;
using ::com::sun::star::util::XCloseable;
using ::com::sun::star::util::CloseVetoException;
using ::com::sun::star::frame::XComponentLoader;
using ::com::sun::star::util::XModifiable;
using ::com::sun::star::ucb::UniversalContentBroker;
using ::com::sun::star::ucb::XCommandEnvironment;
using ::com::sun::star::ucb::XContent;
using ::com::sun::star::ucb::XContentIdentifier;
// helper
static void lcl_getControllers_throw(const Reference< XModel2 >& _rxDocument,
std::vector< Reference< XController2 > >& _out_rControllers )
{
_out_rControllers.clear();
Reference< XEnumeration > xControllerEnum( _rxDocument->getControllers(), UNO_SET_THROW );
while ( xControllerEnum->hasMoreElements() )
_out_rControllers.emplace_back( xControllerEnum->nextElement(), UNO_QUERY_THROW );
}
// MacroMigrationDialog_Data
struct MacroMigrationDialog_Data
{
Reference<XComponentContext> aContext;
MigrationLog aLogger;
Reference< XOfficeDatabaseDocument > xDocument;
Reference< XModel2 > xDocumentModel;
OUString sSuccessfulBackupLocation;
bool bMigrationIsRunning;
bool bMigrationFailure;
bool bMigrationSuccess;
MacroMigrationDialog_Data(
const Reference<XComponentContext>& _rContext,
const Reference< XOfficeDatabaseDocument >& _rxDocument )
:aContext( _rContext )
,aLogger()
,xDocument( _rxDocument )
,xDocumentModel( _rxDocument, UNO_QUERY )
,bMigrationIsRunning( false )
,bMigrationFailure( false )
,bMigrationSuccess( false )
{
}
};
// MacroMigrationDialog
MacroMigrationDialog::MacroMigrationDialog(vcl::Window* _pParent, const Reference<XComponentContext>& _rContext,
const Reference< XOfficeDatabaseDocument >& _rxDocument)
: MacroMigrationDialog_Base(_pParent)
, m_pData( new MacroMigrationDialog_Data( _rContext, _rxDocument ) )
{
OUString sTitlePrepare( DBA_RES( STR_STATE_CLOSE_SUB_DOCS ) );
OUString sTitleStoreAs( DBA_RES( STR_STATE_BACKUP_DBDOC ) );
OUString sTitleMigrate( DBA_RES( STR_STATE_MIGRATE ) );
OUString sTitleSummary( DBA_RES( STR_STATE_SUMMARY ) );
describeState( STATE_CLOSE_SUB_DOCS, sTitlePrepare, &PreparationPage::Create );
describeState( STATE_BACKUP_DBDOC, sTitleStoreAs, &SaveDBDocPage::Create );
describeState( STATE_MIGRATE, sTitleMigrate, &ProgressPage::Create );
describeState( STATE_SUMMARY, sTitleSummary, &ResultPage::Create );
declarePath( PATH_DEFAULT, {STATE_CLOSE_SUB_DOCS, STATE_BACKUP_DBDOC, STATE_MIGRATE, STATE_SUMMARY} );
SetPageSizePixel(LogicToPixel(::Size(TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT), MapMode(MapUnit::MapAppFont)));
SetRoadmapInteractive( true );
enableAutomaticNextButtonState();
defaultButton( WizardButtonFlags::NEXT );
enableButtons( WizardButtonFlags::FINISH, true );
ActivatePage();
OSL_PRECOND( m_pData->xDocumentModel.is(), "MacroMigrationDialog::MacroMigrationDialog: illegal document!" );
}
const Reference<XComponentContext>& MacroMigrationDialog::getComponentContext() const
{
return m_pData->aContext;
}
const Reference< XOfficeDatabaseDocument >& MacroMigrationDialog::getDocument() const
{
return m_pData->xDocument;
}
short MacroMigrationDialog::Execute()
{
short nResult = MacroMigrationDialog_Base::Execute();
if ( !m_pData->bMigrationFailure && !m_pData->bMigrationSuccess )
// migration did not even start
return nResult;
OSL_ENSURE( !m_pData->bMigrationFailure || !m_pData->bMigrationSuccess,
"MacroMigrationDialog::Execute: success *and* failure at the same time?!" );
impl_reloadDocument_nothrow( m_pData->bMigrationSuccess );
return nResult;
}
bool MacroMigrationDialog::Close()
{
if ( m_pData->bMigrationIsRunning )
return false;
return MacroMigrationDialog_Base::Close();
}
void MacroMigrationDialog::enterState( WizardState _nState )
{
MacroMigrationDialog_Base::enterState( _nState );
switch ( _nState )
{
case STATE_CLOSE_SUB_DOCS:
enableButtons( WizardButtonFlags::FINISH, false );
enableState( STATE_MIGRATE, false );
enableState( STATE_SUMMARY, false );
break;
case STATE_BACKUP_DBDOC:
enableState( STATE_MIGRATE );
// Note that the state is automatically disabled if the current page
// (SaveDBDocPage) returns false in its canAdvance, not caring that
// we enabled it here.
break;
case STATE_MIGRATE:
{
// disable everything. The process we will start here cannot be cancelled, the user
// needs to wait 'til it's finished.
enableState( STATE_CLOSE_SUB_DOCS, false );
enableState( STATE_BACKUP_DBDOC, false );
enableState( STATE_SUMMARY, false );
enableButtons( WizardButtonFlags::FINISH | WizardButtonFlags::CANCEL | WizardButtonFlags::PREVIOUS | WizardButtonFlags::NEXT, false );
// start the migration asynchronously
PostUserEvent( LINK( this, MacroMigrationDialog, OnStartMigration ), nullptr, true );
}
break;
case STATE_SUMMARY:
// disable the previous step - we can't return to the actual migration, it already happened (or failed)
enableState( STATE_MIGRATE, false );
updateTravelUI();
// display the results
dynamic_cast< ResultPage& >( *GetPage( STATE_SUMMARY ) ).displayMigrationLog(
m_pData->bMigrationSuccess, m_pData->aLogger.getCompleteLog() );
enableButtons( WizardButtonFlags::FINISH, m_pData->bMigrationSuccess );
enableButtons( WizardButtonFlags::CANCEL, m_pData->bMigrationFailure );
defaultButton( m_pData->bMigrationSuccess ? WizardButtonFlags::FINISH : WizardButtonFlags::CANCEL );
break;
default:
OSL_FAIL( "MacroMigrationDialog::enterState: unhandled state!" );
}
}
bool MacroMigrationDialog::prepareLeaveCurrentState( CommitPageReason _eReason )
{
if ( !MacroMigrationDialog_Base::prepareLeaveCurrentState( _eReason ) )
return false;
switch ( getCurrentState() )
{
case STATE_CLOSE_SUB_DOCS:
if ( !impl_closeSubDocs_nothrow() )
return false;
break;
case STATE_BACKUP_DBDOC:
if ( !impl_backupDocument_nothrow() )
return false;
break;
case STATE_MIGRATE:
break;
case STATE_SUMMARY:
break;
default:
OSL_FAIL( "MacroMigrationDialog::prepareLeaveCurrentState: unhandled state!" );
}
return true;
}
IMPL_LINK_NOARG( MacroMigrationDialog, OnStartMigration, void*, void )
{
// prevent closing
m_pData->bMigrationIsRunning = true;
// initialize migration engine and progress
ProgressPage& rProgressPage( dynamic_cast< ProgressPage& >( *GetPage( STATE_MIGRATE ) ) );
MigrationEngine aEngine( m_pData->aContext, m_pData->xDocument, rProgressPage, m_pData->aLogger );
rProgressPage.setDocumentCounts( aEngine.getFormCount(), aEngine.getReportCount() );
// do the migration
m_pData->bMigrationSuccess = aEngine.migrateAll();
m_pData->bMigrationFailure = !m_pData->bMigrationSuccess;
// re-enable the UI
enableButtons( WizardButtonFlags::FINISH | WizardButtonFlags::NEXT, true );
enableState( STATE_SUMMARY );
updateTravelUI();
m_pData->bMigrationIsRunning = false;
if ( m_pData->bMigrationSuccess )
{
rProgressPage.onFinishedSuccessfully();
}
else
{ // if there was an error, show the summary automatically
travelNext();
}
}
void MacroMigrationDialog::impl_showCloseDocsError( bool _bShow )
{
PreparationPage* pPreparationPage = dynamic_cast< PreparationPage* >( GetPage( STATE_CLOSE_SUB_DOCS ) );
OSL_ENSURE( pPreparationPage, "MacroMigrationDialog::impl_showCloseDocsError: did not find the page!" );
if ( pPreparationPage )
pPreparationPage->showCloseDocsError( _bShow );
}
bool MacroMigrationDialog::impl_closeSubDocs_nothrow()
{
OSL_PRECOND( m_pData->xDocument.is(), "MacroMigrationDialog::impl_closeSubDocs_nothrow: no document!" );
if ( !m_pData->xDocument.is() )
return false;
impl_showCloseDocsError( false );
bool bSuccess = true;
try
{
// collect all controllers of our document
std::vector< Reference< XController2 > > aControllers;
lcl_getControllers_throw( m_pData->xDocumentModel, aControllers );
// close all sub documents of all controllers
for (auto const& controller : aControllers)
{
Reference< XDatabaseDocumentUI > xController( controller, UNO_QUERY );
OSL_ENSURE( xController.is(), "MacroMigrationDialog::impl_closeSubDocs_nothrow: unexpected: controller is missing an important interface!" );
// at the moment, only one implementation for a DBDoc's controller exists, which should
// support this interface
if ( !xController.is() )
continue;
bSuccess = xController->closeSubComponents();
if (!bSuccess)
break;
}
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION("dbaccess");
bSuccess = false;
}
impl_showCloseDocsError( !bSuccess );
return bSuccess;
}
namespace
{
bool lcl_equalURLs_nothrow(
const Reference< XComponentContext >& context,
const OUString& _lhs, const OUString& _rhs )
{
// the cheap situation: the URLs are equal
if ( _lhs == _rhs )
return true;
bool bEqual = true;
try
{
::ucbhelper::Content aContentLHS( _lhs, Reference< XCommandEnvironment >(), context );
::ucbhelper::Content aContentRHS( _rhs, Reference< XCommandEnvironment >(), context );
Reference< XContent > xContentLHS( aContentLHS.get(), UNO_SET_THROW );
Reference< XContent > xContentRHS( aContentRHS.get(), UNO_SET_THROW );
Reference< XContentIdentifier > xID1( xContentLHS->getIdentifier(), UNO_SET_THROW );
Reference< XContentIdentifier > xID2( xContentRHS->getIdentifier(), UNO_SET_THROW );
bEqual = UniversalContentBroker::create(context)->compareContentIds( xID1, xID2 ) == 0;
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION("dbaccess");
}
return bEqual;
}
}
bool MacroMigrationDialog::impl_backupDocument_nothrow() const
{
if ( !m_pData->xDocumentModel.is() )
// should never happen, but has been reported as assertion before
return false;
SaveDBDocPage& rBackupPage = dynamic_cast< SaveDBDocPage& >( *GetPage( STATE_BACKUP_DBDOC ) );
OUString sBackupLocation( rBackupPage.getBackupLocation() );
Any aError;
try
{
// check that the backup location isn't the same as the document itself
if ( lcl_equalURLs_nothrow( m_pData->aContext, sBackupLocation, m_pData->xDocumentModel->getURL() ) )
{
std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Warning, VclButtonsType::Ok, DBA_RES(STR_INVALID_BACKUP_LOCATION)));
xErrorBox->run();
rBackupPage.grabLocationFocus();
return false;
}
// store to the backup location
const Reference< XStorable > xDocument( getDocument(), UNO_QUERY_THROW );
xDocument->storeToURL( sBackupLocation, Sequence< PropertyValue >() );
m_pData->sSuccessfulBackupLocation = sBackupLocation;
}
catch( const Exception& )
{
aError = ::cppu::getCaughtException();
}
if ( !aError.hasValue() )
{
::svt::OFileNotation aFileNotation( sBackupLocation );
m_pData->aLogger.backedUpDocument( aFileNotation.get( ::svt::OFileNotation::N_SYSTEM ) );
return true;
}
// display the error to the user
InteractionHandler aHandler( m_pData->aContext, m_pData->xDocumentModel.get() );
aHandler.reportError( aError );
m_pData->aLogger.logFailure( MigrationError(
ERR_DOCUMENT_BACKUP_FAILED,
sBackupLocation,
aError
) );
return false;
}
void MacroMigrationDialog::impl_reloadDocument_nothrow( bool _bMigrationSuccess )
{
typedef std::pair< Reference< XFrame >, OUString > ViewDescriptor;
std::vector< ViewDescriptor > aViews;
try
{
// the information which is necessary to reload the document
OUString sDocumentURL ( m_pData->xDocumentModel->getURL() );
::comphelper::NamedValueCollection aDocumentArgs( m_pData->xDocumentModel->getArgs() );
if ( !_bMigrationSuccess )
{
// if the migration was not successful, then reload from the backup
aDocumentArgs.put( "SalvagedFile", m_pData->sSuccessfulBackupLocation );
// reset the modified flag of the document, so the controller can be suspended later
Reference< XModifiable > xModify( m_pData->xDocument, UNO_QUERY_THROW );
xModify->setModified( false );
// after this reload, don't show the migration warning, again
aDocumentArgs.put( "SuppressMigrationWarning", true );
}
// remove anything from the args which might refer to the old document
aDocumentArgs.remove( "Model" );
aDocumentArgs.remove( "Stream" );
aDocumentArgs.remove( "InputStream" );
aDocumentArgs.remove( "FileName" );
aDocumentArgs.remove( "URL" );
// collect all controllers of our document
std::vector< Reference< XController2 > > aControllers;
lcl_getControllers_throw( m_pData->xDocumentModel, aControllers );
// close all those controllers
for (auto const& controller : aControllers)
{
Reference< XController2 > xController( controller, UNO_SET_THROW );
Reference< XFrame > xFrame( xController->getFrame(), UNO_SET_THROW );
OUString sViewName( xController->getViewControllerName() );
if ( !xController->suspend( true ) )
{ // ouch. There shouldn't be any modal dialogs and such, so there
// really is no reason why suspending shouldn't work.
OSL_FAIL( "MacroMigrationDialog::impl_reloadDocument_nothrow: could not suspend a controller!" );
// ignoring this would be at the cost of a crash (potentially)
// so, we cannot continue here.
throw CloseVetoException();
}
aViews.emplace_back( xFrame, sViewName );
xFrame->setComponent( nullptr, nullptr );
xController->dispose();
}
aControllers.clear();
// Note the document is closed now - disconnecting the last controller
// closes it automatically.
Reference< XOfficeDatabaseDocument > xNewDocument;
// re-create the views
for (auto const& view : aViews)
{
// load the document into this frame
Reference< XComponentLoader > xLoader( view.first, UNO_QUERY_THROW );
aDocumentArgs.put( "ViewName", view.second );
Reference< XInterface > xReloaded( xLoader->loadComponentFromURL(
sDocumentURL,
"_self",
0,
aDocumentArgs.getPropertyValues()
) );
OSL_ENSURE( xReloaded != m_pData->xDocumentModel,
"MacroMigrationDialog::impl_reloadDocument_nothrow: this should have been a new instance!" );
// this would be unexpected, but recoverable: The loader should at least have done
// this: really *load* the document, even if it loaded it into the old document instance
if ( !xNewDocument.is() )
{
xNewDocument.set( xReloaded, UNO_QUERY_THROW );
// for subsequent loads, into different frames, put the document into the load args
aDocumentArgs.put( "Model", xNewDocument );
}
#if OSL_DEBUG_LEVEL > 0
else
{
OSL_ENSURE( xNewDocument == xReloaded,
"MacroMigrationDialog::impl_reloadDocument_nothrow: unexpected: subsequent load attempt returned a wrong document!" );
}
#endif
}
aViews.clear();
m_pData->xDocument = xNewDocument;
m_pData->xDocumentModel.set( xNewDocument, UNO_QUERY );
// finally, now that the document has been reloaded - if the migration was not successful,
// then it was reloaded from the backup, but the real document still is broken. So, save
// the document once, which will write the content loaded from the backup to the real docfile.
if ( !_bMigrationSuccess )
{
Reference< XModifiable > xModify( m_pData->xDocument, UNO_QUERY_THROW );
xModify->setModified( true );
// this is just paranoia - in case saving the doc fails, perhaps the user is tempted to do so
Reference< XStorable > xStor( m_pData->xDocument, UNO_QUERY_THROW );
xStor->store();
}
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION("dbaccess");
}
// close all frames from aViews - the respective controllers have been closed, but
// reloading didn't work, so the frames are zombies now.
for (auto const& view : aViews)
{
try
{
Reference< XCloseable > xFrameClose( view.first, UNO_QUERY_THROW );
xFrameClose->close( true );
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION("dbaccess");
}
}
aViews.clear();
}
} // namespace dbmm
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,76 +0,0 @@
/* -*- 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/.
*
* 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 .
*/
#ifndef INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MACROMIGRATIONDIALOG_HXX
#define INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MACROMIGRATIONDIALOG_HXX
#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <vcl/roadmapwizard.hxx>
#include <memory>
namespace dbmm
{
// MacroMigrationDialog
struct MacroMigrationDialog_Data;
typedef ::vcl::RoadmapWizard MacroMigrationDialog_Base;
class MacroMigrationDialog : public MacroMigrationDialog_Base
{
public:
MacroMigrationDialog(
vcl::Window* _pParent,
const css::uno::Reference< css::uno::XComponentContext >& _rContext,
const css::uno::Reference< css::sdb::XOfficeDatabaseDocument >& _rxDocument
);
const css::uno::Reference< css::uno::XComponentContext >&
getComponentContext() const;
const css::uno::Reference< css::sdb::XOfficeDatabaseDocument >&
getDocument() const;
protected:
// OWizardMachine overridables
virtual void enterState( WizardState _nState ) override;
virtual bool prepareLeaveCurrentState( CommitPageReason _eReason ) override;
// Dialog overridables
virtual bool Close() override;
virtual short Execute() override;
private:
void impl_showCloseDocsError( bool _bShow );
bool impl_closeSubDocs_nothrow();
bool impl_backupDocument_nothrow() const;
void impl_reloadDocument_nothrow( bool _bMigrationSuccess );
private:
DECL_LINK( OnStartMigration, void*, void );
private:
std::unique_ptr< MacroMigrationDialog_Data > m_pData;
};
} // namespace dbmm
#endif // INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MACROMIGRATIONDIALOG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,308 +0,0 @@
/* -*- 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/.
*
* 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 "macromigrationpages.hxx"
#include "macromigrationdialog.hxx"
#include <com/sun/star/frame/XModel.hpp>
#include <tools/urlobj.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/metric.hxx>
namespace dbmm
{
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::UNO_QUERY_THROW;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::frame::XModel;
MacroMigrationPage::MacroMigrationPage(vcl::Window *pParent, const OString& rID, const OUString& rUIXMLDescription)
: MacroMigrationPage_Base(pParent, rID, rUIXMLDescription)
{
}
MacroMigrationDialog& MacroMigrationPage::getDialog()
{
auto pDialog = dynamic_cast<MacroMigrationDialog*>(GetParentDialog());
assert(pDialog);
return *pDialog;
}
// PreparationPage
PreparationPage::PreparationPage(vcl::Window *pParent)
: MacroMigrationPage(pParent, "PreparePage" ,"dbaccess/ui/preparepage.ui")
{
get(m_pCloseDocError, "closedocerror");
}
PreparationPage::~PreparationPage()
{
disposeOnce();
}
void PreparationPage::dispose()
{
m_pCloseDocError.clear();
MacroMigrationPage::dispose();
}
void PreparationPage::showCloseDocsError( bool _bShow )
{
m_pCloseDocError->Show( _bShow );
}
VclPtr<TabPage> PreparationPage::Create( ::vcl::RoadmapWizard& _rParentDialog )
{
return VclPtr<PreparationPage>::Create(&_rParentDialog);
}
// SaveDBDocPage
SaveDBDocPage::SaveDBDocPage(MacroMigrationDialog& _rParentDialog)
: MacroMigrationPage(&_rParentDialog, "BackupPage" ,"dbaccess/ui/backuppage.ui")
{
get(m_pStartMigration, "startmigrate");
get(m_pBrowseSaveAsLocation, "browse");
get(m_pSaveAsLocation, "location");
m_pLocationController.reset( new svx::SvxDatabaseLocationInputController(
_rParentDialog.getComponentContext(), *m_pSaveAsLocation, *m_pBrowseSaveAsLocation) );
m_pSaveAsLocation->SetModifyHdl( LINK( this, SaveDBDocPage, OnLocationModified ) );
m_pSaveAsLocation->SetDropDownLineCount( 20 );
impl_updateLocationDependentItems();
}
SaveDBDocPage::~SaveDBDocPage()
{
disposeOnce();
}
void SaveDBDocPage::dispose()
{
m_pLocationController.reset();
m_pSaveAsLocation.clear();
m_pBrowseSaveAsLocation.clear();
m_pStartMigration.clear();
MacroMigrationPage::dispose();
}
void SaveDBDocPage::impl_updateLocationDependentItems()
{
updateDialogTravelUI();
m_pStartMigration->Show(!m_pSaveAsLocation->GetText().isEmpty());
}
IMPL_LINK_NOARG( SaveDBDocPage, OnLocationModified, Edit&, void )
{
impl_updateLocationDependentItems();
}
void SaveDBDocPage::initializePage()
{
OWizardPage::initializePage();
try
{
// get the document's current URL
Reference< XModel > xDocument( getDialog().getDocument(), UNO_QUERY_THROW );
INetURLObject aURLParser( xDocument->getURL() );
OSL_ENSURE( aURLParser.GetProtocol() != INetProtocol::NotValid, "SaveDBDocPage::initializePage: illegal document URL!" );
OUStringBuffer aBaseName( aURLParser.getBase() );
aBaseName.append( ".backup" );
aURLParser.setBase( aBaseName.makeStringAndClear() );
m_pLocationController->setURL( aURLParser.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
impl_updateLocationDependentItems();
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION("dbaccess");
}
}
bool SaveDBDocPage::canAdvance() const
{
if ( !MacroMigrationPage::canAdvance() )
return false;
return !m_pSaveAsLocation->GetText().isEmpty();
}
bool SaveDBDocPage::commitPage( ::vcl::WizardTypes::CommitPageReason _eReason )
{
if ( !MacroMigrationPage::commitPage( _eReason ) )
return false;
if ( ::vcl::WizardTypes::eTravelBackward == _eReason )
return true;
if ( !m_pLocationController->prepareCommit() )
return false;
return true;
}
VclPtr<TabPage> SaveDBDocPage::Create( ::vcl::RoadmapWizard& _rParentDialog )
{
return VclPtr<SaveDBDocPage>::Create( dynamic_cast< MacroMigrationDialog& >( _rParentDialog ) );
}
// ProgressPage
ProgressPage::ProgressPage(vcl::Window* pParent)
: MacroMigrationPage(pParent, "MigratePage" ,"dbaccess/ui/migratepage.ui")
{
get(m_pObjectCount, "count");
get(m_pCurrentObject, "object");
get(m_pCurrentAction, "current");
m_aCurrentProgress.Set(get<ProgressBar>("currentprogress"));
get(m_pAllProgressText, "overall");
m_aAllProgress.Set(get<ProgressBar>("allprogress"));
get(m_pMigrationDone, "done");
}
ProgressPage::~ProgressPage()
{
disposeOnce();
}
void ProgressPage::dispose()
{
m_pObjectCount.clear();
m_pCurrentObject.clear();
m_pCurrentAction.clear();
m_pAllProgressText.clear();
m_pMigrationDone.clear();
MacroMigrationPage::dispose();
}
VclPtr<TabPage> ProgressPage::Create(::vcl::RoadmapWizard& _rParentDialog)
{
return VclPtr<ProgressPage>::Create(&_rParentDialog);
}
void ProgressPage::setDocumentCounts( const sal_Int32 _nForms, const sal_Int32 _nReports )
{
OUString sText( m_pObjectCount->GetText() );
sText = sText.replaceFirst( "$forms$", OUString::number( _nForms ) );
sText = sText.replaceFirst( "$reports$", OUString::number( _nReports ) );
m_pObjectCount->SetText( sText );
}
void ProgressPage::onFinishedSuccessfully()
{
m_pMigrationDone->Show();
}
void ProgressPage::startObject( const OUString& _rObjectName, const OUString& _rCurrentAction, const sal_uInt32 _nRange )
{
m_pCurrentObject->SetText( _rObjectName );
m_pCurrentAction->SetText( _rCurrentAction );
m_aCurrentProgress.SetRange( _nRange );
m_aCurrentProgress.SetValue( sal_uInt32(0) );
// since this is currently called from the main thread, which does not have the chance
// to re-schedule, we need to explicitly update the display
m_pCurrentObject->Update();
m_pCurrentAction->Update();
Update();
}
void ProgressPage::setObjectProgressText( const OUString& _rText )
{
m_pCurrentAction->SetText( _rText );
m_pCurrentAction->Update();
Update();
}
void ProgressPage::setObjectProgressValue( const sal_uInt32 _nValue )
{
m_aCurrentProgress.SetValue( _nValue );
Update();
}
void ProgressPage::endObject()
{
m_pCurrentAction->SetText( OUString() );
m_aCurrentProgress.SetValue( m_aCurrentProgress.GetRange() );
m_pCurrentAction->Update();
Update();
}
void ProgressPage::start( const sal_uInt32 _nOverallRange )
{
m_aAllProgress.SetRange( _nOverallRange );
Update();
}
void ProgressPage::setOverallProgressText( const OUString& _rText )
{
m_pAllProgressText->SetText( _rText );
Update();
}
void ProgressPage::setOverallProgressValue( const sal_uInt32 _nValue )
{
m_aAllProgress.SetValue( _nValue );
Update();
}
// ResultPage
ResultPage::ResultPage(vcl::Window* pParent)
: MacroMigrationPage(pParent, "SummaryPage" ,"dbaccess/ui/summarypage.ui")
{
get(m_pChanges, "textview");
m_pChanges->set_height_request(GetTextHeight() * 10);
m_pChanges->set_width_request(approximate_char_width() * 40);
get(m_pSuccessLabel, "success");
get(m_pFailureLabel, "failure");
}
ResultPage::~ResultPage()
{
disposeOnce();
}
void ResultPage::dispose()
{
m_pSuccessLabel.clear();
m_pFailureLabel.clear();
m_pChanges.clear();
MacroMigrationPage::dispose();
}
VclPtr<TabPage> ResultPage::Create(::vcl::RoadmapWizard& _rParentDialog)
{
return VclPtr<ResultPage>::Create(&_rParentDialog);
}
void ResultPage::displayMigrationLog(const bool _bSuccessful, const OUString& _rSummary)
{
if (_bSuccessful)
m_pFailureLabel->Hide();
else
m_pSuccessLabel->Hide();
m_pChanges->SetText(_rSummary);
}
} // namespace dbmm
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,152 +0,0 @@
/* -*- 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/.
*
* 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 .
*/
#ifndef INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MACROMIGRATIONPAGES_HXX
#define INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MACROMIGRATIONPAGES_HXX
#include "migrationprogress.hxx"
#include "rangeprogressbar.hxx"
#include <svtools/urlcontrol.hxx>
#include <vcl/wizardmachine.hxx>
#include <svx/databaselocationinput.hxx>
#include <vcl/fixed.hxx>
#include <vcl/edit.hxx>
#include <vcl/vclmedit.hxx>
namespace vcl
{
class RoadmapWizard;
}
namespace dbmm
{
class MacroMigrationDialog;
// MacroMigrationPage
typedef ::vcl::OWizardPage MacroMigrationPage_Base;
class MacroMigrationPage : public MacroMigrationPage_Base
{
public:
MacroMigrationPage(vcl::Window *pParent, const OString& rID, const OUString& rUIXMLDescription);
protected:
MacroMigrationDialog& getDialog();
};
// PreparationPage
class PreparationPage final : public MacroMigrationPage
{
public:
explicit PreparationPage(vcl::Window *pParent);
virtual ~PreparationPage() override;
virtual void dispose() override;
static VclPtr<TabPage> Create( ::vcl::RoadmapWizard& _rParentDialog );
void showCloseDocsError(bool _bShow);
private:
VclPtr<FixedText> m_pCloseDocError;
};
// SaveDBDocPage
class SaveDBDocPage final : public MacroMigrationPage
{
public:
explicit SaveDBDocPage(MacroMigrationDialog& _rParentDialog);
virtual ~SaveDBDocPage() override;
virtual void dispose() override;
static VclPtr<TabPage> Create( ::vcl::RoadmapWizard& _rParentDialog );
OUString getBackupLocation() const { return m_pLocationController->getURL(); }
void grabLocationFocus() { m_pSaveAsLocation->GrabFocus(); }
private:
VclPtr< ::svt::OFileURLControl> m_pSaveAsLocation;
VclPtr<PushButton> m_pBrowseSaveAsLocation;
VclPtr<FixedText> m_pStartMigration;
std::unique_ptr<svx::SvxDatabaseLocationInputController> m_pLocationController;
// IWizardPageController overridables
virtual void initializePage() override;
virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;
virtual bool canAdvance() const override;
DECL_LINK( OnLocationModified, Edit&, void );
void impl_updateLocationDependentItems();
};
// ProgressPage
class ProgressPage : public MacroMigrationPage, public IMigrationProgress
{
public:
explicit ProgressPage(vcl::Window *pParent);
virtual ~ProgressPage() override;
virtual void dispose() override;
static VclPtr<TabPage> Create( ::vcl::RoadmapWizard& _rParentDialog );
void setDocumentCounts( const sal_Int32 _nForms, const sal_Int32 _nReports );
void onFinishedSuccessfully();
protected:
// IMigrationProgress
virtual void startObject( const OUString& _rObjectName, const OUString& _rCurrentAction, const sal_uInt32 _bRange ) override;
virtual void setObjectProgressText( const OUString& _rText ) override;
virtual void setObjectProgressValue( const sal_uInt32 _nValue ) override;
virtual void endObject() override;
virtual void start( const sal_uInt32 _nOverallRange ) override;
virtual void setOverallProgressText( const OUString& _rText ) override;
virtual void setOverallProgressValue( const sal_uInt32 _nValue ) override;
private:
VclPtr<FixedText> m_pObjectCount;
VclPtr<FixedText> m_pCurrentObject;
VclPtr<FixedText> m_pCurrentAction;
RangeProgressBar m_aCurrentProgress;
VclPtr<FixedText> m_pAllProgressText;
RangeProgressBar m_aAllProgress;
VclPtr<FixedText> m_pMigrationDone;
};
// ResultPage
class ResultPage : public MacroMigrationPage
{
public:
explicit ResultPage(vcl::Window *pParent);
virtual ~ResultPage() override;
virtual void dispose() override;
static VclPtr<TabPage> Create( ::vcl::RoadmapWizard& _rParentDialog );
void displayMigrationLog( const bool _bSuccessful, const OUString& _rLog );
private:
VclPtr<FixedText> m_pSuccessLabel;
VclPtr<FixedText> m_pFailureLabel;
VclPtr<VclMultiLineEdit> m_pChanges;
};
} // namespace dbmm
#endif // INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MACROMIGRATIONPAGES_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,132 +0,0 @@
/* -*- 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/.
*
* 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 "macromigrationwizard.hxx"
#include <toolkit/helper/vclunohelper.hxx>
#include <core_resource.hxx>
#include <strings.hrc>
namespace dbmm
{
// MacroMigrationDialogService
MacroMigrationDialogService::MacroMigrationDialogService( const Reference< XComponentContext >& _rxContext )
:MacroMigrationDialogService_Base( _rxContext )
{
m_bNeedInitialization = true;
}
MacroMigrationDialogService::~MacroMigrationDialogService()
{
// we do this here cause the base class' call to destroyDialog won't reach us anymore: we're within an dtor,
// so this virtual-method-call the base class does not work, we're already dead then...
if (m_aDialog)
{
::osl::MutexGuard aGuard( m_aMutex );
if (m_aDialog)
destroyDialog();
}
}
Reference< XInterface > MacroMigrationDialogService::Create( const Reference< XComponentContext >& _rxContext )
{
return *(new MacroMigrationDialogService( _rxContext ) );
}
svt::OGenericUnoDialog::Dialog MacroMigrationDialogService::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
{
return svt::OGenericUnoDialog::Dialog(VclPtr<MacroMigrationDialog>::Create(VCLUnoHelper::GetWindow(rParent), m_aContext, m_xDocument));
}
Sequence< sal_Int8 > SAL_CALL MacroMigrationDialogService::getImplementationId()
{
return css::uno::Sequence<sal_Int8>();
}
OUString MacroMigrationDialogService::getImplementationName_static()
{
return "com.sun.star.comp.dbaccess.macromigration.MacroMigrationDialogService";
}
Sequence< OUString > MacroMigrationDialogService::getSupportedServiceNames_static()
{
Sequence< OUString > aServices { "com.sun.star.sdb.application.MacroMigrationWizard" };
return aServices;
}
OUString SAL_CALL MacroMigrationDialogService::getImplementationName()
{
return getImplementationName_static();
}
Sequence< OUString > SAL_CALL MacroMigrationDialogService::getSupportedServiceNames()
{
return getSupportedServiceNames_static();
}
void SAL_CALL MacroMigrationDialogService::initialize( const Sequence< Any >& _rArguments )
{
::osl::MutexGuard aGuard( m_aMutex );
if ( m_bInitialized )
throw AlreadyInitializedException( OUString(), *this );
if ( _rArguments.getLength() != 1 )
throw IllegalArgumentException(
DBA_RES(STR_INVALID_NUMBER_ARGS),
*this,
1
);
m_xDocument.set( _rArguments[0], UNO_QUERY );
if ( !m_xDocument.is() )
throw IllegalArgumentException(
DBA_RES(STR_NO_DATABASE),
*this,
1
);
Reference< XStorable > xDocStor( m_xDocument, UNO_QUERY_THROW );
if ( xDocStor->isReadonly() )
throw IllegalArgumentException(
DBA_RES(STR_NOT_READONLY),
*this,
1
);
m_bInitialized = true;
}
Reference< XPropertySetInfo > SAL_CALL MacroMigrationDialogService::getPropertySetInfo()
{
return createPropertySetInfo( getInfoHelper() );
}
::cppu::IPropertyArrayHelper& SAL_CALL MacroMigrationDialogService::getInfoHelper()
{
return *getArrayHelper();
}
::cppu::IPropertyArrayHelper* MacroMigrationDialogService::createArrayHelper( ) const
{
Sequence< Property > aProps;
describeProperties( aProps );
return new ::cppu::OPropertyArrayHelper( aProps );
}
} // namespace dbmm
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,96 +0,0 @@
/* -*- 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/.
*
* 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 "macromigrationdialog.hxx"
#include <com/sun/star/ucb/AlreadyInitializedException.hpp>
#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <comphelper/proparrhlp.hxx>
#include <svtools/genericunodialog.hxx>
namespace dbmm
{
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::XInterface;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::UNO_QUERY_THROW;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::XComponentContext;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::beans::XPropertySetInfo;
using ::com::sun::star::beans::Property;
using ::com::sun::star::ucb::AlreadyInitializedException;
using ::com::sun::star::sdb::XOfficeDatabaseDocument;
using ::com::sun::star::lang::IllegalArgumentException;
using ::com::sun::star::frame::XStorable;
// MacroMigrationDialogService
class MacroMigrationDialogService;
typedef ::svt::OGenericUnoDialog MacroMigrationDialogService_Base;
typedef ::comphelper::OPropertyArrayUsageHelper< MacroMigrationDialogService > MacroMigrationDialogService_PBase;
class MacroMigrationDialogService
:public MacroMigrationDialogService_Base
,public MacroMigrationDialogService_PBase
{
public:
explicit MacroMigrationDialogService( const Reference< XComponentContext >& _rxContext );
// XTypeProvider
virtual Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName() override;
virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
// XPropertySet
virtual Reference< XPropertySetInfo > SAL_CALL getPropertySetInfo() override;
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
// helper for factories
static Reference< XInterface > Create( const Reference< XComponentContext >& _rxContext );
/// @throws RuntimeException
static OUString getImplementationName_static();
/// @throws RuntimeException
static Sequence< OUString > getSupportedServiceNames_static();
protected:
virtual ~MacroMigrationDialogService() override;
protected:
virtual svt::OGenericUnoDialog::Dialog createDialog(const css::uno::Reference<css::awt::XWindow>& rParent) override;
private:
Reference< XOfficeDatabaseDocument > m_xDocument;
};
} // namespace dbmm
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
File diff suppressed because it is too large Load Diff
@@ -1,80 +0,0 @@
/* -*- 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/.
*
* 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 .
*/
#ifndef INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MIGRATIONENGINE_HXX
#define INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MIGRATIONENGINE_HXX
#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
#include <memory>
namespace dbmm
{
class IMigrationProgress;
class MigrationLog;
// MigrationEngine
class MigrationEngine_Impl;
class MigrationEngine
{
public:
/** creates the migration engine
@param _rxDocument
the document whose macros/scripts should be migrated
@param _rProgress
a callback for notifying progress. Beware of lifetimes here: The progress callback,
passed herein as reference, must live as long as the engine instance lives.
*/
MigrationEngine(
const css::uno::Reference< css::uno::XComponentContext >& _rContext,
const css::uno::Reference< css::sdb::XOfficeDatabaseDocument >& _rxDocument,
IMigrationProgress& _rProgress,
MigrationLog& _rLogger
);
~MigrationEngine();
sal_Int32 getFormCount() const;
sal_Int32 getReportCount() const;
/** starts migrating the scripts and macros in the forms/reports to the database
document.
This process cannot be cancelled, as it would leave the document in an inconsistent
state.
When the function returns, then the migration is finished.
@return
whether or not the migration was successful. If it wasn't, then an error has been reported
to the user, using the document's interaction handler. If no such interaction handler
was present, then the error has been silenced.
*/
bool migrateAll();
private:
std::unique_ptr< MigrationEngine_Impl > m_pImpl;
};
} // namespace dbmm
#endif // INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MIGRATIONENGINE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,153 +0,0 @@
/* -*- 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/.
*
* 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 .
*/
#ifndef INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MIGRATIONERROR_HXX
#define INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MIGRATIONERROR_HXX
#include <com/sun/star/uno/Any.hxx>
#include <vector>
namespace dbmm
{
enum MigrationErrorType
{
ERR_OPENING_SUB_DOCUMENT_FAILED = 1,
ERR_CLOSING_SUB_DOCUMENT_FAILED,
ERR_STORAGE_COMMIT_FAILED,
ERR_STORING_DATABASEDOC_FAILED,
ERR_COLLECTING_DOCUMENTS_FAILED,
ERR_UNEXPECTED_LIBSTORAGE_ELEMENT,
ERR_CREATING_DBDOC_SCRIPT_STORAGE_FAILED,
ERR_COMMITTING_SCRIPT_STORAGES_FAILED,
ERR_GENERAL_SCRIPT_MIGRATION_FAILURE,
ERR_GENERAL_MACRO_MIGRATION_FAILURE,
ERR_UNKNOWN_SCRIPT_TYPE,
ERR_UNKNOWN_SCRIPT_LANGUAGE,
ERR_UNKNOWN_SCRIPT_NAME_FORMAT,
ERR_SCRIPT_TRANSLATION_FAILURE,
ERR_INVALID_SCRIPT_DESCRIPTOR_FORMAT,
ERR_ADJUSTING_DOCUMENT_EVENTS_FAILED,
ERR_ADJUSTING_DIALOG_EVENTS_FAILED,
ERR_ADJUSTING_FORMCOMP_EVENTS_FAILED,
ERR_BIND_SCRIPT_STORAGE_FAILED,
ERR_REMOVE_SCRIPTS_STORAGE_FAILED,
ERR_DOCUMENT_BACKUP_FAILED,
ERR_UNKNOWN_SCRIPT_FOLDER,
ERR_EXAMINING_SCRIPTS_FOLDER_FAILED,
ERR_PASSWORD_VERIFICATION_FAILED,
ERR_NEW_STYLE_REPORT
};
// MigrationError
/** encapsulates information about an error which happened during the migration
*/
struct MigrationError
{
const MigrationErrorType eType;
std::vector< OUString > aErrorDetails;
const css::uno::Any aCaughtException;
MigrationError(
const MigrationErrorType _eType,
const css::uno::Any& _rCaughtException )
:eType( _eType )
,aCaughtException( _rCaughtException )
{
}
MigrationError(
const MigrationErrorType _eType,
const OUString& _rDetail )
:eType( _eType )
{
impl_constructDetails( _rDetail );
}
MigrationError(
const MigrationErrorType _eType,
const OUString& _rDetail,
const css::uno::Any& _rCaughtException )
:eType( _eType )
,aCaughtException( _rCaughtException )
{
impl_constructDetails( _rDetail );
}
MigrationError(
const MigrationErrorType _eType,
const OUString& _rDetail1,
const OUString& _rDetail2 )
:eType( _eType )
{
impl_constructDetails( _rDetail1, _rDetail2 );
}
MigrationError(
const MigrationErrorType _eType,
const OUString& _rDetail1,
const OUString& _rDetail2,
const css::uno::Any& _rCaughtException )
:eType( _eType )
,aCaughtException( _rCaughtException )
{
impl_constructDetails( _rDetail1, _rDetail2 );
}
MigrationError(
const MigrationErrorType _eType,
const OUString& _rDetail1,
const OUString& _rDetail2,
const OUString& _rDetail3,
const css::uno::Any& _rCaughtException )
:eType( _eType )
,aCaughtException( _rCaughtException )
{
impl_constructDetails( _rDetail1, _rDetail2, _rDetail3 );
}
MigrationError(
const MigrationErrorType _eType,
const OUString& _rDetail1,
const OUString& _rDetail2,
const OUString& _rDetail3 )
:eType( _eType )
{
impl_constructDetails( _rDetail1, _rDetail2, _rDetail3 );
}
private:
void impl_constructDetails(
const OUString& _rDetail1,
const OUString& _rDetail2 = OUString(),
const OUString& _rDetail3 = OUString()
)
{
if ( !_rDetail1.isEmpty() ) aErrorDetails.push_back( _rDetail1 );
if ( !_rDetail2.isEmpty() ) aErrorDetails.push_back( _rDetail2 );
if ( !_rDetail3.isEmpty() ) aErrorDetails.push_back( _rDetail3 );
}
};
} // namespace dbmm
#endif // INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MIGRATIONERROR_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,433 +0,0 @@
/* -*- 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/.
*
* 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 <core_resource.hxx>
#include "migrationerror.hxx"
#include "migrationlog.hxx"
#include <strings.hrc>
#include <comphelper/anytostring.hxx>
#include <osl/diagnose.h>
#include <rtl/ustrbuf.hxx>
#include <vector>
#include <map>
#include <algorithm>
namespace dbmm
{
// LibraryEntry
struct LibraryEntry
{
ScriptType eType;
OUString sOldName;
OUString sNewName;
LibraryEntry( const ScriptType& _eType, const OUString& _rOldName, const OUString& _rNewName )
:eType( _eType )
,sOldName( _rOldName )
,sNewName( _rNewName )
{
}
};
// DocumentEntry
struct DocumentEntry
{
SubDocumentType eType;
OUString sName;
std::vector< LibraryEntry > aMovedLibraries;
DocumentEntry()
:eType( eForm )
,sName()
,aMovedLibraries()
{
}
DocumentEntry( const SubDocumentType _eType, const OUString& _rName )
:eType( _eType )
,sName( _rName )
{
}
};
// DocumentLogs
typedef std::map< DocumentID, DocumentEntry > DocumentLogs;
// ErrorLog
typedef std::vector< MigrationError > ErrorLog;
// MigrationLog_Data
struct MigrationLog_Data
{
OUString sBackupLocation;
DocumentLogs aDocumentLogs;
ErrorLog aFailures;
ErrorLog aWarnings;
};
// MigrationLog
MigrationLog::MigrationLog()
:m_pData( new MigrationLog_Data )
{
}
MigrationLog::~MigrationLog()
{
}
void MigrationLog::logFailure( const MigrationError& _rError )
{
m_pData->aFailures.push_back( _rError );
}
void MigrationLog::logRecoverable( const MigrationError& _rError )
{
m_pData->aWarnings.push_back( _rError );
}
bool MigrationLog::hadFailure() const
{
return !m_pData->aFailures.empty();
}
void MigrationLog::backedUpDocument( const OUString& _rNewDocumentLocation )
{
m_pData->sBackupLocation = _rNewDocumentLocation;
}
DocumentID MigrationLog::startedDocument( const SubDocumentType _eType, const OUString& _rName )
{
#if OSL_DEBUG_LEVEL > 0
bool bAlreadyKnown = false;
for (auto const& documentLog : m_pData->aDocumentLogs)
{
bAlreadyKnown = ( documentLog.second.eType == _eType ) && ( documentLog.second.sName == _rName );
if (bAlreadyKnown)
break;
}
OSL_ENSURE( !bAlreadyKnown, "MigrationLog::startedDocument: document is already known!" );
#endif
DocumentID nID = static_cast<DocumentID>( m_pData->aDocumentLogs.size() + 1 );
while ( m_pData->aDocumentLogs.find( nID ) != m_pData->aDocumentLogs.end() )
++nID;
m_pData->aDocumentLogs[ nID ] = DocumentEntry( _eType, _rName );
return nID;
}
void MigrationLog::movedLibrary( const DocumentID _nDocID, const ScriptType _eScriptType,
const OUString& _rOriginalLibName, const OUString& _rNewLibName )
{
OSL_ENSURE( m_pData->aDocumentLogs.find( _nDocID ) != m_pData->aDocumentLogs.end(),
"MigrationLog::movedLibrary: document is not known!" );
DocumentEntry& rDocEntry = m_pData->aDocumentLogs[ _nDocID ];
rDocEntry.aMovedLibraries.emplace_back( _eScriptType, _rOriginalLibName, _rNewLibName );
}
void MigrationLog::finishedDocument( const DocumentID _nDocID )
{
OSL_ENSURE( m_pData->aDocumentLogs.find( _nDocID ) != m_pData->aDocumentLogs.end(),
"MigrationLog::finishedDocument: document is not known!" );
// nothing to do here
}
OUString MigrationLog::getNewLibraryName( DocumentID _nDocID, ScriptType _eScriptType,
const OUString& _rOriginalLibName ) const
{
DocumentLogs::const_iterator docPos = m_pData->aDocumentLogs.find( _nDocID );
if ( docPos == m_pData->aDocumentLogs.end() )
{
OSL_FAIL( "MigrationLog::getNewLibraryName: document is not known!" );
return OUString();
}
const DocumentEntry& rDocEntry( docPos->second );
for (auto const& elem : rDocEntry.aMovedLibraries)
{
if ( ( _eScriptType == elem.eType )
&& ( _rOriginalLibName == elem.sOldName )
)
return elem.sNewName;
}
OSL_FAIL( "MigrationLog::getNewLibraryName: doc is known, but library isn't!" );
return OUString();
}
namespace
{
void lcl_appendErrorDescription( OUStringBuffer& _inout_rBuffer, const MigrationError& _rError )
{
const sal_Char* pAsciiErrorDescription( nullptr );
std::vector< OUString > aParameterNames;
switch ( _rError.eType )
{
case ERR_OPENING_SUB_DOCUMENT_FAILED:
pAsciiErrorDescription = "opening '#doc#' failed";
aParameterNames.emplace_back("#doc#");
break;
case ERR_CLOSING_SUB_DOCUMENT_FAILED:
pAsciiErrorDescription = "closing '#doc#' failed";
aParameterNames.emplace_back("#doc#");
break;
case ERR_STORAGE_COMMIT_FAILED:
pAsciiErrorDescription = "committing the changes for document '#doc#' failed";
aParameterNames.emplace_back("#doc#");
break;
case ERR_STORING_DATABASEDOC_FAILED:
pAsciiErrorDescription = "storing the database document failed";
break;
case ERR_COLLECTING_DOCUMENTS_FAILED:
pAsciiErrorDescription = "collecting the forms/reports of the database document failed";
break;
case ERR_UNEXPECTED_LIBSTORAGE_ELEMENT:
pAsciiErrorDescription = "unexpected #lib# storage element in document '#doc#', named '#element#'";
aParameterNames.emplace_back("#doc#");
aParameterNames.emplace_back("#libstore#");
aParameterNames.emplace_back("#element#");
break;
case ERR_CREATING_DBDOC_SCRIPT_STORAGE_FAILED:
pAsciiErrorDescription = "creating the database document's storage for #scripttype# scripts failed";
aParameterNames.emplace_back("#scripttype#");
break;
case ERR_COMMITTING_SCRIPT_STORAGES_FAILED:
pAsciiErrorDescription = "saving the #scripttype# scripts for document '#doc#' failed";
aParameterNames.emplace_back("#scripttype#");
aParameterNames.emplace_back("#doc#");
break;
case ERR_GENERAL_SCRIPT_MIGRATION_FAILURE:
pAsciiErrorDescription = "general error while migrating #scripttype# scripts of document '#doc#'";
aParameterNames.emplace_back("#scripttype#");
aParameterNames.emplace_back("#doc#");
break;
case ERR_GENERAL_MACRO_MIGRATION_FAILURE:
pAsciiErrorDescription = "general error during macro migration of document '#doc#'";
aParameterNames.emplace_back("#doc#");
break;
case ERR_UNKNOWN_SCRIPT_TYPE:
pAsciiErrorDescription = "unknown script type: #type#";
aParameterNames.emplace_back("#type#");
break;
case ERR_UNKNOWN_SCRIPT_LANGUAGE:
pAsciiErrorDescription = "unknown script language: #lang#";
aParameterNames.emplace_back("#lang#");
break;
case ERR_UNKNOWN_SCRIPT_NAME_FORMAT:
pAsciiErrorDescription = "unknown script name format: #script#";
aParameterNames.emplace_back("#script#");
break;
case ERR_SCRIPT_TRANSLATION_FAILURE:
pAsciiErrorDescription = "analyzing/translating the script URL failed; script type: #type#; script: #code#";
aParameterNames.emplace_back("#type#");
aParameterNames.emplace_back("#code#");
break;
case ERR_INVALID_SCRIPT_DESCRIPTOR_FORMAT:
pAsciiErrorDescription = "invalid script descriptor format";
break;
case ERR_ADJUSTING_DOCUMENT_EVENTS_FAILED:
pAsciiErrorDescription = "adjusting events for document '#doc#' failed";
aParameterNames.emplace_back("#doc#");
break;
case ERR_ADJUSTING_DIALOG_EVENTS_FAILED:
pAsciiErrorDescription = "adjusting events for dialog #lib#.#dlg# in document '#doc#' failed";
aParameterNames.emplace_back("#doc#");
aParameterNames.emplace_back("#lib#");
aParameterNames.emplace_back("#dlg#");
break;
case ERR_ADJUSTING_FORMCOMP_EVENTS_FAILED:
pAsciiErrorDescription = "adjusting form component events for '#doc#' failed";
aParameterNames.emplace_back("#doc#");
break;
case ERR_BIND_SCRIPT_STORAGE_FAILED:
pAsciiErrorDescription = "binding to the script storage failed for document '#doc#'";
aParameterNames.emplace_back("#doc#");
break;
case ERR_REMOVE_SCRIPTS_STORAGE_FAILED:
pAsciiErrorDescription = "removing a scripts storage failed for document '#doc#'";
aParameterNames.emplace_back("#doc#");
break;
case ERR_DOCUMENT_BACKUP_FAILED:
pAsciiErrorDescription = "backing up the document to #location# failed";
aParameterNames.emplace_back("#location#");
break;
case ERR_UNKNOWN_SCRIPT_FOLDER:
pAsciiErrorDescription = "unknown script folder '#name#' in document '#doc#'";
aParameterNames.emplace_back("#doc#");
aParameterNames.emplace_back("#name#");
break;
case ERR_EXAMINING_SCRIPTS_FOLDER_FAILED:
pAsciiErrorDescription = "examining the 'Scripts' folder failed for document '#doc#'";
aParameterNames.emplace_back("#doc#");
break;
case ERR_PASSWORD_VERIFICATION_FAILED:
pAsciiErrorDescription = "password verification failed for document '#doc#', #libtype# library '#name#'";
aParameterNames.emplace_back("#doc#");
aParameterNames.emplace_back("#libtype#");
aParameterNames.emplace_back("#name#");
break;
case ERR_NEW_STYLE_REPORT:
pAsciiErrorDescription = "#doc# could not be processed, since you don't have the Report Builder feature installed.";
aParameterNames.emplace_back("#doc#");
break;
// do *not* add a default case here: Without a default, some compilers will warn you when
// you miss a newly-introduced enum value here
}
OSL_ENSURE( pAsciiErrorDescription, "lcl_appendErrorDescription: no error message!" );
if ( pAsciiErrorDescription )
{
OUString sSubstituted( OUString::createFromAscii( pAsciiErrorDescription ) );
OSL_ENSURE( aParameterNames.size() == _rError.aErrorDetails.size(),
"lcl_appendErrorDescription: unexpected number of error message parameters!" );
for ( size_t i=0; i < std::min( aParameterNames.size(), _rError.aErrorDetails.size() ); ++i )
{
sSubstituted = sSubstituted.replaceFirst(
aParameterNames[i], _rError.aErrorDetails[i]);
}
_inout_rBuffer.append( sSubstituted );
}
}
void lcl_describeErrors( OUStringBuffer& _rBuffer, const ErrorLog& _rErrors, const char* pHeadingResId )
{
_rBuffer.append( "=== " );
_rBuffer.append( DBA_RES(pHeadingResId) );
_rBuffer.append( " ===\n" );
OUString sException( DBA_RES( STR_EXCEPTION ) );
for (auto const& error : _rErrors)
{
_rBuffer.append( '-' );
_rBuffer.append( ' ' );
lcl_appendErrorDescription(_rBuffer, error);
_rBuffer.append( '\n' );
if ( !error.aCaughtException.hasValue() )
continue;
_rBuffer.append( sException );
_rBuffer.append( ::comphelper::anyToString( error.aCaughtException ) );
_rBuffer.append( '\n' );
_rBuffer.append( '\n' );
}
}
}
bool MigrationLog::movedAnyLibrary( const DocumentID _nDocID )
{
DocumentLogs::const_iterator docPos = m_pData->aDocumentLogs.find( _nDocID );
if ( docPos == m_pData->aDocumentLogs.end() )
{
OSL_FAIL( "MigrationLog::movedAnyLibrary: document is not known!" );
return false;
}
return !docPos->second.aMovedLibraries.empty();
}
OUString MigrationLog::getCompleteLog() const
{
OUStringBuffer aBuffer;
if ( !m_pData->sBackupLocation.isEmpty() )
{
OUString sBackedUp( DBA_RES( STR_SAVED_COPY_TO ) );
sBackedUp = sBackedUp.replaceAll( "$location$", m_pData->sBackupLocation );
aBuffer.append( "=== " ).append( DBA_RES( STR_DATABASE_DOCUMENT ) )
.append( " ===\n" ).append( sBackedUp ).append("\n\n");
}
if ( !m_pData->aFailures.empty() )
{
lcl_describeErrors( aBuffer, m_pData->aFailures
, STR_ERRORS );
}
else
{
OUString sMovedLibTemplate( DBA_RES( STR_MOVED_LIBRARY ) );
for (auto const& documentLog : m_pData->aDocumentLogs)
{
const DocumentEntry& rDoc( documentLog.second );
if ( rDoc.aMovedLibraries.empty() )
continue;
OUString sDocTitle( DBA_RES( rDoc.eType == eForm ? STR_FORM : STR_REPORT ) );
sDocTitle = sDocTitle.replaceAll( "$name$", rDoc.sName );
aBuffer.append( "=== " ).append( sDocTitle ).append( " ===\n" );
for (auto const& elem : rDoc.aMovedLibraries)
{
OUString sMovedLib = sMovedLibTemplate.replaceAll( "$type$", getScriptTypeDisplayName( elem.eType ) );
sMovedLib = sMovedLib.replaceAll( "$old$", elem.sOldName );
sMovedLib = sMovedLib.replaceAll( "$new$", elem.sNewName );
aBuffer.append( sMovedLib ).append( "\n" );
}
aBuffer.append( '\n' );
}
}
if ( !m_pData->aWarnings.empty() )
{
lcl_describeErrors( aBuffer, m_pData->aWarnings, STR_WARNINGS );
}
return aBuffer.makeStringAndClear();
}
} // namespace dbmm
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,110 +0,0 @@
/* -*- 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/.
*
* 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 .
*/
#ifndef INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MIGRATIONLOG_HXX
#define INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MIGRATIONLOG_HXX
#include "dbmm_types.hxx"
#include <rtl/ustring.hxx>
#include <memory>
namespace dbmm
{
typedef sal_Int16 DocumentID;
struct MigrationError;
// MigrationLog
struct MigrationLog_Data;
class MigrationLog
{
public:
MigrationLog();
~MigrationLog();
//- event logging
/** logs an unrecoverable error during the migration process
*/
void logFailure( const MigrationError& _rError );
/** logs a recoverable (or at least ignorable) error during the migration process
*/
void logRecoverable( const MigrationError& _rError );
/// checks whether logFailure has been called
bool hadFailure() const;
/// logs the fact that the database document has been backed up
void backedUpDocument( const OUString& _rNewDocumentLocation );
/** logs that the migration for a certain sub document has been started, returns
a unique ID for this sub document which is to be used in later calls
*/
DocumentID startedDocument( const SubDocumentType _eType, const OUString& _rName );
/** logs the event that a macro or script library has been moved from within a
sub document to the database document
*/
void movedLibrary(
const DocumentID _nDocID,
const ScriptType _eScriptType,
const OUString& _rOriginalLibName,
const OUString& _rNewLibName
);
/** logs that the migration for a certain document has been finished
*/
void finishedDocument( const DocumentID _nDocID );
//- information retrieval
/** retrieves the new name of a library
The new library name must previously have been logger by calling
<member>movedLibrary</member>. If not, an assertion will be raised in
the non-product builds, and an empty string will be returned.
*/
OUString getNewLibraryName(
DocumentID _nDocID,
ScriptType _eScriptType,
const OUString& _rOriginalLibName
) const;
/** determines whether for the given document, any library needed to be (and was) moved
*/
bool movedAnyLibrary( const DocumentID );
/** provides a human-readable version of the log, explaining a user what happened during
the migration.
*/
OUString
getCompleteLog() const;
private:
std::unique_ptr< MigrationLog_Data > m_pData;
};
} // namespace dbmm
#endif // INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MIGRATIONLOG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,49 +0,0 @@
/* -*- 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/.
*
* 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 .
*/
#ifndef INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MIGRATIONPROGRESS_HXX
#define INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MIGRATIONPROGRESS_HXX
#include <sal/types.h>
#include <rtl/ustring.hxx>
namespace dbmm
{
// IMigrationProgress
class SAL_NO_VTABLE IMigrationProgress
{
public:
virtual void startObject( const OUString& _rObjectName, const OUString& _rCurrentAction, const sal_uInt32 _nRange ) = 0;
virtual void setObjectProgressText( const OUString& _rText ) = 0;
virtual void setObjectProgressValue( const sal_uInt32 _nValue ) = 0;
virtual void endObject() = 0;
virtual void start( const sal_uInt32 _nOverallRange ) = 0;
virtual void setOverallProgressText( const OUString& _rText ) = 0;
virtual void setOverallProgressValue( const sal_uInt32 _nValue ) = 0;
protected:
~IMigrationProgress() {}
};
} // namespace dbmm
#endif // INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MIGRATIONPROGRESS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,95 +0,0 @@
/* -*- 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/.
*
* 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 "progresscapture.hxx"
#include "migrationprogress.hxx"
#include <osl/diagnose.h>
#include <vcl/svapp.hxx>
namespace dbmm
{
// ProgressCapture_Data
struct ProgressCapture_Data
{
ProgressCapture_Data( const OUString& _rObjectName, IMigrationProgress& _rMasterProgress )
:sObjectName( _rObjectName )
,rMasterProgress( _rMasterProgress )
,bDisposed( false )
{
}
OUString sObjectName;
IMigrationProgress& rMasterProgress;
bool bDisposed;
};
// ProgressCapture
ProgressCapture::ProgressCapture( const OUString& _rObjectName, IMigrationProgress& _rMasterProgress )
:m_pData( new ProgressCapture_Data( _rObjectName, _rMasterProgress ) )
{
}
ProgressCapture::~ProgressCapture()
{
}
void ProgressCapture::dispose()
{
SolarMutexGuard aGuard;
m_pData->bDisposed = true;
}
void SAL_CALL ProgressCapture::start( const OUString& _rText, ::sal_Int32 _nRange )
{
SolarMutexGuard aGuard;
if ( !m_pData->bDisposed )
m_pData->rMasterProgress.startObject( m_pData->sObjectName, _rText, _nRange );
}
void SAL_CALL ProgressCapture::end( )
{
SolarMutexGuard aGuard;
if ( !m_pData->bDisposed )
m_pData->rMasterProgress.endObject();
}
void SAL_CALL ProgressCapture::setText( const OUString& _rText )
{
SolarMutexGuard aGuard;
if ( !m_pData->bDisposed )
m_pData->rMasterProgress.setObjectProgressText( _rText );
}
void SAL_CALL ProgressCapture::setValue( ::sal_Int32 _nValue )
{
SolarMutexGuard aGuard;
if ( !m_pData->bDisposed )
m_pData->rMasterProgress.setObjectProgressValue( _nValue );
}
void SAL_CALL ProgressCapture::reset( )
{
OSL_FAIL( "ProgressCapture::reset: not implemented!" );
}
} // namespace dbmm
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,65 +0,0 @@
/* -*- 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/.
*
* 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 .
*/
#ifndef INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_PROGRESSCAPTURE_HXX
#define INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_PROGRESSCAPTURE_HXX
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <cppuhelper/implbase.hxx>
#include <memory>
namespace dbmm
{
class IMigrationProgress;
// ProgressCapture
typedef ::cppu::WeakImplHelper< css::task::XStatusIndicator
> ProgressCapture_Base;
struct ProgressCapture_Data;
class ProgressCapture : public ProgressCapture_Base
{
public:
ProgressCapture( const OUString& _rObjectName, IMigrationProgress& _rMasterProgress );
void dispose();
// XStatusIndicator
virtual void SAL_CALL start( const OUString& Text, ::sal_Int32 Range ) override;
virtual void SAL_CALL end( ) override;
virtual void SAL_CALL setText( const OUString& Text ) override;
virtual void SAL_CALL setValue( ::sal_Int32 Value ) override;
virtual void SAL_CALL reset( ) override;
protected:
virtual ~ProgressCapture() override;
private:
std::unique_ptr< ProgressCapture_Data > m_pData;
};
} // namespace dbmm
#endif // INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_PROGRESSCAPTURE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,177 +0,0 @@
/* -*- 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/.
*
* 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 "progressmixer.hxx"
#include <osl/diagnose.h>
#include <map>
namespace dbmm
{
#define OVERALL_RANGE 100000
// misc types
struct PhaseData
{
// the weight of the phase, relative to all other phases
PhaseWeight nWeight;
// the "local" range of the phase
sal_uInt32 nRange;
// this is the point in the "overall range" at which this phase starts
sal_uInt32 nGlobalStart;
/** the "global" range of the phase, i.e. its range after weighting with all other
phases
*/
sal_uInt32 nGlobalRange;
PhaseData()
:nWeight(1)
,nRange(100)
,nGlobalStart(0)
,nGlobalRange(100)
{
}
explicit PhaseData( const PhaseWeight _nWeight )
:nWeight( _nWeight )
,nRange(100)
,nGlobalStart(0)
,nGlobalRange(100)
{
}
};
typedef std::map< PhaseID, PhaseData > Phases;
// ProgressMixer_Data
struct ProgressMixer_Data
{
Phases aPhases;
Phases::iterator pCurrentPhase;
sal_uInt32 nWeightSum; /// the cached sum of the weights
double nOverallStretch;
IProgressConsumer& rConsumer;
explicit ProgressMixer_Data( IProgressConsumer& _rConsumer )
:aPhases()
,pCurrentPhase( aPhases.end() )
,nWeightSum( 0 )
,nOverallStretch( 0 )
,rConsumer( _rConsumer )
{
}
};
namespace
{
bool lcl_isRunning( const ProgressMixer_Data& _rData )
{
return _rData.pCurrentPhase != _rData.aPhases.end();
}
void lcl_ensureInitialized( ProgressMixer_Data& _rData )
{
OSL_PRECOND( _rData.nWeightSum, "lcl_ensureInitialized: we have no phases, this will crash!" );
if ( _rData.nOverallStretch )
return;
_rData.nOverallStretch = 1.0 * OVERALL_RANGE / _rData.nWeightSum;
// tell the single phases their "overall starting point"
PhaseWeight nRunningWeight( 0 );
for (auto & phase : _rData.aPhases)
{
phase.second.nGlobalStart = static_cast<sal_uInt32>( nRunningWeight * _rData.nOverallStretch );
nRunningWeight += phase.second.nWeight;
sal_uInt32 nNextPhaseStart = static_cast<sal_uInt32>( nRunningWeight * _rData.nOverallStretch );
phase.second.nGlobalRange = nNextPhaseStart - phase.second.nGlobalStart;
}
_rData.rConsumer.start( OVERALL_RANGE );
}
}
// ProgressMixer
ProgressMixer::ProgressMixer( IProgressConsumer& _rConsumer )
:m_pData( new ProgressMixer_Data( _rConsumer ) )
{
}
ProgressMixer::~ProgressMixer()
{
}
void ProgressMixer::registerPhase( const PhaseID _nID, const PhaseWeight _nWeight )
{
OSL_PRECOND( !lcl_isRunning( *m_pData ), "ProgressMixer::registerPhase: already running!" );
OSL_ENSURE( m_pData->aPhases.find( _nID ) == m_pData->aPhases.end(),
"ProgressMixer::registerPhase: ID already used!" );
m_pData->aPhases[ _nID ] = PhaseData( _nWeight );
m_pData->nWeightSum += _nWeight;
}
void ProgressMixer::startPhase( const PhaseID _nID, const sal_uInt32 _nPhaseRange )
{
OSL_ENSURE( m_pData->aPhases.find( _nID ) != m_pData->aPhases.end(),
"ProgresMixer::startPhase: unknown phase!" );
m_pData->aPhases[ _nID ].nRange = _nPhaseRange;
m_pData->pCurrentPhase = m_pData->aPhases.find( _nID );
}
void ProgressMixer::advancePhase( const sal_uInt32 _nPhaseProgress )
{
OSL_PRECOND( lcl_isRunning( *m_pData ), "ProgresMixer::advancePhase: not running!" );
// in case this is the first call, ensure all the ranges/weights are calculated
// correctly
lcl_ensureInitialized( *m_pData );
const PhaseData& rPhase( m_pData->pCurrentPhase->second );
double nLocalProgress = 1.0 * _nPhaseProgress / rPhase.nRange;
sal_uInt32 nOverallProgress = static_cast<sal_uInt32>( rPhase.nGlobalStart + nLocalProgress * rPhase.nGlobalRange );
m_pData->rConsumer.advance( nOverallProgress );
}
void ProgressMixer::endPhase()
{
OSL_PRECOND( lcl_isRunning( *m_pData ), "ProgresMixer::endPhase: not running!" );
// in case this is the first call, ensure all the ranges/weights are calculated
// correctly
lcl_ensureInitialized( *m_pData );
// simply assume the phase's complete range is over
advancePhase( m_pData->pCurrentPhase->second.nRange );
// if that's the last phase, this is the "global end", too
Phases::const_iterator pNextPhase( m_pData->pCurrentPhase );
++pNextPhase;
if ( pNextPhase == m_pData->aPhases.end() )
m_pData->rConsumer.end();
}
} // namespace dbmm
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,87 +0,0 @@
/* -*- 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/.
*
* 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 .
*/
#ifndef INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_PROGRESSMIXER_HXX
#define INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_PROGRESSMIXER_HXX
#include <sal/types.h>
#include <memory>
namespace dbmm
{
typedef sal_uInt32 PhaseID;
typedef sal_uInt32 PhaseWeight;
// IProgressConsumer
class SAL_NO_VTABLE IProgressConsumer
{
public:
virtual void start( sal_uInt32 _nRange ) = 0;
virtual void advance( sal_uInt32 _nValue ) = 0;
virtual void end() = 0;
protected:
~IProgressConsumer() {}
};
// ProgressMixer
struct ProgressMixer_Data;
/** a class which mixes (i.e. concatenates) progress values from different
sources/phases, with different weight
*/
class ProgressMixer
{
public:
explicit ProgressMixer( IProgressConsumer& _rConsumer );
~ProgressMixer();
/** registers a phase of the process, which has the given weight
in the overall process
@precond
the progress is not running, yet
*/
void registerPhase( const PhaseID _nID, const PhaseWeight _nWeight );
/** enters the phase with the given ID, with the phase having
the given overall range
*/
void startPhase( const PhaseID _nID, const sal_uInt32 _nPhaseRange );
/** announces a new progress in the current phase.
The given phase progress must be between 0 and the overall phase range
as specified in ->startPhase.
*/
void advancePhase( const sal_uInt32 _nPhaseProgress );
/** leaves the current phase, which has been started with ->startPhase previously
*/
void endPhase();
private:
std::unique_ptr< ProgressMixer_Data > m_pData;
};
} // namespace dbmm
#endif // INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_PROGRESSMIXER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -1,71 +0,0 @@
/* -*- 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/.
*
* 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 .
*/
#ifndef INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_RANGEPROGRESSBAR_HXX
#define INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_RANGEPROGRESSBAR_HXX
#include <vcl/prgsbar.hxx>
namespace dbmm
{
// RangeProgressBar
/** a slight extension of the usual progress bar, which is able to remember a range
*/
class RangeProgressBar
{
public:
explicit RangeProgressBar()
: m_pBar(nullptr)
, m_nRange(0)
{
}
void Set(ProgressBar *pBar)
{
m_pBar = pBar;
}
void SetRange(sal_uInt32 _nRange)
{
m_nRange = _nRange;
if ( !m_nRange )
m_nRange = 100;
}
sal_uInt32 GetRange() const
{
return m_nRange;
}
void SetValue(sal_uInt32 _nValue)
{
m_pBar->SetValue( static_cast<sal_uInt16>( 100.0 * _nValue / m_nRange ) );
}
private:
VclPtr<ProgressBar> m_pBar;
sal_uInt32 m_nRange;
};
} // namespace dbmm
#endif // INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_RANGEPROGRESSBAR_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-31
View File
@@ -45,7 +45,6 @@
#include <com/sun/star/sdbcx/XRename.hpp>
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <com/sun/star/sdbcx/XViewsSupplier.hpp>
#include <com/sun/star/sdb/application/MacroMigrationWizard.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/uno/XNamingService.hpp>
#include <com/sun/star/util/XFlushable.hpp>
@@ -669,19 +668,6 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const
case ID_DIRECT_SQL:
aReturn.bEnabled = true;
break;
case ID_MIGRATE_SCRIPTS:
{
// Our document supports embedding scripts into it, if and only if there are no
// forms/reports with macros/scripts into them. So, we need to enable migration
// if and only if the database document does *not* support embedding scripts.
bool bAvailable =
!Reference< XEmbeddedScripts >( m_xModel, UNO_QUERY ).is()
&& !Reference< XStorable >( m_xModel, UNO_QUERY_THROW )->isReadonly();
aReturn.bEnabled = bAvailable;
if ( !bAvailable )
aReturn.bInvisible = true;
}
break;
case SID_APP_NEW_FOLDER:
aReturn.bEnabled = !isDataSourceReadOnly() && getContainer()->getSelectionCount() <= 1;
if ( aReturn.bEnabled )
@@ -1329,9 +1315,6 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
openDialog( SERVICE_SDB_DIRECTSQLDIALOG );
}
break;
case ID_MIGRATE_SCRIPTS:
impl_migrateScripts_nothrow();
break;
case SID_DB_APP_VIEW_TABLES:
m_aSelectContainerEvent.Call( reinterpret_cast< void* >( E_TABLE ) );
break;
@@ -1454,7 +1437,6 @@ void OApplicationController::describeSupportedFeatures()
implDescribeSupportedFeature( ".uno:DBConvertToView", SID_DB_APP_CONVERTTOVIEW, CommandGroup::EDIT );
implDescribeSupportedFeature( ".uno:DBRefreshTables", SID_DB_APP_REFRESH_TABLES, CommandGroup::APPLICATION );
implDescribeSupportedFeature( ".uno:DBDirectSQL", ID_DIRECT_SQL, CommandGroup::APPLICATION );
implDescribeSupportedFeature( ".uno:DBMigrateScripts", ID_MIGRATE_SCRIPTS, CommandGroup::APPLICATION );
implDescribeSupportedFeature( ".uno:DBViewTables", SID_DB_APP_VIEW_TABLES, CommandGroup::VIEW );
implDescribeSupportedFeature( ".uno:DBViewQueries", SID_DB_APP_VIEW_QUERIES, CommandGroup::VIEW );
implDescribeSupportedFeature( ".uno:DBViewForms", SID_DB_APP_VIEW_FORMS, CommandGroup::VIEW );
@@ -2823,19 +2805,6 @@ Any SAL_CALL OApplicationController::getSelection( )
return makeAny( aCurrentSelection );
}
void OApplicationController::impl_migrateScripts_nothrow()
{
try
{
Reference< XExecutableDialog > xDialog = css::sdb::application::MacroMigrationWizard::createWithDocument( getORB(), Reference< XOfficeDatabaseDocument >( m_xModel, UNO_QUERY_THROW ) );
xDialog->execute();
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION("dbaccess");
}
}
} // namespace dbaui
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-1
View File
@@ -62,7 +62,6 @@
#define ID_TREE_CLOSE_CONN 2
// FREE
#define ID_TREE_ADMINISTRATE 4
#define ID_MIGRATE_SCRIPTS 5
#define ID_REPORT_NEW_TEXT 14
#define ID_FORM_NEW_TEXT 15
@@ -117,7 +117,6 @@
<menu:menuitem menu:id=".uno:DBUserAdmin"/>
<menu:menuitem menu:id=".uno:DBTableFilter"/>
<menu:menuitem menu:id=".uno:DBDirectSQL"/>
<menu:menuitem menu:id=".uno:DBMigrateScripts"/>
<menu:menuseparator/>
<menu:menu menu:id=".uno:MacrosMenu">
<menu:menupopup>
-128
View File
@@ -1,128 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface domain="dba">
<requires lib="gtk+" version="3.18"/>
<requires lib="LibreOffice" version="1.0"/>
<object class="GtkGrid" id="BackupPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="border_width">6</property>
<property name="row_spacing">12</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="backuppage|label1">Backup Your Document</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes" context="backuppage|label2">To allow you to go back to the state before the migration, the database document will be backed up to a location of your choice. Every change done by the wizard will be made to the original document, the backup will stay untouched.</property>
<property name="wrap">True</property>
<property name="max_width_chars">64</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="startmigrate">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes" context="backuppage|startmigrate">Press 'Next' to save a copy of your document, and to begin the migration.</property>
<property name="wrap">True</property>
<property name="max_width_chars">64</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<child>
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="backuppage|label3">Save to:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">location</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="svtlo-OFileURLControl" id="location">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="URLBox-entry1">
<property name="can_focus">True</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="browse">
<property name="label" translatable="yes" context="backuppage|browse">Browse...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">end</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
</object>
</interface>
-214
View File
@@ -1,214 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface domain="dba">
<requires lib="gtk+" version="3.18"/>
<object class="GtkGrid" id="MigratePage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="border_width">6</property>
<property name="row_spacing">12</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="migratepage|label1">Migration Progress</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="count">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes" context="migratepage|count">The database document contains $forms$ form(s) and $reports$ report(s), which are currently being processed:</property>
<property name="wrap">True</property>
<property name="max_width_chars">64</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="done">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes" context="migratepage|done">All forms and reports have been successfully processed. Press 'Next' to show a detailed summary.</property>
<property name="wrap">True</property>
<property name="max_width_chars">64</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="migratepage|label4">Overall progress:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="overall">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="migratepage|overall">document $current$ of $overall$</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkProgressBar" id="allprogress">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="migratepage|label6">Current progress:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="current">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkProgressBar" id="currentprogress">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="migratepage|label5">Current object:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="object">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
</object>
<object class="GtkSizeGroup" id="sizegroup1">
<widgets>
<widget name="overall"/>
<widget name="current"/>
<widget name="object"/>
</widgets>
</object>
<object class="GtkSizeGroup" id="sizegroup2">
<widgets>
<widget name="label4"/>
<widget name="label6"/>
<widget name="label5"/>
</widgets>
</object>
</interface>
-66
View File
@@ -1,66 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface domain="dba">
<requires lib="gtk+" version="3.18"/>
<object class="GtkGrid" id="PreparePage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="border_width">6</property>
<property name="row_spacing">12</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="preparepage|label1">Welcome to the Database Macro Migration Wizard</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes" context="preparepage|label2">This wizard will guide you through the task of migrating your macros.
After you finished it, all macros which were formerly embedded into the forms and reports of the current database document will have been moved to the document itself. In this course, libraries will be renamed as needed.
If your forms and reports contain references to those macros, they will be adjusted, where possible.
Before the migration can start, all forms, reports, queries and tables belonging to the document must be closed. Press 'Next' to do so.</property>
<property name="wrap">True</property>
<property name="max_width_chars">64</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="closedocerror">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes" context="preparepage|closedocerror">Not all objects could be closed. Please close them manually, and re-start the wizard.</property>
<property name="wrap">True</property>
<property name="max_width_chars">64</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
</object>
</interface>
-82
View File
@@ -1,82 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface domain="dba">
<requires lib="gtk+" version="3.18"/>
<object class="GtkGrid" id="SummaryPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="border_width">6</property>
<property name="row_spacing">12</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="summarypage|label1">Summary</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="success">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes" context="summarypage|success">The migration was successful. Below is a log of the actions which have been taken to your document.</property>
<property name="wrap">True</property>
<property name="max_width_chars">64</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="failure">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes" context="summarypage|failure">The migration was not successful. Examine the migration log below for details.</property>
<property name="wrap">True</property>
<property name="max_width_chars">64</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTextView" id="textview:border">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="editable">False</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
</object>
</interface>
-45
View File
@@ -78,53 +78,8 @@ namespace svx
::std::unique_ptr< DatabaseLocationInputController_Impl >
m_pImpl;
};
//= SvxDatabaseLocationInputController
class SvxDatabaseLocationInputController_Impl;
/** helper class to control controls needed to input a database location
If you allow, in your dialog, to save a database document, then you usually
have a OFileURLControl for inputting the actual location, and a push button
to browse for a location.
This helper class controls such two UI elements.
*/
class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxDatabaseLocationInputController
{
public:
SvxDatabaseLocationInputController(
const css::uno::Reference<css::uno::XComponentContext>& _rContext,
::svt::OFileURLControl& _rLocationInput,
PushButton& _rBrowseButton
);
~SvxDatabaseLocationInputController();
/** sets the given URL at the input control, after translating it into a system path
*/
void setURL( const OUString& _rURL );
/** returns the current database location, in form of a URL (not a system path)
*/
OUString getURL() const;
/** prepares committing the database location entered in the input field
Effectively, this method checks whether the file in the location already
exists, and if so, it asks the user whether to overwrite it.
If the method is called multiple times, this check only happens when the location
changed since the last call.
*/
bool prepareCommit();
private:
::std::unique_ptr< SvxDatabaseLocationInputController_Impl >
m_pImpl;
};
}
#endif // INCLUDED_SVX_DATABASELOCATIONINPUT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-1
View File
@@ -352,7 +352,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/sdb,\
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/sdb/application,\
CopyTableWizard \
MacroMigrationWizard \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/sdb/tools,\
ConnectionTools \
@@ -1,43 +0,0 @@
/* -*- 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/.
*
* 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 .
*/
#ifndef __com_sun_star_sdb_application_MacroMigrationWizard_idl__
#define __com_sun_star_sdb_application_MacroMigrationWizard_idl__
#include <com/sun/star/ui/dialogs/XExecutableDialog.idl>
#include <com/sun/star/sdb/XOfficeDatabaseDocument.idl>
module com { module sun { module star { module sdb { module application {
/**
@since LibreOffice 4.1
*/
service MacroMigrationWizard : com::sun::star::ui::dialogs::XExecutableDialog
{
createWithDocument([in] com::sun::star::sdb::XOfficeDatabaseDocument Document);
};
}; }; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -480,11 +480,6 @@
<value>1</value>
</prop>
</node>
<node oor:name=".uno:DBMigrateScripts" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Migrate Macros ...</value>
</prop>
</node>
<node oor:name=".uno:DSBEditDoc" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Edit Data</value>
-1
View File
@@ -262,7 +262,6 @@ $(eval $(call gb_Rdb_add_components,services,\
connectivity/source/drivers/mysql_jdbc/mysql_jdbc \
connectivity/source/manager/sdbc2 \
connectivity/source/drivers/writer/writer \
dbaccess/source/ext/macromigration/dbmm \
dbaccess/source/filter/xml/dbaxml \
dbaccess/util/dba \
dbaccess/util/dbu \
-24
View File
@@ -2933,8 +2933,6 @@ dbaccess/inc/pch/precompiled_dba.cxx
dbaccess/inc/pch/precompiled_dba.hxx
dbaccess/inc/pch/precompiled_dbaxml.cxx
dbaccess/inc/pch/precompiled_dbaxml.hxx
dbaccess/inc/pch/precompiled_dbmm.cxx
dbaccess/inc/pch/precompiled_dbmm.hxx
dbaccess/inc/pch/precompiled_dbu.cxx
dbaccess/inc/pch/precompiled_dbu.hxx
dbaccess/inc/pch/precompiled_sdbt.cxx
@@ -3103,28 +3101,6 @@ dbaccess/source/core/recovery/subcomponentrecovery.cxx
dbaccess/source/core/recovery/subcomponentrecovery.hxx
dbaccess/source/core/recovery/subcomponents.hxx
dbaccess/source/core/resource/core_resource.cxx
dbaccess/source/ext/macromigration/dbmm_services.cxx
dbaccess/source/ext/macromigration/dbmm_types.cxx
dbaccess/source/ext/macromigration/dbmm_types.hxx
dbaccess/source/ext/macromigration/docinteraction.cxx
dbaccess/source/ext/macromigration/docinteraction.hxx
dbaccess/source/ext/macromigration/macromigrationdialog.cxx
dbaccess/source/ext/macromigration/macromigrationdialog.hxx
dbaccess/source/ext/macromigration/macromigrationpages.cxx
dbaccess/source/ext/macromigration/macromigrationpages.hxx
dbaccess/source/ext/macromigration/macromigrationwizard.cxx
dbaccess/source/ext/macromigration/macromigrationwizard.hxx
dbaccess/source/ext/macromigration/migrationengine.cxx
dbaccess/source/ext/macromigration/migrationengine.hxx
dbaccess/source/ext/macromigration/migrationerror.hxx
dbaccess/source/ext/macromigration/migrationlog.cxx
dbaccess/source/ext/macromigration/migrationlog.hxx
dbaccess/source/ext/macromigration/migrationprogress.hxx
dbaccess/source/ext/macromigration/progresscapture.cxx
dbaccess/source/ext/macromigration/progresscapture.hxx
dbaccess/source/ext/macromigration/progressmixer.cxx
dbaccess/source/ext/macromigration/progressmixer.hxx
dbaccess/source/ext/macromigration/rangeprogressbar.hxx
dbaccess/source/filter/xml/dbloader2.cxx
dbaccess/source/filter/xml/xmlAutoStyle.cxx
dbaccess/source/filter/xml/xmlAutoStyle.hxx
-216
View File
@@ -247,222 +247,6 @@ namespace svx
{
return m_pImpl->getURL();
}
class SvxDatabaseLocationInputController_Impl
{
public:
SvxDatabaseLocationInputController_Impl(
const Reference<XComponentContext>& _rContext,
::svt::OFileURLControl& _rLocationInput,
PushButton& _rBrowseButton
);
~SvxDatabaseLocationInputController_Impl();
bool prepareCommit();
void setURL( const OUString& _rURL );
OUString getURL() const;
private:
void impl_initFilterProperties_nothrow();
void impl_onBrowseButtonClicked();
OUString impl_getCurrentURL() const;
DECL_LINK( OnControlAction, VclWindowEvent&, void );
private:
const Reference<XComponentContext> m_xContext;
::svt::OFileURLControl& m_rLocationInput;
PushButton& m_rBrowseButton;
Sequence< OUString > m_aFilterExtensions;
OUString m_sFilterUIName;
bool m_bNeedExistenceCheck;
};
SvxDatabaseLocationInputController_Impl::SvxDatabaseLocationInputController_Impl(const Reference<XComponentContext>& _rContext,
::svt::OFileURLControl& _rLocationInput,
PushButton& _rBrowseButton)
:m_xContext( _rContext )
,m_rLocationInput( _rLocationInput )
,m_rBrowseButton( _rBrowseButton )
,m_aFilterExtensions()
,m_sFilterUIName()
,m_bNeedExistenceCheck( true )
{
impl_initFilterProperties_nothrow();
// forward the allowed extensions to the input control
OUStringBuffer aExtensionList;
for ( auto const & extension : std::as_const(m_aFilterExtensions) )
{
aExtensionList.append( extension );
aExtensionList.append( ';' );
}
m_rLocationInput.SetFilter( aExtensionList.makeStringAndClear() );
m_rBrowseButton.AddEventListener( LINK( this, SvxDatabaseLocationInputController_Impl, OnControlAction ) );
m_rLocationInput.AddEventListener( LINK( this, SvxDatabaseLocationInputController_Impl, OnControlAction ) );
}
SvxDatabaseLocationInputController_Impl::~SvxDatabaseLocationInputController_Impl()
{
m_rBrowseButton.RemoveEventListener( LINK( this, SvxDatabaseLocationInputController_Impl, OnControlAction ) );
m_rLocationInput.RemoveEventListener( LINK( this, SvxDatabaseLocationInputController_Impl, OnControlAction ) );
}
bool SvxDatabaseLocationInputController_Impl::prepareCommit()
{
OUString sURL( impl_getCurrentURL() );
if ( sURL.isEmpty() )
return false;
// check if the name exists
if ( m_bNeedExistenceCheck )
{
if ( ::utl::UCBContentHelper::Exists( sURL ) )
{
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(m_rLocationInput.GetFrameWeld(),
VclMessageType::Question, VclButtonsType::YesNo,
SvxResId(RID_STR_ALREADYEXISTOVERWRITE)));
if (xQueryBox->run() != RET_YES)
return false;
}
}
return true;
}
void SvxDatabaseLocationInputController_Impl::setURL( const OUString& _rURL )
{
::svt::OFileNotation aTransformer( _rURL );
m_rLocationInput.SetText( aTransformer.get( ::svt::OFileNotation::N_SYSTEM ) );
}
OUString SvxDatabaseLocationInputController_Impl::getURL() const
{
return impl_getCurrentURL();
}
void SvxDatabaseLocationInputController_Impl::impl_initFilterProperties_nothrow()
{
try
{
// get the name of the default filter for database documents
::utl::OConfigurationTreeRoot aConfig(
::utl::OConfigurationTreeRoot::createWithComponentContext(
m_xContext,
"/org.openoffice.Setup/Office/Factories/com.sun.star.sdb.OfficeDatabaseDocument"
) );
OUString sDatabaseFilter;
OSL_VERIFY( aConfig.getNodeValue( "ooSetupFactoryActualFilter" ) >>= sDatabaseFilter );
// get the type this filter is responsible for
Reference< XNameAccess > xFilterFactory(
m_xContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.FilterFactory", m_xContext),
UNO_QUERY_THROW );
::comphelper::NamedValueCollection aFilterProperties( xFilterFactory->getByName( sDatabaseFilter ) );
OUString sDocumentType = aFilterProperties.getOrDefault( "Type", OUString() );
// get the extension(s) for this type
Reference< XNameAccess > xTypeDetection(
m_xContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.TypeDetection", m_xContext),
UNO_QUERY_THROW );
::comphelper::NamedValueCollection aTypeProperties( xTypeDetection->getByName( sDocumentType ) );
m_aFilterExtensions = aTypeProperties.getOrDefault( "Extensions", m_aFilterExtensions );
m_sFilterUIName = aTypeProperties.getOrDefault( "UIName", m_sFilterUIName );
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION("svx");
}
// ensure we have at least one extension
OSL_ENSURE( m_aFilterExtensions.hasElements(),
"DatabaseLocationInputController_Impl::impl_initFilterProperties_nothrow: unable to determine the file extension(s)!" );
if ( !m_aFilterExtensions.hasElements() )
{
m_aFilterExtensions.realloc(1);
m_aFilterExtensions[0] = "*.odb";
}
}
IMPL_LINK( SvxDatabaseLocationInputController_Impl, OnControlAction, VclWindowEvent&, _rEvent, void )
{
if ( ( _rEvent.GetWindow() == &m_rBrowseButton )
&& ( _rEvent.GetId() == VclEventId::ButtonClick )
)
{
impl_onBrowseButtonClicked();
}
if ( ( _rEvent.GetWindow() == &m_rLocationInput )
&& ( _rEvent.GetId() == VclEventId::EditModify )
)
{
m_bNeedExistenceCheck = true;
}
}
OUString SvxDatabaseLocationInputController_Impl::impl_getCurrentURL() const
{
OUString sCurrentFile( m_rLocationInput.GetText() );
if ( !sCurrentFile.isEmpty() )
{
::svt::OFileNotation aCurrentFile( sCurrentFile );
sCurrentFile = aCurrentFile.get( ::svt::OFileNotation::N_URL );
}
return sCurrentFile;
}
void SvxDatabaseLocationInputController_Impl::impl_onBrowseButtonClicked()
{
::sfx2::FileDialogHelper aFileDlg(
TemplateDescription::FILESAVE_AUTOEXTENSION,
FileDialogFlags::NONE,
m_rLocationInput.GetFrameWeld()
);
aFileDlg.SetDisplayDirectory( impl_getCurrentURL() );
aFileDlg.AddFilter( m_sFilterUIName, "*." + m_aFilterExtensions[0] );
aFileDlg.SetCurrentFilter( m_sFilterUIName );
if ( aFileDlg.Execute() == ERRCODE_NONE )
{
INetURLObject aURL( aFileDlg.GetPath() );
if( aURL.GetProtocol() != INetProtocol::NotValid )
{
::svt::OFileNotation aFileNotation( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
m_rLocationInput.SetText( aFileNotation.get( ::svt::OFileNotation::N_SYSTEM ) );
m_rLocationInput.GetModifyHdl().Call( m_rLocationInput );
// the dialog already checked for the file's existence, so we don't need to, again
m_bNeedExistenceCheck = false;
}
}
}
SvxDatabaseLocationInputController::SvxDatabaseLocationInputController( const Reference<XComponentContext>& _rContext,
::svt::OFileURLControl& _rLocationInput, PushButton& _rBrowseButton )
:m_pImpl( new SvxDatabaseLocationInputController_Impl( _rContext, _rLocationInput, _rBrowseButton ) )
{
}
SvxDatabaseLocationInputController::~SvxDatabaseLocationInputController()
{
}
bool SvxDatabaseLocationInputController::prepareCommit()
{
return m_pImpl->prepareCommit();
}
void SvxDatabaseLocationInputController::setURL( const OUString& _rURL )
{
m_pImpl->setURL( _rURL );
}
OUString SvxDatabaseLocationInputController::getURL() const
{
return m_pImpl->getURL();
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */