core.git: editeng/source sw/source

2024-04-04 Thread Oliver Specht (via logerrit)
 editeng/source/editeng/impedit4.cxx |5 +
 sw/source/uibase/shells/textsh.cxx  |9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit ec5898cb245c68cf116a22b3714408e4a96ee15d
Author: Oliver Specht 
AuthorDate: Tue Mar 19 09:19:38 2024 +0100
Commit: Thorsten Behrens 
CommitDate: Thu Apr 4 17:27:02 2024 +0200

tdf#63259 cycle case on sentences

Cycle case will be applied to the sentence if the cursor is at
a sentence end. Writer now also keeps the word/sentence selection
after case change.

Change-Id: I9dd561775ac612689526bcb118533ba81b5722be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165018
Tested-by: Jenkins
Tested-by: Gabor Kelemen 
Reviewed-by: Thorsten Behrens 

diff --git a/editeng/source/editeng/impedit4.cxx 
b/editeng/source/editeng/impedit4.cxx
index b7e322b68ccd..b7d4be999016 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -2711,6 +2711,11 @@ EditSelection ImpEditEngine::TransliterateText( const 
EditSelection& rSelection,
 if ( !aSel.HasRange() )
 {
 aSel = SelectWord( aSel, 
css::i18n::WordType::ANYWORD_IGNOREWHITESPACES, true, true );
+if (!aSel.HasRange() && aSel.Min().GetIndex() > 0 &&
+
OUString(".!?").indexOf(aSel.Min().GetNode()->GetChar(aSel.Min().GetIndex() - 
1)) > -1 )
+{
+aSel = SelectSentence(aSel);
+}
 }
 
 // tdf#107176: if there's still no range, just return aSel
diff --git a/sw/source/uibase/shells/textsh.cxx 
b/sw/source/uibase/shells/textsh.cxx
index 5c4713736081..1b1fb47fd1f3 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -885,10 +885,13 @@ void SwTextShell::ExecRotateTransliteration( SfxRequest 
const & rReq )
 }
 else
 {
-rSh.Push(); // save cur cursor
-if ((rSh.IsEndWrd() || rSh.IsStartWord() || rSh.IsInWord()) && 
rSh.SelWrd())
+if (rSh.IsEndSentence())
+{
+rSh.BwdSentence(true);
+rSh.TransliterateText(m_aRotateCase.getNextMode());
+}
+else if ((rSh.IsEndWrd() || rSh.IsStartWord() || rSh.IsInWord()) 
&& rSh.SelWrd())
 rSh.TransliterateText(m_aRotateCase.getNextMode());
-rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
 }
 }
 }


core.git: editeng/source sw/source

2024-01-11 Thread Andreas Heinisch (via logerrit)
 editeng/source/misc/svxacorr.cxx   |2 ++
 sw/source/core/swg/SwXMLTextBlocks.cxx |2 ++
 2 files changed, 4 insertions(+)

New commits:
commit a03a9236b01437b573cb68112959b9403418e11b
Author: Andreas Heinisch 
AuthorDate: Thu Jan 11 13:09:51 2024 +0100
Commit: Andreas Heinisch 
CommitDate: Thu Jan 11 19:25:50 2024 +0100

tdf#156769 - Escape the question mark in the storage name

Otherwise, an auto-text using the question mark for its shortcut
cannot be inserted.

Change-Id: I369e3d0f2ff82cea2d053896964a5c2c23b8d6f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161921
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index ff2c4518aadd..d278b582e833 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1976,6 +1976,8 @@ static void GeneratePackageName ( std::u16string_view 
rShort, OUString& rPackage
 case ':':
 case '.':
 case '\':
+// tdf#156769 - escape the question mark in the storage name
+case '?':
 aBuf[nPos] = '_';
 break;
 default:
diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx 
b/sw/source/core/swg/SwXMLTextBlocks.cxx
index efc3e530b0f2..f69311dfdb5f 100644
--- a/sw/source/core/swg/SwXMLTextBlocks.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks.cxx
@@ -527,6 +527,8 @@ OUString SwXMLTextBlocks::GeneratePackageName ( 
std::u16string_view rShort )
 case ':':
 case '.':
 case '\':
+// tdf#156769 - escape the question mark in the storage name for 
auto-texts
+case '?':
 aBuf[nPos] = '_';
 break;
 default:


[Libreoffice-commits] core.git: editeng/source sw/source

2022-08-14 Thread Khaled Hosny (via logerrit)
 editeng/source/editeng/impedit3.cxx |   18 ++
 sw/source/core/text/porlay.cxx  |   18 ++
 2 files changed, 20 insertions(+), 16 deletions(-)

New commits:
commit 72e56537d4bb9411229346da977d1d669ccfca9a
Author: Khaled Hosny 
AuthorDate: Thu Aug 11 18:52:17 2022 +0200
Commit: Caolán McNamara 
CommitDate: Sun Aug 14 21:11:15 2022 +0200

tdf#139627: Don’t set Kashida insertion position after combining marks

We were skipping the marks when checking for previous char, but not when
setting the index to previous char.

Fixes also the second part of tdf#106653.

Change-Id: I73436ba9df6ccf104ea6d4dfbd76a59c86040a44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138154
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index d712dfa5..6195b0e8e606 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -2339,10 +2339,9 @@ void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, 
sal_Int32 nStart, sal_I
 // restore selection for proper iteration at the end of the function
 aWordSel.Max().SetIndex( nSavPos );
 
-sal_Int32 nIdx = 0;
+sal_Int32 nIdx = 0, nPrevIdx = 0;
 sal_Int32 nKashidaPos = -1;
-sal_Unicode cCh;
-sal_Unicode cPrevCh = 0;
+sal_Unicode cCh, cPrevCh = 0;
 
 int nPriorityLevel = 7;// 0..6 = level found
// 7 not found
@@ -2390,7 +2389,7 @@ void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, 
sal_Int32 nStart, sal_I
 // check if character is connectable to previous character,
 if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
 {
-nKashidaPos = aWordSel.Min().GetIndex() + nIdx - 1;
+nKashidaPos = aWordSel.Min().GetIndex() + nPrevIdx;
 nPriorityLevel = 2;
 }
 }
