[Libreoffice-commits] core.git: Branch 'distro/mimo/mimo-7-2' - sw/source

2022-10-19 Thread Khaled Hosny (via logerrit)
 sw/source/core/doc/DocumentStylePoolManager.cxx |   15 ---
 1 file changed, 15 deletions(-)

New commits:
commit 8ce861e51f40dad749af313fe7f485666205c81a
Author: Khaled Hosny 
AuthorDate: Mon Oct 3 13:06:19 2022 +0200
Commit: Aron Budea 
CommitDate: Wed Oct 19 14:13:14 2022 +0200

tdf#126657, tdf#145104: Don’t set language to none on defined styles

Language is used for more things than spell checking (localized digits,
accessibility, OpenType layout, and probably more).

A better way is needed to disable spell checking for parts of the
document by default while keeping the language alone, but right now I’m
reverting these changes because they are workarounds for essentially
cosmetic issues.

This reverts the following commits:

commit ca91beb9d983754a5cba9e3df1bf18295e6640a0
Author: Vladimir Glazounov 
Date:   Wed Jun 4 08:50:40 2008 +

INTEGRATION: CWS sw30bf04 (1.51.2); FILE MERGED
2008/05/13 07:20:17 fme 1.51.2.1: #i40133# rail: Set internet link 
style language to none to prevent spell checking

commit 137a1d5380e310a43d36932c643e1331a94fd70d
Author: Heiko Tietze 
Date:   Mon Jul 19 16:40:50 2021 +0200

Resolves tdf#143066 - Language set to None for indices

Change-Id: Idc9455f3f04e661bd00a9829dd0f0916844dc8eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140902
Tested-by: Jenkins
Reviewed-by: خالد حسني 
(cherry picked from commit 2cca160f8bfc4597cf0ad3aaaf0017a5210ea0ec)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140958
(cherry picked from commit 7199097b1602f057129a12b3771220c1bc23fd1e)

diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx 
b/sw/source/core/doc/DocumentStylePoolManager.cxx
index 1971b15e509e..a8107b78dd0c 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -820,14 +820,6 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
 aSet.Put( SvxWidowsItem( 0, RES_PARATR_WIDOWS ) );
 aSet.Put( SvxOrphansItem( 0, RES_PARATR_ORPHANS ) );
 }
-// tdf#143066 : set language to 'none' to prevent spell 
checking for indices
-if (nId == RES_POOLCOLL_REGISTER_BASE)
-{
-aSet.Put( SvxLanguageItem( LANGUAGE_NONE, 
RES_CHRATR_LANGUAGE ) );
-aSet.Put( SvxLanguageItem( LANGUAGE_NONE, 
RES_CHRATR_CJK_LANGUAGE ) );
-aSet.Put( SvxLanguageItem( LANGUAGE_NONE, 
RES_CHRATR_CTL_LANGUAGE ) );
-}
-break;
 }
 break;
 
@@ -1556,19 +1548,12 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( 
sal_uInt16 nId )
 {
 aSet.Put( SvxColorItem( COL_BLUE, RES_CHRATR_COLOR ) );
 aSet.Put( SvxUnderlineItem( LINESTYLE_SINGLE, RES_CHRATR_UNDERLINE 
) );
-// i40133: patch submitted by rail: set language to 'none' to 
prevent spell checking:
-aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_LANGUAGE ) );
-aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_CJK_LANGUAGE 
) );
-aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_CTL_LANGUAGE 
) );
 }
 break;
 case RES_POOLCHR_INET_VISIT:
 {
 aSet.Put( SvxColorItem( COL_RED, RES_CHRATR_COLOR ) );
 aSet.Put( SvxUnderlineItem( LINESTYLE_SINGLE, RES_CHRATR_UNDERLINE 
) );
-aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_LANGUAGE ) );
-aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_CJK_LANGUAGE 
) );
-aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_CTL_LANGUAGE 
) );
 }
 break;
 case RES_POOLCHR_JUMPEDIT:


[Libreoffice-commits] core.git: Branch 'distro/mimo/mimo-7-2' - sw/source

2022-07-22 Thread Gülşah Köse (via logerrit)
 sw/source/uibase/dbui/dbmgr.cxx |   37 ++---
 1 file changed, 18 insertions(+), 19 deletions(-)

New commits:
commit e954b945536fdf0fd4aa3d56aec5c1e2ce4c6196
Author: Gülşah Köse 
AuthorDate: Fri Jul 8 14:48:27 2022 +0300
Commit: Aron Budea 
CommitDate: Fri Jul 22 19:06:37 2022 +0200

tdf#149915 Proper creation of vnd.sun.star.pkg:// URL

Using different methods of creation (one using DecodeMechanism::NONE,
another using DecodeMechanism::WithCharset) gave differently encoded
end results, comparing unequal.

The proper way is using DecodeMechanism::NONE on the document's URL,
as implemented in commit 06756e412b2a02030ce3355b3fe4e2ecc71d2301
  Author Mike Kaganski 
  Date   Sat Nov 18 22:41:40 2017 +0300
One more proper construction of vnd.sun.star.pkg URL

Co-authored-by: Mike Kaganski 

Change-Id: I272f277ef8b4bd23e6cb7884e68f3c79f742683a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136901
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
(cherry picked from commit 9790585a62cb55e0e0024819596592193a6de269)

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 475388d2134e..9ad6184de3ac 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -134,6 +134,21 @@ void lcl_emitEvent(SfxEventHintId nEventId, sal_Int32 
nStrId, SfxObjectShell* pD
pDocShell));
 }
 
+// Construct vnd.sun.star.pkg:// URL
+OUString ConstructVndSunStarPkgUrl(const OUString& rMainURL, 
std::u16string_view rStreamRelPath)
+{
+auto xContext(comphelper::getProcessComponentContext());
+auto xUri = 
css::uri::UriReferenceFactory::create(xContext)->parse(rMainURL);
+assert(xUri.is());
+xUri = css::uri::VndSunStarPkgUrlReferenceFactory::create(xContext)
+->createVndSunStarPkgUrlReference(xUri);
+assert(xUri.is());
+return xUri->getUriReference() + "/"
++ INetURLObject::encode(
+rStreamRelPath, INetURLObject::PART_FPATH,
+INetURLObject::EncodeMechanism::All);
+}
+
 }
 
 std::vector> 
SwDBManager::m_aUncommittedRegistrations;
@@ -254,10 +269,9 @@ void SAL_CALL 
SwDataSourceRemovedListener::revokedDatabaseLocation(const sdb::Da
 if (!pDocShell)
 return;
 
-OUString aOwnURL = 
pDocShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::WithCharset);
-OUString sTmpName = "vnd.sun.star.pkg://" +
-INetURLObject::encode(aOwnURL, INetURLObject::PART_AUTHORITY, 
INetURLObject::EncodeMechanism::All);
-sTmpName += "/" + m_pDBManager->getEmbeddedName();
+const OUString sTmpName = ConstructVndSunStarPkgUrl(
+
pDocShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::NONE),
+m_pDBManager->getEmbeddedName());
 
 if (sTmpName != rEvent.OldLocation)
 return;
@@ -2760,21 +2774,6 @@ OUString LoadAndRegisterDataSource_Impl(DBConnURIType 
type, const uno::Reference
 }
 return sFind;
 }
-
-// Construct vnd.sun.star.pkg:// URL
-OUString ConstructVndSunStarPkgUrl(const OUString& rMainURL, 
std::u16string_view rStreamRelPath)
-{
-auto xContext(comphelper::getProcessComponentContext());
-auto xUri = 
css::uri::UriReferenceFactory::create(xContext)->parse(rMainURL);
-assert(xUri.is());
-xUri = css::uri::VndSunStarPkgUrlReferenceFactory::create(xContext)
-->createVndSunStarPkgUrlReference(xUri);
-assert(xUri.is());
-return xUri->getUriReference() + "/"
-+ INetURLObject::encode(
-rStreamRelPath, INetURLObject::PART_FPATH,
-INetURLObject::EncodeMechanism::All);
-}
 }
 
 OUString SwDBManager::LoadAndRegisterDataSource(weld::Window* pParent, 
SwDocShell* pDocShell)


[Libreoffice-commits] core.git: Branch 'distro/mimo/mimo-7-2' - sw/source

2022-05-27 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/dochdl/swdtflvr.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 7f9fd86e01f2d4a70c2ce5a2c69994f2eeb05f65
Author: Szymon Kłos 
AuthorDate: Fri May 27 14:50:21 2022 +0200
Commit: Andras Timar 
CommitDate: Fri May 27 20:34:18 2022 +0200

tdf#145875 don't open Insert section dialog when pasting image

This happens when we "copy image" in Firefox of the resource which
cannot be accessed without logging in on some website.

In that case we used HTML format and that resulted in pasting
login webpage as a section.

This patch detects simple HTML containing only an image while it also
contains BITMAP format in the clipboard which we can use directly.
That way we paste image data from the clipboard.

Change-Id: Ia2ee7e246f8c71e1d0958c6c955ec056a0a96f8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135040
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index fadba4319510..f131f6e8091e 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -1487,6 +1487,11 @@ bool SwTransferable::Paste(SwWrtShell& rSh, 
TransferableDataHelper& rData, RndSt
  );
 }
 
+// when HTML is just an image don't generate new section
+if (rData.HasFormat(SotClipboardFormatId::HTML_SIMPLE) && 
rData.HasFormat(SotClipboardFormatId::HTML_NO_COMMENT)
+&& rData.HasFormat(SotClipboardFormatId::BITMAP) && nFormat == 
SotClipboardFormatId::FILE_LIST)
+nFormat = SotClipboardFormatId::BITMAP;
+
 // tdf#37223 avoid non-native insertion of Calc worksheets in the 
following cases:
 // content of 1-cell worksheets are inserted as simple text using RTF 
format,
 // bigger worksheets within native (Writer) table cells are inserted as 
native tables,