[Libreoffice-commits] core.git: 2 commits - cui/source download.lst external/libetonyek
Caolán McNamara
caolanm at redhat.com
Tue Apr 17 19:42:57 UTC 2018
cui/source/dialogs/hldocntp.cxx | 180 +++++-----
cui/source/inc/hldocntp.hxx | 1
download.lst | 6
external/libetonyek/0001-add-missing-include-for-std-min.patch.1 | 25 -
external/libetonyek/Library_etonyek.mk | 27 +
external/libetonyek/UnpackedTarball_libetonyek.mk | 3
external/libetonyek/c++17.patch | 11
external/libetonyek/ubsan.patch | 8
external/libetonyek/warnings.patch | 11
9 files changed, 149 insertions(+), 123 deletions(-)
New commits:
commit ce07d65f1fec8d536dcadcb0e8e13f969c05d9c8
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Apr 10 17:09:57 2018 +0100
grab an early libetonyek-0.1.8 snapshot
Change-Id: Ib31a8cb75f4cebcaa974b95097270362b3b26aef
Reviewed-on: https://gerrit.libreoffice.org/52689
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/download.lst b/download.lst
index 354c39285f43..0a1fa65396d1 100644
--- a/download.lst
+++ b/download.lst
@@ -39,9 +39,9 @@ export EPM_SHA256SUM := b3fc4c5445de6c9a801504a3ea3efb2d4ea9d5a622c9427e716736e7
export EPM_TARBALL := 3ade8cfe7e59ca8e65052644fed9fca4-epm-3.7.tar.gz
export EPUBGEN_SHA256SUM := 730bd1cbeee166334faadbc06c953a67b145c3c4754a3b503482066dae4cd633
export EPUBGEN_TARBALL := libepubgen-0.1.0.tar.bz2
-export ETONYEK_SHA256SUM := 69dbe10d4426d52f09060d489f8eb90dfa1df592e82eb0698d9dbaf38cc734ac
-export ETONYEK_VERSION_MICRO := 7
-export ETONYEK_TARBALL := libetonyek-0.1.$(ETONYEK_VERSION_MICRO).tar.xz
+export ETONYEK_SHA256SUM := 8a70cc83a9ee031444f9c891609b1cc11e20e2d6b41ae02d17d8f1ca8a68c4f2
+export ETONYEK_VERSION_MICRO := 8
+export ETONYEK_TARBALL := libetonyek-0.1.$(ETONYEK_VERSION_MICRO)-snapshot1.tar.xz
export EXPAT_SHA256SUM := d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6
export EXPAT_TARBALL := expat-2.2.5.tar.bz2
export FIREBIRD_SHA256SUM := 6994be3555e23226630c587444be19d309b25b0fcf1f87df3b4e3f88943e5860
diff --git a/external/libetonyek/0001-add-missing-include-for-std-min.patch.1 b/external/libetonyek/0001-add-missing-include-for-std-min.patch.1
deleted file mode 100644
index dc3e70988d56..000000000000
--- a/external/libetonyek/0001-add-missing-include-for-std-min.patch.1
+++ /dev/null
@@ -1,25 +0,0 @@
-From cc71d75b4d9b88b5c920cd039bab3e707e71568b Mon Sep 17 00:00:00 2001
-From: David Tardon <dtardon at redhat.com>
-Date: Mon, 23 Oct 2017 12:55:43 +0200
-Subject: [PATCH] add missing include for std::min
-
-Change-Id: I2088057657f3ce23b91dbbc7b4f5840914dbcaa8
----
- src/lib/IWASnappyStream.cpp | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/lib/IWASnappyStream.cpp b/src/lib/IWASnappyStream.cpp
-index 7b28681..9cc84c3 100644
---- a/src/lib/IWASnappyStream.cpp
-+++ b/src/lib/IWASnappyStream.cpp
-@@ -9,6 +9,7 @@
-
- #include "IWASnappyStream.h"
-
-+#include <algorithm>
- #include <cassert>
- #include <limits>
- #include <memory>
---
-2.14.1
-
diff --git a/external/libetonyek/Library_etonyek.mk b/external/libetonyek/Library_etonyek.mk
index b79d3603bffe..414b2d02b707 100644
--- a/external/libetonyek/Library_etonyek.mk
+++ b/external/libetonyek/Library_etonyek.mk
@@ -43,6 +43,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,etonyek,\
UnpackedTarball/libetonyek/src/lib/EtonyekDocument \
UnpackedTarball/libetonyek/src/lib/IWAField \
UnpackedTarball/libetonyek/src/lib/IWAMessage \
+ UnpackedTarball/libetonyek/src/lib/IWAObjectIndex \
UnpackedTarball/libetonyek/src/lib/IWAParser \
UnpackedTarball/libetonyek/src/lib/IWAReader \
UnpackedTarball/libetonyek/src/lib/IWASnappyStream \
@@ -84,15 +85,17 @@ $(eval $(call gb_Library_add_generated_exception_objects,etonyek,\
UnpackedTarball/libetonyek/src/lib/IWORKXMLContextBase \
UnpackedTarball/libetonyek/src/lib/IWORKXMLParserState \
UnpackedTarball/libetonyek/src/lib/IWORKZlibStream \
+ UnpackedTarball/libetonyek/src/lib/KEY1Dictionary \
UnpackedTarball/libetonyek/src/lib/KEY1Parser \
+ UnpackedTarball/libetonyek/src/lib/KEY1ParserState \
UnpackedTarball/libetonyek/src/lib/KEY1Token \
- UnpackedTarball/libetonyek/src/lib/KEY2Collector \
UnpackedTarball/libetonyek/src/lib/KEY2Dictionary \
UnpackedTarball/libetonyek/src/lib/KEY2Parser \
UnpackedTarball/libetonyek/src/lib/KEY2ParserState \
UnpackedTarball/libetonyek/src/lib/KEY2Token \
UnpackedTarball/libetonyek/src/lib/KEY6Parser \
UnpackedTarball/libetonyek/src/lib/KEYCollector \
+ UnpackedTarball/libetonyek/src/lib/KEYProperties \
UnpackedTarball/libetonyek/src/lib/KEYTypes \
UnpackedTarball/libetonyek/src/lib/NUM1Dictionary \
UnpackedTarball/libetonyek/src/lib/NUM1Parser \
@@ -111,12 +114,16 @@ $(eval $(call gb_Library_add_generated_exception_objects,etonyek,\
UnpackedTarball/libetonyek/src/lib/contexts/IWORKBezierElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKBinaryElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKBrContext \
+ UnpackedTarball/libetonyek/src/lib/contexts/IWORKCalcEngineContext \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKChartInfoElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKColorElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKCoreImageFilterDescriptorElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKDataElement \
+ UnpackedTarball/libetonyek/src/lib/contexts/IWORKFieldElement \
+ UnpackedTarball/libetonyek/src/lib/contexts/IWORKFillElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKFilteredImageElement \
- UnpackedTarball/libetonyek/src/lib/contexts/IWORKFoElement \
+ UnpackedTarball/libetonyek/src/lib/contexts/IWORKFormatElement \
+ UnpackedTarball/libetonyek/src/lib/contexts/IWORKFormulaElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKGeometryElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKGroupElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKHeaderFooterContext \
@@ -124,6 +131,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,etonyek,\
UnpackedTarball/libetonyek/src/lib/contexts/IWORKImageElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKLayoutElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKLineElement \
+ UnpackedTarball/libetonyek/src/lib/contexts/IWORKLineEndElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKLinkElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKListLabelGeometriesProperty \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKListLabelGeometryElement \
@@ -131,7 +139,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,etonyek,\
UnpackedTarball/libetonyek/src/lib/contexts/IWORKListLabelTypeinfoElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKListLabelTypesProperty \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKListTextIndentsProperty \
- UnpackedTarball/libetonyek/src/lib/contexts/IWORKListstyleElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKMediaElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKMetadataElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKNumberConverter \
@@ -145,20 +152,34 @@ $(eval $(call gb_Library_add_generated_exception_objects,etonyek,\
UnpackedTarball/libetonyek/src/lib/contexts/IWORKSizeElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKSpanElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKStringElement \
+ UnpackedTarball/libetonyek/src/lib/contexts/IWORKStrokeContext \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKStyleContext \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKStyleRefContext \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKStylesContext \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKStylesheetBase \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKTabElement \
+ UnpackedTarball/libetonyek/src/lib/contexts/IWORKTableInfoElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKTabsElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKTabularInfoElement \
+ UnpackedTarball/libetonyek/src/lib/contexts/IWORKTabularModelElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKTextBodyElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKTextElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKTextLabelElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKTextStorageElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKUnfilteredElement \
+ UnpackedTarball/libetonyek/src/lib/contexts/IWORKWrapElement \
+ UnpackedTarball/libetonyek/src/lib/contexts/KEY1ContentElement \
+ UnpackedTarball/libetonyek/src/lib/contexts/KEY1DivElement \
+ UnpackedTarball/libetonyek/src/lib/contexts/KEY1FillElement \
+ UnpackedTarball/libetonyek/src/lib/contexts/KEY1SpanElement \
+ UnpackedTarball/libetonyek/src/lib/contexts/KEY1StringConverter \
+ UnpackedTarball/libetonyek/src/lib/contexts/KEY1StylesContext \
+ UnpackedTarball/libetonyek/src/lib/contexts/KEY1TableElement \
UnpackedTarball/libetonyek/src/lib/contexts/KEY2StyleContext \
+ UnpackedTarball/libetonyek/src/lib/contexts/PAG1AnnotationContext \
+ UnpackedTarball/libetonyek/src/lib/contexts/PAG1AnnotationElement \
UnpackedTarball/libetonyek/src/lib/contexts/PAG1FootnotesElement \
+ UnpackedTarball/libetonyek/src/lib/contexts/PAG1ShapeContext \
UnpackedTarball/libetonyek/src/lib/contexts/PAG1StyleContext \
UnpackedTarball/libetonyek/src/lib/contexts/PAG1TextStorageElement \
UnpackedTarball/libetonyek/src/lib/libetonyek_utils \
diff --git a/external/libetonyek/UnpackedTarball_libetonyek.mk b/external/libetonyek/UnpackedTarball_libetonyek.mk
index 1b59b77cab97..d64d7e45212b 100644
--- a/external/libetonyek/UnpackedTarball_libetonyek.mk
+++ b/external/libetonyek/UnpackedTarball_libetonyek.mk
@@ -19,8 +19,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,libetonyek,\
external/libetonyek/win_build.patch.1 \
external/libetonyek/ubsan.patch \
external/libetonyek/rpath.patch \
- external/libetonyek/0001-add-missing-include-for-std-min.patch.1 \
- external/libetonyek/c++17.patch \
+ external/libetonyek/warnings.patch \
))
ifneq ($(OS),MACOSX)
diff --git a/external/libetonyek/c++17.patch b/external/libetonyek/c++17.patch
deleted file mode 100644
index bc4e9b96a46a..000000000000
--- a/external/libetonyek/c++17.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/lib/KEY1Token.inc
-+++ src/lib/KEY1Token.inc
-@@ -524,7 +524,7 @@
-
- if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
- {
-- register int key = hash (str, len);
-+ int key = hash (str, len);
-
- if (key <= MAX_HASH_VALUE && key >= 0)
- {
diff --git a/external/libetonyek/ubsan.patch b/external/libetonyek/ubsan.patch
index b7da70904b62..260e9f33df58 100644
--- a/external/libetonyek/ubsan.patch
+++ b/external/libetonyek/ubsan.patch
@@ -1,11 +1,11 @@
--- src/lib/libetonyek_xml.cpp
+++ src/lib/libetonyek_xml.cpp
-@@ -33,7 +33,7 @@
+@@ -35,7 +35,7 @@
unsigned long bytesRead = 0;
- const unsigned char *const bytes = input->read(len, bytesRead);
+ const unsigned char *const bytes = input->read((unsigned long)len, bytesRead);
-- std::memcpy(buffer, bytes, static_cast<int>(bytesRead));
-+ if (bytesRead != 0) std::memcpy(buffer, bytes, static_cast<int>(bytesRead));
+- std::memcpy(buffer, bytes, static_cast<size_t>(bytesRead));
++ if (bytesRead != 0) std::memcpy(buffer, bytes, static_cast<size_t>(bytesRead));
return static_cast<int>(bytesRead);
}
catch (...)
diff --git a/external/libetonyek/warnings.patch b/external/libetonyek/warnings.patch
new file mode 100644
index 000000000000..841d70cb68e8
--- /dev/null
+++ b/external/libetonyek/warnings.patch
@@ -0,0 +1,11 @@
+--- src/lib/IWORKXMLContext.cpp
++++ src/lib/IWORKXMLContext.cpp
+@@ -18,7 +18,7 @@
+ {
+ }
+
+-void IWORKXMLContext::CDATA(const char */*value*/)
++void IWORKXMLContext::CDATA(const char * /*value*/)
+ {
+ ETONYEK_DEBUG_MSG(("IWORKXMLContext::cData: find unexpected CDATA block\n"));
+ }
commit e3e447ed6fcbdf22c16fbe78c0dcf944bedac39a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Apr 17 17:02:11 2018 +0100
Resolves: tdf#116928 dispatch hyperlink dialog new doc in idle callback
collect up all the piece of data that the dispatch requires and launch
it in an idle. So if a dialog appears its embedded mainloop will not return
to body if the deleted SvxHyperlinkNewDocTp
Change-Id: Ie978bc552c3b88dc11eae2ec49417cc8bd0f02bc
Reviewed-on: https://gerrit.libreoffice.org/53056
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 965198480d95..962298168b49 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -21,6 +21,7 @@
#include <osl/file.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/docfac.hxx>
+#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -286,6 +287,83 @@ bool SvxHyperlinkNewDocTp::AskApply()
return bRet;
}
+namespace
+{
+ struct ExecuteInfo
+ {
+ bool bRbtEditLater;
+ bool bRbtEditNow;
+ INetURLObject aURL;
+ OUString aStrDocName;
+ // current document
+ css::uno::Reference<css::frame::XFrame> xFrame;
+ SfxDispatcher* pDispatcher;
+ };
+}
+
+IMPL_STATIC_LINK(SvxHyperlinkNewDocTp, DispatchDocument, void*, p, void)
+{
+ std::unique_ptr<ExecuteInfo> xExecuteInfo(static_cast<ExecuteInfo*>(p));
+ if (!xExecuteInfo->xFrame.is())
+ return;
+ try
+ {
+ //if it throws dispatcher is invalid
+ css::uno::Reference<css::awt::XTopWindow>(xExecuteInfo->xFrame->getContainerWindow(), css::uno::UNO_QUERY_THROW);
+
+ SfxViewFrame *pViewFrame = nullptr;
+
+ // create items
+ SfxStringItem aName( SID_FILE_NAME, xExecuteInfo->aStrDocName );
+ SfxStringItem aReferer( SID_REFERER, OUString("private:user") );
+ SfxStringItem aFrame( SID_TARGETNAME, OUString("_blank") );
+
+ OUString aStrFlags('S');
+ if (xExecuteInfo->bRbtEditLater)
+ {
+ aStrFlags += "H";
+ }
+ SfxStringItem aFlags (SID_OPTIONS, aStrFlags);
+
+ // open url
+ const SfxPoolItem* pReturn = xExecuteInfo->pDispatcher->ExecuteList(
+ SID_OPENDOC, SfxCallMode::SYNCHRON,
+ { &aName, &aFlags, &aFrame, &aReferer });
+
+ // save new doc
+ const SfxViewFrameItem *pItem = dynamic_cast<const SfxViewFrameItem*>( pReturn ); // SJ: pReturn is NULL if the Hyperlink
+ if ( pItem ) // creation is cancelled #106216#
+ {
+ pViewFrame = pItem->GetFrame();
+ if (pViewFrame)
+ {
+ SfxStringItem aNewName( SID_FILE_NAME, xExecuteInfo->aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
+ SfxUnoFrameItem aDocFrame( SID_FILLFRAME, pViewFrame->GetFrame().GetFrameInterface() );
+ fprintf(stderr, "is there a frame int %p\n", pViewFrame->GetFrame().GetFrameInterface().get() );
+ pViewFrame->GetDispatcher()->ExecuteList(
+ SID_SAVEASDOC, SfxCallMode::SYNCHRON,
+ { &aNewName }, { &aDocFrame });
+ }
+ }
+
+ if (xExecuteInfo->bRbtEditNow)
+ {
+ css::uno::Reference<css::awt::XTopWindow> xWindow(xExecuteInfo->xFrame->getContainerWindow(), css::uno::UNO_QUERY);
+ if (xWindow.is()) //will be false if the frame was exited while the document was loading (e.g. we waited for warning dialogs)
+ xWindow->toFront();
+ }
+
+ if (pViewFrame && xExecuteInfo->bRbtEditLater)
+ {
+ SfxObjectShell* pObjShell = pViewFrame->GetObjectShell();
+ pObjShell->DoClose();
+ }
+ }
+ catch (...)
+ {
+ }
+}
+
/*************************************************************************
|*
|* Any action to do after apply-button is pressed
@@ -302,101 +380,53 @@ void SvxHyperlinkNewDocTp::DoApply ()
if ( aStrNewName.isEmpty() )
aStrNewName = maStrInitURL;
-
// create a real URL-String
-
INetURLObject aURL;
if ( ImplGetURLObject( aStrNewName, m_pCbbPath->GetBaseURL(), aURL ) )
{
-
-
// create Document
-
aStrNewName = aURL.GetURLPath( INetURLObject::DecodeMechanism::NONE );
- SfxViewFrame *pViewFrame = nullptr;
+ bool bCreate = true;
try
{
- bool bCreate = true;
-
// check if file exists, warn before we overwrite it
- {
- SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::READ );
+ SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::READ );
- bool bOk = pIStm && ( pIStm->GetError() == ERRCODE_NONE);
+ bool bOk = pIStm && ( pIStm->GetError() == ERRCODE_NONE);
- delete pIStm;
+ delete pIStm;
- if( bOk )
- {
- std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(GetFrameWeld(),
- VclMessageType::Warning, VclButtonsType::YesNo,
- CuiResId(RID_SVXSTR_HYPERDLG_QUERYOVERWRITE)));
- bCreate = xWarn->run() == RET_YES;
- }
- }
-
- if( bCreate )
+ if( bOk )
{
- // current document
- SfxViewFrame* pCurrentDocFrame = SfxViewFrame::Current();
-
- if ( !aStrNewName.isEmpty() )
- {
- // get private-url
- sal_Int32 nPos = m_pLbDocTypes->GetSelectedEntryPos();
- if( nPos == LISTBOX_ENTRY_NOTFOUND )
- nPos=0;
- OUString aStrDocName ( static_cast<DocumentTypeData*>(
- m_pLbDocTypes->GetEntryData( nPos ))->aStrURL );
-
- // create items
- SfxStringItem aName( SID_FILE_NAME, aStrDocName );
- SfxStringItem aReferer( SID_REFERER, OUString("private:user") );
- SfxStringItem aFrame( SID_TARGETNAME, OUString("_blank") );
-
- OUString aStrFlags('S');
- if ( m_pRbtEditLater->IsChecked() )
- {
- aStrFlags += "H";
- }
- SfxStringItem aFlags (SID_OPTIONS, aStrFlags);
-
- // open url
- const SfxPoolItem* pReturn = GetDispatcher()->ExecuteList(
- SID_OPENDOC, SfxCallMode::SYNCHRON,
- { &aName, &aFlags, &aFrame, &aReferer });
-
- // save new doc
- const SfxViewFrameItem *pItem = dynamic_cast<const SfxViewFrameItem*>( pReturn ); // SJ: pReturn is NULL if the Hyperlink
- if ( pItem ) // creation is cancelled #106216#
- {
- pViewFrame = pItem->GetFrame();
- if (pViewFrame)
- {
- SfxStringItem aNewName( SID_FILE_NAME, aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
- SfxUnoFrameItem aDocFrame( SID_FILLFRAME, pViewFrame->GetFrame().GetFrameInterface() );
-
- pViewFrame->GetDispatcher()->ExecuteList(
- SID_SAVEASDOC, SfxCallMode::SYNCHRON,
- { &aNewName }, { &aDocFrame } );
- }
- }
- }
-
- if ( m_pRbtEditNow->IsChecked() && pCurrentDocFrame )
- {
- pCurrentDocFrame->ToTop();
- }
+ std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::YesNo,
+ CuiResId(RID_SVXSTR_HYPERDLG_QUERYOVERWRITE)));
+ bCreate = xWarn->run() == RET_YES;
}
}
catch (const uno::Exception&)
{
}
- if ( pViewFrame && m_pRbtEditLater->IsChecked() )
+ if (bCreate && !aStrNewName.isEmpty())
{
- SfxObjectShell* pObjShell = pViewFrame->GetObjectShell();
- pObjShell->DoClose();
+ ExecuteInfo* pExecuteInfo = new ExecuteInfo;
+
+ pExecuteInfo->bRbtEditLater = m_pRbtEditLater->IsChecked();
+ pExecuteInfo->bRbtEditNow = m_pRbtEditNow->IsChecked();
+ // get private-url
+ sal_Int32 nPos = m_pLbDocTypes->GetSelectedEntryPos();
+ if( nPos == LISTBOX_ENTRY_NOTFOUND )
+ nPos=0;
+ pExecuteInfo->aURL = aURL;
+ pExecuteInfo->aStrDocName = static_cast<DocumentTypeData*>(
+ m_pLbDocTypes->GetEntryData( nPos ))->aStrURL;
+
+ // current document
+ pExecuteInfo->xFrame = GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface();
+ pExecuteInfo->pDispatcher = GetDispatcher();
+
+ Application::PostUserEvent(LINK(nullptr, SvxHyperlinkNewDocTp, DispatchDocument), pExecuteInfo);
}
}
diff --git a/cui/source/inc/hldocntp.hxx b/cui/source/inc/hldocntp.hxx
index c33bb85a7610..42466e5fbf0f 100644
--- a/cui/source/inc/hldocntp.hxx
+++ b/cui/source/inc/hldocntp.hxx
@@ -40,6 +40,7 @@ private:
void FillDocumentList ();
DECL_LINK (ClickNewHdl_Impl, Button*, void );
+ DECL_STATIC_LINK(SvxHyperlinkNewDocTp, DispatchDocument, void*, void);
protected:
void FillDlgFields(const OUString& rStrURL) override;
More information about the Libreoffice-commits
mailing list