@@ -2411,7 +2410,7 @@ void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, 
sal_Int32 nStart, sal_I
 // check if character is connectable to previous character,
 if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
 {
-nKashidaPos = aWordSel.Min().GetIndex() + nIdx - 1;
+nKashidaPos = aWordSel.Min().GetIndex() + nPrevIdx;
 nPriorityLevel = 3;
 }
 }
@@ -2431,7 +2430,7 @@ void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, 
sal_Int32 nStart, sal_I
 // check if character is connectable to previous 
character,
 if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
 {
-nKashidaPos = aWordSel.Min().GetIndex() + nIdx - 1;
+nKashidaPos = aWordSel.Min().GetIndex() + nPrevIdx;
 nPriorityLevel = 4;
 }
 }
@@ -2453,7 +2452,7 @@ void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, 
sal_Int32 nStart, sal_I
 // check if character is connectable to previous character,
 if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
 {
-nKashidaPos = aWordSel.Min().GetIndex() + nIdx - 1;
+nKashidaPos = aWordSel.Min().GetIndex() + nPrevIdx;
 nPriorityLevel = 5;
 }
 }
@@ -2469,7 +2468,7 @@ void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, 
sal_Int32 nStart, sal_I
 // check if character is connectable to previous character,
 if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
 {
-nKashidaPos = aWordSel.Min().GetIndex() + nIdx - 1;
+nKashidaPos = aWordSel.Min().GetIndex() + nPrevIdx;
 nPriorityLevel = 6;
 }
 }
@@ -2478,7 +2477,10 @@ void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, 
sal_Int32 nStart, sal_I
 // Do not consider vowel marks when checking if a character
 // can be connected to previous character.
 if ( !isTransparentChar ( cCh) )
+{
 cPrevCh = cCh;
+nPrevIdx = nIdx;
+}
 
 ++nIdx;
 } // end of current word
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 3db6a07600e9..d1e4b967f235 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1509,10 +1509,9 @@ void SwScriptInfo::InitScriptInfo(const SwTextNode& 
rNode,
 {
 const OUString& rWord = aScanner.GetWord();
 
-sal_Int32 nIdx = 0;
+ 

[Libreoffice-commits] core.git: editeng/source sw/source

2021-02-03 Thread Pranam Lashkari (via logerrit)
 editeng/source/editeng/impedit.cxx |2 +-
 sw/source/core/crsr/crstrvl.cxx|7 +--
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 3233db0913193855285e1f56492d4617368441b6
Author: Pranam Lashkari 
AuthorDate: Mon Feb 1 22:18:01 2021 +0530
Commit: Pranam Lashkari 
CommitDate: Wed Feb 3 17:34:03 2021 +0100

enable hyperlink to be detected at the end of text

now in online hyperlink popup will appear
even when the cursor is at the end of hyperlink text

Change-Id: I80a1a093afa11e39236693f8a2639741f74c9876
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110227
Tested-by: Jenkins
Reviewed-by: Pranam Lashkari 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 389b9d5bca20..40d551eab27f 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1818,7 +1818,7 @@ const SvxFieldItem* ImpEditView::GetField( const Point& 
rPos, sal_Int32* pPara,
 for (size_t nAttr = rAttrs.size(); nAttr; )
 {
 const EditCharAttrib& rAttr = *rAttrs[--nAttr];
-if (rAttr.GetStart() == nXPos)
+if (rAttr.GetStart() == nXPos || rAttr.GetEnd() == nXPos)
 {
 if (rAttr.Which() == EE_FEATURE_FIELD)
 {
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 893233c7ec1a..9c18f16f4fbb 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1573,8 +1573,11 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
  && IsAttrAtPos::InetAttr & rContentAtPos.eContentAtPos
  && !aTmpState.m_bFootnoteNoInfo )
 {
-pTextAttr = pTextNd->GetTextAttrAt(
-aPos.nContent.GetIndex(), RES_TXTATR_INETFMT);
+sal_Int32 index = aPos.nContent.GetIndex();
+pTextAttr = pTextNd->GetTextAttrAt(index, 
RES_TXTATR_INETFMT);
+
+if(!pTextAttr && index > 0)
+pTextAttr = pTextNd->GetTextAttrAt(index - 1, 
RES_TXTATR_INETFMT);
 // "detect" only INetAttrs with URLs
 if( pTextAttr && 
!pTextAttr->GetINetFormat().GetValue().isEmpty() )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source sw/source vcl/workben

2020-11-25 Thread Stephan Bergmann (via logerrit)
 editeng/source/editeng/editdbg.cxx|2 +-
 sw/source/filter/ww8/WW8TableInfo.cxx |   16 
 vcl/workben/vcldemo.cxx   |2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 9e0de138a5afaa7132ee535a15741effc983d2b0
Author: Stephan Bergmann 
AuthorDate: Wed Nov 25 11:00:23 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Nov 25 14:07:07 2020 +0100

Use sal_Int64 to printf tools::Long values

(The "%l" format specifiers had now caused -Werror,-Wformat with clang-cl 
for a
Windows 64-bit build.)

Change-Id: I86b9617310f7348d72172cc7a29f0976c7030dd5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106576
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index cee32beafcc2..3598036e2240 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -454,7 +454,7 @@ void EditEngine::DumpData(const EditEngine* pEE, bool 
bInfoBox)
 fprintf( fp, "\nControl: %x", unsigned( pEE->GetControlWord() ) );
 fprintf( fp, "\nRefMapMode: %i", int( 
pEE->pImpEditEngine->pRefDev->GetMapMode().GetMapUnit() ) );
 fprintf( fp, "\nPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64, 
sal_Int64(pEE->GetPaperSize().Width()), sal_Int64(pEE->GetPaperSize().Height()) 
);
-fprintf( fp, "\nMaxAutoPaperSize: %li x %li", 
pEE->GetMaxAutoPaperSize().Width(), pEE->GetMaxAutoPaperSize().Height() );
+fprintf( fp, "\nMaxAutoPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64, 
sal_Int64(pEE->GetMaxAutoPaperSize().Width()), 
sal_Int64(pEE->GetMaxAutoPaperSize().Height()) );
 fprintf( fp, "\nMinAutoPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64 , 
sal_Int64(pEE->GetMinAutoPaperSize().Width()), 
sal_Int64(pEE->GetMinAutoPaperSize().Height()) );
 fprintf( fp, "\nUpdate: %i", pEE->GetUpdateMode() );
 fprintf( fp, "\nNumber of Views: %" SAL_PRI_SIZET "i", pEE->GetViewCount() 
);
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx 
b/sw/source/filter/ww8/WW8TableInfo.cxx
index 03f376fbeec9..907e4131cec0 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -998,15 +998,15 @@ std::string CellInfo::toString() const
 static char sBuffer[256];
 
 snprintf(sBuffer, sizeof(sBuffer),
- "",
- left(),
- right(),
- top(),
- bottom(),
+ sal_Int64(left()),
+ sal_Int64(right()),
+ sal_Int64(top()),
+ sal_Int64(bottom()),
  m_pNodeInfo);
 
 return sBuffer;
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 68a04d1384a9..cca89f8a2ecc 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1794,7 +1794,7 @@ public:
 virtual void Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect) override
 {
 mrRenderer.SetSizePixel(GetSizePixel());
-fprintf(stderr, "DemoWin::Paint(%ld,%ld,%ld,%ld)\n", rRect.getX(), 
rRect.getY(), rRect.getWidth(), rRect.getHeight());
+fprintf(stderr, "DemoWin::Paint(%" SAL_PRIdINT64 ",%" SAL_PRIdINT64 
",%" SAL_PRIdINT64 ",%" SAL_PRIdINT64 ")\n", sal_Int64(rRect.getX()), 
sal_Int64(rRect.getY()), sal_Int64(rRect.getWidth()), 
sal_Int64(rRect.getHeight()));
 if (mrRenderer.getIterCount() == 0)
 mrRenderer.drawToDevice(rRenderContext, GetSizePixel(), false);
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source sw/source

2019-11-21 Thread Noel Grandin (via logerrit)
 editeng/source/misc/svxacorr.cxx|1 +
 sw/source/core/swg/SwXMLTextBlocks1.cxx |   28 
 2 files changed, 9 insertions(+), 20 deletions(-)

New commits:
commit f61f00862380fed99a09a11d67fef5d8efbce368
Author: Noel Grandin 
AuthorDate: Wed Nov 20 11:32:54 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Nov 22 06:46:43 2019 +0100

log exceptions when parsing

to make debugging easier

Change-Id: Ia19384a925a2bb437fa5d961e6c3d44eebe0c6b6
Reviewed-on: https://gerrit.libreoffice.org/83345
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 24ff88d8e725..48d6676b26f2 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2181,6 +2181,7 @@ SvxAutocorrWordList* 
SvxAutoCorrectLanguageLists::LoadAutocorrWordList()
 }
 catch ( const uno::Exception& )
 {
+TOOLS_WARN_EXCEPTION("editeng", "when loading " << sShareAutoCorrFile);
 }
 
 // Set time stamp
diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx 
b/sw/source/core/swg/SwXMLTextBlocks1.cxx
index 843e545a39a0..f4880417e929 100644
--- a/sw/source/core/swg/SwXMLTextBlocks1.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -400,11 +401,12 @@ ErrCode SwXMLTextBlocks::PutBlockText( const OUString& 
rShort,
 
 void SwXMLTextBlocks::ReadInfo()
 {
-try
-{
 const OUString sDocName( XMLN_BLOCKLIST );
-if ( xBlkRoot.is() && xBlkRoot->hasByName( sDocName ) && 
xBlkRoot->isStreamElement( sDocName ) )
+try
 {
+if ( !xBlkRoot.is() || !xBlkRoot->hasByName( sDocName ) || 
!xBlkRoot->isStreamElement( sDocName ) )
+return;
+
 uno::Reference< uno::XComponentContext > xContext =
 comphelper::getProcessComponentContext();
 
@@ -425,26 +427,12 @@ void SwXMLTextBlocks::ReadInfo()
 xParser->setTokenHandler( xTokenHandler );
 
 // parse
-try
-{
-xParser->parseStream( aParserInput );
-}
-catch( xml::sax::SAXParseException&  )
-{
-// re throw ?
-}
-catch( xml::sax::SAXException&  )
-{
-// re throw ?
-}
-catch( io::IOException& )
-{
-// re throw ?
-}
-}
+xParser->parseStream( aParserInput );
 }
 catch ( uno::Exception& )
 {
+TOOLS_WARN_EXCEPTION("sw", "when loading " << sDocName);
+// re throw ?
 }
 }
 void SwXMLTextBlocks::WriteInfo()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: editeng/source sw/source

2019-02-12 Thread Libreoffice Gerrit user
 editeng/source/items/frmitems.cxx |6 ++
 sw/source/core/unocore/unotbl.cxx |8 +---
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 052b5d375307245223e694bb835d86966c370d3b
Author: Miklos Vajna 
AuthorDate: Tue Feb 12 14:36:43 2019 +0100
Commit: Miklos Vajna 
CommitDate: Tue Feb 12 16:34:14 2019 +0100

sw btlr writing mode: implement UNO API

The custom code in SwXCell::setPropertyValue() was added in commit
5a5597655a4bf12e4ca07c9c2b6f6221e217f080 (tentative fix for fdo#30474#,
2010-11-26), which suggests that not handling all constants from
text::WritingMode2 was not intentional.

Later the writerfilter side (which is the only client of this hidden
property) was adapted to use text::WritingMode2, so do the same here.
This implicitly adds support for the new text::WritingMode2::BT_LR as
well.

Change-Id: I37d8eaa844847cb19e7503b2d973069f9895e6bc
Reviewed-on: https://gerrit.libreoffice.org/67730
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 2d6c98d59531..961f9ccffb51 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3867,6 +3867,9 @@ bool SvxFrameDirectionItem::PutValue( const 
css::uno::Any& rVal,
 case text::WritingMode2::TB_LR:
 SetValue( SvxFrameDirection::Vertical_LR_TB );
 break;
+case text::WritingMode2::BT_LR:
+SetValue( SvxFrameDirection::Vertical_LR_BT );
+break;
 case text::WritingMode2::PAGE:
 SetValue( SvxFrameDirection::Environment );
 break;
@@ -3900,6 +3903,9 @@ bool SvxFrameDirectionItem::QueryValue( css::uno::Any& 
rVal,
 case SvxFrameDirection::Vertical_LR_TB:
 nVal = text::WritingMode2::TB_LR;
 break;
+case SvxFrameDirection::Vertical_LR_BT:
+nVal = text::WritingMode2::BT_LR;
+break;
 case SvxFrameDirection::Environment:
 nVal = text::WritingMode2::PAGE;
 break;
diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index dd409f7529ca..df40b80a11a0 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1022,14 +1022,8 @@ void SwXCell::setPropertyValue(const OUString& 
rPropertyName, const uno::Any& aV
 if(rPropertyName == "FRMDirection")
 {
 SvxFrameDirection eDir = SvxFrameDirection::Environment;
-try
-{
-const std::array vDirs = { 
SvxFrameDirection::Horizontal_LR_TB,  SvxFrameDirection::Horizontal_RL_TB, 
SvxFrameDirection::Vertical_RL_TB };
-eDir = vDirs.at(aValue.get());
-} catch(std::out_of_range &) {
-SAL_WARN("sw.uno", "unknown direction code, maybe it's a 
bitfield");
-}
 SvxFrameDirectionItem aItem(eDir, RES_FRAMEDIR);
+aItem.PutValue(aValue, 0);
 pBox->GetFrameFormat()->SetFormatAttr(aItem);
 }
 else if(rPropertyName == "TableRedlineParams")
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: editeng/source sw/source

2018-10-18 Thread Libreoffice Gerrit user
 editeng/source/items/frmitems.cxx |3 ++-
 sw/source/core/unocore/unoidx.cxx |6 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 81974604d859da8365146ce126f3584d902224b8
Author: Michael Stahl 
AuthorDate: Fri Oct 12 16:37:32 2018 +0200
Commit: Tomaž Vajngerl 
CommitDate: Thu Oct 18 12:31:48 2018 +0200

editeng: do not throw from QueryValue implementation

None of the other QueryValue throw; in case of a problem they return
false without initialising the Any.

On the one hand, it would be useful to throw an exception for this
special property that has now become Write-Only, so that API users
get a better hint what is going wrong; on the other hand, it breaks
various other things like the various multi-property interfaces that
call QueryValue for multiple items (there are 3 such loops in
SwAccessibleParagraph alone).

(throw was introduced in 7a8ed362eb163ac15a000ba1cfc74b58315800a1)

It turns out there is even a test for the exception on ToX.

Change-Id: Id60ff43544f7399ce869227bfd6fb933dbaea3be
Reviewed-on: https://gerrit.libreoffice.org/61719
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 44b6ffaab159..910de8dcd434 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3309,7 +3309,8 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 
 case MID_GRAPHIC_URL:
 {
-throw uno::RuntimeException("Getting from this property is not 
supported");
+SAL_INFO("editeng.items", "Getting GraphicURL property is not 
supported");
+return false;
 }
 break;
 case MID_GRAPHIC:
diff --git a/sw/source/core/unocore/unoidx.cxx 
b/sw/source/core/unocore/unoidx.cxx
index 1e62a996b2bf..9f2eae93fbed 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -886,6 +887,11 @@ SwXDocumentIndex::getPropertyValue(const OUString& 
rPropertyName)
 "Unknown property: " + rPropertyName,
 static_cast< cppu::OWeakObject * >(this));
 }
+// TODO: is this the best approach to tell API clients about the change?
+if (pEntry->nWID == RES_BACKGROUND && pEntry->nMemberId == MID_GRAPHIC_URL)
+{
+throw uno::RuntimeException("Getting GraphicURL property is not 
supported");
+}
 
 SwSectionFormat *const pSectionFormat( m_pImpl->GetSectionFormat() );
 SwTOXBase* pTOXBase = nullptr;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source sw/source

2018-03-13 Thread Jan Holesovsky
 editeng/source/editeng/editview.cxx  |6 +-
 sw/source/uibase/uiview/viewling.cxx |   10 ++
 2 files changed, 3 insertions(+), 13 deletions(-)

New commits:
commit eda8d131c327a2fe360ac28a4b1014a4947a68bc
Author: Jan Holesovsky 
Date:   Mon Mar 12 17:27:10 2018 +0100

Revert "lok: Don't freeze the LibreOfficeKit via the spell-checking 
popup..."

This reverts commit 551e639f467813e52ff4301822b6a7f8778a2ef4.

Change-Id: I0c7c85fe22d53aa5587ec119e1c3242682b88e43
Reviewed-on: https://gerrit.libreoffice.org/51164
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index c4af0dcafb17..22b66cbce8c2 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1025,11 +1025,7 @@ void EditView::ExecuteSpellPopup( const Point& 
rPosPixel, LinkpEditEngine->pImpEditEngine->CreateEPaM(aPaM);
 EPaM aP2 = 
pImpEditView->pEditEngine->pImpEditEngine->CreateEPaM(aPaM2);
 
-sal_uInt16 nId = 0;
-// TODO for LOK, we'll need to convert the spelling popup menu to
-// something much more sfx2-based & non-modal...
-if (!comphelper::LibreOfficeKit::isActive())
-nId = aPopupMenu->Execute( pImpEditView->GetWindow(), aTempRect, 
PopupMenuFlags::NoMouseUpClose );
+sal_uInt16 nId = aPopupMenu->Execute( pImpEditView->GetWindow(), 
aTempRect, PopupMenuFlags::NoMouseUpClose );
 
 aPaM2 = pImpEditView->pEditEngine->pImpEditEngine->CreateEditPaM(aP2);
 aPaM = pImpEditView->pEditEngine->pImpEditEngine->CreateEditPaM(aP);
diff --git a/sw/source/uibase/uiview/viewling.cxx 
b/sw/source/uibase/uiview/viewling.cxx
index f8724e5743c9..b59abdc05042 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -24,7 +24,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -713,14 +712,9 @@ bool SwView::ExecSpellPopup(const Point& rPt)
 
 OUString sMenuName  = bUseGrammarContext ?
 OUString("private:resource/GrammarContextMenu") : 
OUString("private:resource/SpellContextMenu");
-
-if (comphelper::LibreOfficeKit::isActive())
-{
-// TODO for LOK, we'll need to convert the spelling popup 
menu to
-// something much more sfx2-based & non-modal...
-}
-else if (TryContextMenuInterception(xPopup->GetMenu(), 
sMenuName, pMenu, aEvent))
+if (TryContextMenuInterception(xPopup->GetMenu(), sMenuName, 
pMenu, aEvent))
 {
+
 //! happy hacking for context menu modifying extensions of 
this
 //! 'custom made' menu... *sigh* (code copied from sfx2 
and framework)
 if ( pMenu )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source sw/source

2018-03-06 Thread Tomaž Vajngerl
 editeng/source/items/frmitems.cxx  |   52 +++--
 sw/source/core/unocore/swunohelper.cxx |2 +
 sw/source/core/unocore/unoframe.cxx|9 +
 sw/source/core/unocore/unotbl.cxx  |1 
 4 files changed, 55 insertions(+), 9 deletions(-)

New commits:
commit 6b39ed0eaffabb6ffe11496d833053c094c72f7b
Author: Tomaž Vajngerl 
Date:   Thu Mar 1 06:33:30 2018 +0900

MID_GRAPHIC as alternative to set graphic to the SvxBrushItem

Change-Id: I6e17d1a34f0bd17a0eafd7c741162f23279e9d1a
Reviewed-on: https://gerrit.libreoffice.org/50539
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 5d3f3370bbde..f7a73d190229 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -44,6 +44,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -84,6 +85,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::editeng;
 using namespace ::com::sun::star;
@@ -3190,10 +3192,6 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 rVal <<= 
static_cast(static_cast(eGraphicPos));
 break;
 
-case MID_GRAPHIC:
-SAL_WARN( "editeng.items", "not implemented" );
-break;
-
 case MID_GRAPHIC_TRANSPARENT:
 rVal <<= ( aColor.GetTransparency() == 0xff );
 break;
@@ -3214,6 +3212,22 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 }
 break;
 
+case MID_GRAPHIC:
+{
+uno::Reference xGraphic;
+if (!maStrLink.isEmpty())
+{
+Graphic aGraphic(vcl::graphic::loadFromURL(maStrLink));
+xGraphic = aGraphic.GetXGraphic();
+}
+else if (xGraphicObject)
+{
+xGraphic = xGraphicObject->GetGraphic().GetXGraphic();
+}
+rVal <<= xGraphic;
+}
+break;
+
 case MID_GRAPHIC_FILTER:
 {
 rVal <<= maStrFilter;
@@ -3276,10 +3290,6 @@ bool SvxBrushItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
 }
 break;
 
-case MID_GRAPHIC:
-SAL_WARN( "editeng.items", "not implemented" );
-break;
-
 case MID_GRAPHIC_TRANSPARENT:
 aColor.SetTransparency( Any2Bool( rVal ) ? 0xff : 0 );
 break;
@@ -3316,6 +3326,32 @@ bool SvxBrushItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
 }
 break;
 
+case MID_GRAPHIC:
+{
+if (rVal.getValueType() == cppu::UnoType::get())
+{
+auto xGraphic = rVal.get();
+
+Graphic aGraphic(xGraphic);
+maStrLink.clear();
+
+std::unique_ptr 
xOldGrfObj(std::move(xGraphicObject));
+xGraphicObject.reset(new GraphicObject(aGraphic));
+ApplyGraphicTransparency_Impl();
+xOldGrfObj.reset();
+
+if (aGraphic && eGraphicPos == GPOS_NONE)
+{
+eGraphicPos = GPOS_MM;
+}
+else if (!aGraphic)
+{
+eGraphicPos = GPOS_NONE;
+}
+}
+}
+break;
+
 case MID_GRAPHIC_FILTER:
 {
 if( rVal.getValueType() == ::cppu::UnoType::get() )
diff --git a/sw/source/core/unocore/swunohelper.cxx 
b/sw/source/core/unocore/swunohelper.cxx
index 354ff65703a5..9d2040e87d55 100644
--- a/sw/source/core/unocore/swunohelper.cxx
+++ b/sw/source/core/unocore/swunohelper.cxx
@@ -313,6 +313,8 @@ bool needToMapFillItemsToSvxBrushItemTypes(const 
SfxItemSet& rSet,
 {
 case MID_GRAPHIC_URL:
 return SfxItemState::SET == 
rSet.GetItemState(XATTR_FILLBITMAP);
+case MID_GRAPHIC:
+return SfxItemState::SET == 
rSet.GetItemState(XATTR_FILLBITMAP);
 case MID_GRAPHIC_POSITION:
 return SfxItemState::SET == 
rSet.GetItemState(XATTR_FILLBMP_STRETCH)
 || SfxItemState::SET == 
rSet.GetItemState(XATTR_FILLBMP_TILE)
diff --git a/sw/source/core/unocore/unoframe.cxx 
b/sw/source/core/unocore/unoframe.cxx
index f93ed469dd21..bb2f794d7a3e 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -212,12 +212,14 @@ bool 
BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
 const ::uno::Any* pTrans = nullptr; GetProperty(RES_BACKGROUND, 
MID_GRAPHIC_TRANSPARENT, pTrans );
 const ::uno::Any* pGrLoc = nullptr; GetProperty(RES_BACKGROUND, 
MID_GRAPHIC_POSITION, pGrLoc );
 const ::uno::Any* pGrURL = nullptr; GetProperty(RES_BACKGROUND, 

[Libreoffice-commits] core.git: editeng/source sw/source

2018-02-15 Thread Fyodor Yemelyanenko
 editeng/source/misc/svxacorr.cxx |2 +-
 sw/source/core/edit/acorrect.cxx |6 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit aac475436271ddeabf6d9a4c3984ba77accf56ce
Author: Fyodor Yemelyanenko 
Date:   Wed Jan 10 10:27:08 2018 +1000

tdf#83260 editeng sw: avoid accessing dead nodes in AutoCorrect

When change tracking is ON (Redlining) and Edit->Change Tracking->Show==OFF
Autocorrection and Undo operations crash LO.

Change-Id: I616f2de143b78fc83483a6589cfa1dd1ab61675a
Reviewed-on: https://gerrit.libreoffice.org/47686
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 46c22fc84c49..1119879f178c 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1382,7 +1382,7 @@ void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, 
const OUString& rTxt,
 
 if( IsAutoCorrFlag( ChgToEnEmDash ) )
 {
-FnChgToEnEmDash( rDoc, rTxt, nCapLttrPos, nEnd, eLang 
);
+FnChgToEnEmDash( rDoc, aPara, nCapLttrPos, nEnd, eLang 
);
 }
 }
 break;
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index fbce36232d08..d2595462212f 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -339,6 +339,12 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, 
sal_Int32 nEndPos,
 {
 // replace the selection
 pDoc->getIDocumentContentOperations().ReplaceRange( aPam, 
pFnd->GetLong(), false);
+// tdf#83260 After calling 
sw::DocumentContentOperationsManager::ReplaceRange
+// pTextNd may become invalid when change tracking is on and 
Edit -> Track Changes -> Show == OFF.
+// ReplaceRange shows changes, this moves deleted nodes from 
special section to document.
+// Then Show mode is disabled again. As a result pTextNd may 
be invalidated.
+pTextNd = rCursor.GetNode().GetTextNode();
+
 bRet = true;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source sw/source

2017-09-22 Thread Jan Holesovsky
 editeng/source/editeng/editview.cxx  |6 +-
 sw/source/uibase/uiview/viewling.cxx |   10 --
 2 files changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 551e639f467813e52ff4301822b6a7f8778a2ef4
Author: Jan Holesovsky 
Date:   Thu Sep 21 22:08:46 2017 +0200

lok: Don't freeze the LibreOfficeKit via the spell-checking popup menu.

Change-Id: I045ed919daeefca612d7908dd7de50c36536c9a0
Reviewed-on: https://gerrit.libreoffice.org/42608
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/42627
Tested-by: Jenkins 

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index b74f76e35001..76692f6ab18d 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1023,7 +1023,11 @@ void EditView::ExecuteSpellPopup( const Point& 
rPosPixel, LinkpEditEngine->pImpEditEngine->CreateEPaM(aPaM);
 EPaM aP2 = 
pImpEditView->pEditEngine->pImpEditEngine->CreateEPaM(aPaM2);
 
-sal_uInt16 nId = aPopupMenu->Execute( pImpEditView->GetWindow(), 
aTempRect, PopupMenuFlags::NoMouseUpClose );
+sal_uInt16 nId = 0;
+// TODO for LOK, we'll need to convert the spelling popup menu to
+// something much more sfx2-based & non-modal...
+if (!comphelper::LibreOfficeKit::isActive())
+nId = aPopupMenu->Execute( pImpEditView->GetWindow(), aTempRect, 
PopupMenuFlags::NoMouseUpClose );
 
 aPaM2 = pImpEditView->pEditEngine->pImpEditEngine->CreateEditPaM(aP2);
 aPaM = pImpEditView->pEditEngine->pImpEditEngine->CreateEditPaM(aP);
diff --git a/sw/source/uibase/uiview/viewling.cxx 
b/sw/source/uibase/uiview/viewling.cxx
index dbdeef511e3e..dc220a5bb684 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -712,9 +713,14 @@ bool SwView::ExecSpellPopup(const Point& rPt)
 
 OUString sMenuName  = bUseGrammarContext ?
 OUString("private:resource/GrammarContextMenu") : 
OUString("private:resource/SpellContextMenu");
-if (TryContextMenuInterception(xPopup->GetMenu(), sMenuName, 
pMenu, aEvent))
-{
 
+if (comphelper::LibreOfficeKit::isActive())
+{
+// TODO for LOK, we'll need to convert the spelling popup 
menu to
+// something much more sfx2-based & non-modal...
+}
+else if (TryContextMenuInterception(xPopup->GetMenu(), 
sMenuName, pMenu, aEvent))
+{
 //! happy hacking for context menu modifying extensions of 
this
 //! 'custom made' menu... *sigh* (code copied from sfx2 
and framework)
 if ( pMenu )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source sw/source

2015-08-20 Thread Caolán McNamara
 editeng/source/editeng/impedit3.cxx |4 
 sw/source/core/text/txtfrm.cxx  |   20 
 2 files changed, 16 insertions(+), 8 deletions(-)

New commits:
commit 248e6c2f22a780cbdb35d5be4dc3d32d71b878ef
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Aug 20 08:55:32 2015 +0100

more no-config shortcuts

Change-Id: Ieb3ae2d0e99e77b23e6826efdf51de56f3543865

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index f774aa8..9bacfcc 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -55,6 +55,7 @@
 
 #include editeng/forbiddencharacterstable.hxx
 
+#include unotools/configmgr.hxx
 #include unotools/localedatawrapper.hxx
 
 #include editeng/unolingu.hxx
@@ -4264,6 +4265,9 @@ const SvxLRSpaceItem ImpEditEngine::GetLRSpaceItem( 
ContentNode* pNode )
 // text numeral setting:
 LanguageType ImpEditEngine::ImplCalcDigitLang(LanguageType eCurLang) const
 {
+if (utl::ConfigManager::IsAvoidConfig())
+return LANGUAGE_ENGLISH_US;
+
 // #114278# Also setting up digit language from Svt options
 // (cannot reliably inherit the outdev's setting)
 if( !pCTLOptions )
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 397996b..5171fe6 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -28,6 +28,7 @@
 #include editeng/ulspitem.hxx
 #include editeng/brushitem.hxx
 #include editeng/pgrditem.hxx
+#include unotools/configmgr.hxx
 #include swmodule.hxx
 #include SwSmartTagMgr.hxx
 #include doc.hxx
@@ -314,14 +315,17 @@ SwDigitModeModifier::SwDigitModeModifier( const 
OutputDevice rOutp, LanguageTyp
 rOut( rOutp ), nOldLanguageType( rOutp.GetDigitLanguage() )
 {
 LanguageType eLang = eCurLang;
-const SvtCTLOptions::TextNumerals nTextNumerals = 
SW_MOD()-GetCTLOptions().GetCTLTextNumerals();
-
-if ( SvtCTLOptions::NUMERALS_HINDI == nTextNumerals )
-eLang = LANGUAGE_ARABIC_SAUDI_ARABIA;
-else if ( SvtCTLOptions::NUMERALS_ARABIC == nTextNumerals )
-eLang = LANGUAGE_ENGLISH;
-else if ( SvtCTLOptions::NUMERALS_SYSTEM == nTextNumerals )
-eLang = ::GetAppLanguage();
+if (!utl::ConfigManager::IsAvoidConfig())
+{
+const SvtCTLOptions::TextNumerals nTextNumerals = 
SW_MOD()-GetCTLOptions().GetCTLTextNumerals();
+
+if ( SvtCTLOptions::NUMERALS_HINDI == nTextNumerals )
+eLang = LANGUAGE_ARABIC_SAUDI_ARABIA;
+else if ( SvtCTLOptions::NUMERALS_ARABIC == nTextNumerals )
+eLang = LANGUAGE_ENGLISH;
+else if ( SvtCTLOptions::NUMERALS_SYSTEM == nTextNumerals )
+eLang = ::GetAppLanguage();
+}
 
 const_castOutputDevice(rOut).SetDigitLanguage( eLang );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source sw/source

2015-05-24 Thread László Németh
 editeng/source/misc/svxacorr.cxx |8 ++--
 sw/source/core/edit/acorrect.cxx |5 -
 2 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 86782d5dfc0163159369677b0ac172ed2125b221
Author: László Németh laszlo.nem...@collabora.com
Date:   Mon May 25 04:30:16 2015 +0200

AutoCorrect: direct replacement of keywords surrounded by colons

Replacing immediately (without pressing space or enter) and
inside words, too. For example, fixing tdf#55292 – complete input
method for n-dash, m-dash – is possible now by  :--: - n-dash,
:---: - m-dash AutoCorrect replacements.

Change-Id: I54462d7482838523a47b844da6a84f08a1518b07

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 48d12f9..77816d9 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2825,12 +2825,16 @@ const SvxAutocorrWord* 
SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
 sal_Int32 right_wildcard = rChk.endsWith( .* ) ? 2 : 0; // word.* 
pattern?
 sal_Int32 nSttWdPos = nEndPos;
 
-if ( nEndPos = rChk.getLength() - left_wildcard - right_wildcard )
+// direct replacement of keywords surrounded by colons (for example, 
:name:)
+bool bColonNameColon = rTxt[nEndPos] == ':'  rChk[0] == ':'  
rChk.endsWith(:);
+if ( nEndPos + (bColonNameColon ? 1 : 0) = rChk.getLength() - 
left_wildcard - right_wildcard )
 {
 
 bool bWasWordDelim = false;
 sal_Int32 nCalcStt = nEndPos - rChk.getLength() + left_wildcard;
-if( !right_wildcard  ( !nCalcStt || nCalcStt == rStt || 
left_wildcard ||
+if (bColonNameColon)
+nCalcStt++;
+if( !right_wildcard  ( !nCalcStt || nCalcStt == rStt || 
left_wildcard || bColonNameColon ||
   ( nCalcStt  rStt 
 IsWordDelim( rTxt[ nCalcStt - 1 ] ))) )
 {
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index d3281eb..82255be 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -326,8 +326,11 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32 rSttPos, 
sal_Int32 nEndPos,
 SwDoc* pDoc = rEditSh.GetDoc();
 if( pFnd )
 {
+// replace also last colon of keywords surrounded by colons (for 
example, :name:)
+bool replaceLastChar = pFnd-GetShort()[0] == ':'  
pFnd-GetShort().endsWith(:);
+
 const SwNodeIndex rNd = rCrsr.GetPoint()-nNode;
-SwPaM aPam( rNd, rSttPos, rNd, nEndPos );
+SwPaM aPam( rNd, rSttPos, rNd, nEndPos + (replaceLastChar ? 1 : 0) );
 
 if( pFnd-IsTextOnly() )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source sw/source

2014-11-12 Thread Michael Stahl
 editeng/source/misc/acorrcfg.cxx  |6 +++---
 sw/source/uibase/app/swmodule.cxx |3 +++
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 5bff4b016c4b44f4123e0e6a4fd4c0c4dc0cfa2d
Author: Michael Stahl mst...@redhat.com
Date:   Wed Nov 12 23:57:07 2014 +0100

sw: delete global SwAutoCorrect instance to avoid crash...

... in exit handlers because VCL and the SolarMutex is gone.

(regression from 4404b718bdb547cb9b7b17c73a53574724cdeeb7)

Change-Id: I9f33b2cb8c87f7137e3ba0ae033879861f9fe11b

diff --git a/editeng/source/misc/acorrcfg.cxx b/editeng/source/misc/acorrcfg.cxx
index de1805a..dce7df4 100644
--- a/editeng/source/misc/acorrcfg.cxx
+++ b/editeng/source/misc/acorrcfg.cxx
@@ -77,11 +77,11 @@ SvxAutoCorrCfg::~SvxAutoCorrCfg()
 delete pAutoCorrect;
 }
 
-void SvxAutoCorrCfg::SetAutoCorrect( SvxAutoCorrect* pNew )
+void SvxAutoCorrCfg::SetAutoCorrect(SvxAutoCorrect *const pNew)
 {
-if( pNew  pNew != pAutoCorrect )
+if (pNew != pAutoCorrect)
 {
-if( pAutoCorrect-GetFlags() != pNew-GetFlags() )
+if (pNew  (pAutoCorrect-GetFlags() != pNew-GetFlags()))
 {
 aBaseConfig.SetModified();
 aSwConfig.SetModified();
diff --git a/sw/source/uibase/app/swmodule.cxx 
b/sw/source/uibase/app/swmodule.cxx
index ecee717..e3817b1 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -227,6 +227,9 @@ SwModule::~SwModule()
 {
 delete pErrorHdl;
 EndListening( *SfxGetpApp() );
+
+SvxAutoCorrCfg rACfg = SvxAutoCorrCfg::Get();
+rACfg.SetAutoCorrect(0); // delete SwAutCorrect before exit handlers
 }
 
 void SwModule::CreateLngSvcEvtListener()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source sw/source

2014-03-31 Thread Luke Deller
 editeng/source/items/borderline.cxx |   10 --
 sw/source/filter/ww8/ww8atr.cxx |9 +
 2 files changed, 17 insertions(+), 2 deletions(-)

New commits:
commit fe3dff30205d4b6b276e3687edda48c19de1547f
Author: Luke Deller l...@deller.id.au
Date:   Fri Mar 28 22:51:36 2014 +1100

.doc support for recently-added border line types

Some new border line types have been added recently to LibreOffice
(FINE_DASHED, DASH_DOT, DASH_DOT_DOT)

This change updates .doc import/export to support these.
(Import of FINE_DASHED was already working, but not export).

Change-Id: Id3bcb1d4e6e9ceb97b492f0c578fd5b885ab16ff
Reviewed-on: https://gerrit.libreoffice.org/8780
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/editeng/source/items/borderline.cxx 
b/editeng/source/items/borderline.cxx
index 3280988..1edc7d1 100644
--- a/editeng/source/items/borderline.cxx
+++ b/editeng/source/items/borderline.cxx
@@ -119,8 +119,6 @@ ConvertBorderStyleFromWord(int const nWordLineStyle)
 case  2: // thick line
 case  5: // hairline
 // and the unsupported special cases which we map to a single line
-case  8:
-case  9:
 case 20:
 return SOLID;
 case  6:
@@ -129,6 +127,10 @@ ConvertBorderStyleFromWord(int const nWordLineStyle)
 return DASHED;
 case 22:
 return FINE_DASHED;
+case 8:
+return DASH_DOT;
+case 9:
+return DASH_DOT_DOT;
 // then the shading beams which we represent by a double line
 case 23:
 return DOUBLE;
@@ -199,6 +201,8 @@ ConvertBorderWidthFromWord(SvxBorderStyle const eStyle, 
double const i_fWidth,
 
 case DOTTED:
 case DASHED:
+case DASH_DOT:
+case DASH_DOT_DOT:
 return fWidth;
 
 // Display a minimum effective border width of 1pt
@@ -249,6 +253,8 @@ ConvertBorderWidthToWord(SvxBorderStyle const eStyle, 
double const fWidth)
 case DOTTED:
 case DASHED:
 case FINE_DASHED:
+case DASH_DOT:
+case DASH_DOT_DOT:
 return fWidth;
 
 // Double lines
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index bf92692..5fd495b 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -4266,6 +4266,15 @@ WW8_BRCVer9 WW8Export::TranslateBorderLine(const 
SvxBorderLine rLine,
 case table::BorderLineStyle::INSET:
 brcType = 27;
 break;
+case table::BorderLineStyle::FINE_DASHED:
+brcType = 22;
+break;
+case table::BorderLineStyle::DASH_DOT:
+brcType = 8;
+break;
+case table::BorderLineStyle::DASH_DOT_DOT:
+brcType = 9;
+break;
 default:
 break;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source sw/source

2013-02-15 Thread Caolán McNamara
 editeng/source/misc/svxacorr.cxx |   11 ++-
 sw/source/core/edit/acorrect.cxx |   10 +-
 2 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit 5c31e17e46b02e755b075e63a08ffd8ad0eaa481
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Feb 15 13:57:25 2013 +

sync two translations of the same fundamental comment

Change-Id: I4da6683489c87fe06d45474dfc20351cb31ed000

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index f6fd9ba..870d00b 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -172,11 +172,12 @@ static sal_Bool lcl_IsInAsciiArr( const sal_Char* pArr, 
const sal_Unicode c )
 SvxAutoCorrDoc::~SvxAutoCorrDoc()
 {
 }
-// Is called by the functions:
-//  - FnCptlSttWrd
-//  - FnCptlSttSntnc
-// after the exchange of characters. then the words can maybe be inserted
-// into the exception list.
+
+// Called by the functions:
+//  - FnCptlSttWrd
+//  - FnCptlSttSntnc
+// after the exchange of characters. Then the words, if necessary, can be 
inserted
+// into the exception list.
 void SvxAutoCorrDoc::SaveCpltSttWord( sal_uLong, xub_StrLen, const String,
 sal_Unicode )
 {
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index 6d781f3..a5fca1a 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -404,11 +404,11 @@ sal_Bool SwAutoCorrDoc::ChgAutoCorrWord( xub_StrLen  
rSttPos, xub_StrLen nEndPo
 }
 
 
-// is being called after the exchange of the character from the functions
-//  - FnCptlSttWrd
-//  - FnCptlSttSntnc
-// Then, the words if necessary be added to the exception
-// list.
+// Called by the functions:
+//  - FnCptlSttWrd
+//  - FnCptlSttSntnc
+// after the exchange of characters. Then the words, if necessary, can be 
inserted
+// into the exception list.
 void SwAutoCorrDoc::SaveCpltSttWord( sal_uLong nFlag, xub_StrLen nPos,
 const String rExceptWord,
 sal_Unicode cChar )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits