summaryrefslogtreecommitdiff
path: root/editeng/source/misc
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-07-12 08:53:35 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-07-12 13:39:33 +0200
commit9945c2458d75947b94e9cdb45b7aca7ed6336c12 (patch)
treed2c49423cf9b298752ec69d9ad3dbb22e4022f98 /editeng/source/misc
parent60dffd80468e5ca4471bc67d02c58c8c784a86f1 (diff)
Move remove url code to editeng
so that the code can be reused by sc and sw Change-Id: I0d3c778c7bb7847fcf690d0e76994afdd0645285 Reviewed-on: https://gerrit.libreoffice.org/75477 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'editeng/source/misc')
-rw-r--r--editeng/source/misc/urlfieldhelper.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/editeng/source/misc/urlfieldhelper.cxx b/editeng/source/misc/urlfieldhelper.cxx
new file mode 100644
index 000000000000..961a946ca142
--- /dev/null
+++ b/editeng/source/misc/urlfieldhelper.cxx
@@ -0,0 +1,27 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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 <editeng/urlfieldhelper.hxx>
+
+#include <editeng/flditem.hxx>
+
+void URLFieldHelper::RemoveURLField(Outliner* pOutl, OutlinerView* pOLV)
+{
+ if (!pOutl || !pOLV)
+ return;
+
+ const SvxFieldData* pField = pOLV->GetFieldAtCursor();
+ if (auto pUrlField = dynamic_cast<const SvxURLField*>(pField))
+ {
+ ESelection aSel = pOLV->GetSelection();
+ pOutl->QuickInsertText(pUrlField->GetRepresentation(), aSel);
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */