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

2023-06-29 Thread Balazs Varga (via logerrit)
 editeng/source/uno/unotext.cxx   |   38 +++-
 sc/source/core/data/postit.cxx   |   84 +++
 test/source/sheet/xsheetannotationanchor.cxx |2 
 3 files changed, 97 insertions(+), 27 deletions(-)

New commits:
commit da8dead8e9282010893cbd12519e107baf03cd1a
Author: Balazs Varga 
AuthorDate: Tue Jun 20 19:26:50 2023 +0200
Commit: Balazs Varga 
CommitDate: Thu Jun 29 09:29:34 2023 +0200

tdf#73537 - sc: show author and creation date in calc comments

in temporory mode. Show the author and creation/modification
date of the the comment only in temporory mode. In edit mode, or
visible mode, shows only the original text.

Change-Id: I2c5856e4c6a813dbef4ad55de319f922daa57f67
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153358
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky 
Reviewed-by: Balazs Varga 

diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 881cfa32cd89..ee66097f7ec9 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -2117,11 +2117,43 @@ uno::Reference< text::XTextRange > SAL_CALL 
SvxUnoTextBase::finishParagraph(
 }
 
 uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextBase::insertTextPortion(
-const OUString& /*rText*/,
-const uno::Sequence< beans::PropertyValue >& /*rCharAndParaProps*/,
-const uno::Reference< text::XTextRange>& /*rTextRange*/ )
+const OUString& rText,
+const uno::Sequence< beans::PropertyValue >& rCharAndParaProps,
+const uno::Reference< text::XTextRange>& rTextRange )
 {
+SolarMutexGuard aGuard;
+
 uno::Reference< text::XTextRange > xRet;
+
+if (!rTextRange.is())
+return xRet;
+
+SvxUnoTextRangeBase* pRange = 
comphelper::getFromUnoTunnel(rTextRange);
+if (!pRange)
+return xRet;
+
+SvxEditSource *pEditSource = GetEditSource();
+SvxTextForwarder *pTextForwarder = pEditSource ? 
pEditSource->GetTextForwarder() : nullptr;
+
+if (pTextForwarder)
+{
+pRange->setString(rText);
+
+ESelection aSelection(pRange->GetSelection());
+
+pTextForwarder->RemoveAttribs(aSelection);
+pEditSource->UpdateData();
+
+SfxItemSet aItemSet( *pTextForwarder->GetEmptyItemSetPtr() );
+SvxPropertyValuesToItemSet( aItemSet, rCharAndParaProps,
+ImplGetSvxTextPortionSfxPropertySet(), pTextForwarder, 
aSelection.nStartPara );
+pTextForwarder->QuickSetAttribs( aItemSet, aSelection);
+rtl::Reference pNewRange = new SvxUnoTextRange( *this 
);
+xRet = pNewRange;
+pNewRange->SetSelection(aSelection);
+for( const beans::PropertyValue& rProp : rCharAndParaProps )
+pNewRange->setPropertyValue( rProp.Name, rProp.Value );
+}
 return xRet;
 }
 
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index dd1a023445e2..106a249e5666 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -57,6 +57,13 @@
 #include 
 #include 
 #include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
 
 using namespace com::sun::star;
 
@@ -493,8 +500,10 @@ void ScPostIt::SetAuthor( const OUString& rAuthor )
 
 void ScPostIt::AutoStamp()
 {
-maNoteData.maDate = ScGlobal::getLocaleData().getDate( Date( Date::SYSTEM 
) );
-maNoteData.maAuthor = SvtUserOptions().GetID();
+maNoteData.maDate = ScGlobal::getLocaleData().getDate( Date( Date::SYSTEM 
) ) + " " +
+ScGlobal::getLocaleData().getTime(DateTime(DateTime::SYSTEM), false);
+const OUString aAuthor = SvtUserOptions().GetFullName();
+maNoteData.maAuthor = !aAuthor.isEmpty() ? aAuthor : 
ScResId(STR_CHG_UNKNOWN_AUTHOR);
 }
 
 const OutlinerParaObject* ScPostIt::GetOutlinerObject() const
@@ -793,25 +802,55 @@ void ScPostIt::RemoveCaption()
 }
 }
 
+static void lcl_FormatAndInsertAuthorAndDatepara(SdrCaptionObj* pCaption, 
OUStringBuffer& aUserData, bool bUserWithTrackText)
+{
+uno::Reference xShape = pCaption->getUnoShape();
+uno::Reference xText(xShape, uno::UNO_QUERY);
+uno::Reference xBodyTextAppend(xText, uno::UNO_QUERY);
+
+if (xBodyTextAppend.is())
+{
+uno::Sequence< beans::PropertyValue > aArgs;
+if (bUserWithTrackText)
+{
+xBodyTextAppend->insertTextPortion(aUserData.makeStringAndClear(), 
aArgs, xText->getStart());
+}
+else
+{
+xBodyTextAppend->insertTextPortion("\n\n", aArgs, 
xText->getStart());
+aArgs = {
+comphelper::makePropertyValue("CharWeight", 
uno::Any(awt::FontWeight::BOLD)),
+};
+xBodyTextAppend->insertTextPortion(aUserData.makeStringAndClear(), 
aArgs, xText->getStart());
+}
+}
+}
+
 rtl::Reference ScNoteUtil::CreateTempCaption(
 ScDocument& rDoc, const ScAddress& rPos, SdrPage& rDrawPage,
 

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

2023-06-20 Thread Henry Castro (via logerrit)
 editeng/source/editeng/impedit.cxx |5 +++--
 sc/source/ui/view/viewdata.cxx |4 
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit c318f7bf20f21ea0e61b7069e4879868265b70c7
Author: Henry Castro 
AuthorDate: Wed Apr 19 09:50:56 2023 -0400
Commit: Henry Castro 
CommitDate: Tue Jun 20 18:50:12 2023 +0200

lok: sc: fix layout RTL

The function "IsRightToLeft" fails in Hebrew language
when Calc has a layout RTL, add additional condition
to check the layout.

Signed-off-by: Henry Castro 
Change-Id: If3972b80770a7aa6073881487e411a34cc6871d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150758
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151973
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153350
Tested-by: Jenkins

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 98ac03aceab6..ae98b778f4da 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -524,7 +524,8 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, 
vcl::Region* pRegion,
 
 bool bStartHandleVisible = false;
 bool bEndHandleVisible = false;
-bool bLOKCalcRTL = mpLOKSpecialPositioning && 
pEditEngine->IsRightToLeft(nStartPara);
+bool bLOKCalcRTL = mpLOKSpecialPositioning &&
+(mpLOKSpecialPositioning->IsLayoutRTL() || 
pEditEngine->IsRightToLeft(nStartPara));
 
 auto DrawHighlight = [&, nStartLine = sal_Int32(0), nEndLine = 
sal_Int32(0)](
  const ImpEditEngine::LineAreaInfo& rInfo) mutable 
{
@@ -1355,7 +1356,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
 Point aRefPointLogical = GetOutputArea().TopLeft();
 // Get the relative coordinates w.r.t refpoint in display hmm.
 aCursorRectPureLogical.Move(-aRefPointLogical.X(), 
-aRefPointLogical.Y());
-if (pEditEngine->IsRightToLeft(nPara))
+if (pEditEngine->IsRightToLeft(nPara) || 
mpLOKSpecialPositioning->IsLayoutRTL())
 {
 tools::Long nMirrorW = GetOutputArea().GetWidth();
 tools::Long nLeft = aCursorRectPureLogical.Left(), nRight 
= aCursorRectPureLogical.Right();
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index f9ad7cae805c..db90c7f207a6 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1527,6 +1527,7 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
 bool bLOKActive = comphelper::LibreOfficeKit::isActive();
 bool bLOKPrintTwips = bLOKActive && 
comphelper::LibreOfficeKit::isCompatFlagSet(
 comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs);
+bool bLOKLayoutRTL = bLOKActive && bLayoutRTL;
 
 bool bWasThere = false;
 if (pEditView[eWhich])
@@ -1625,6 +1626,9 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
 pEditView[eWhich]->SetLOKSpecialOutputArea(aPTwipsRect);
 }
 
+if (bLOKLayoutRTL)
+pEditView[eWhich]->SetLOKSpecialFlags(LOKSpecialFlags::LayoutRTL);
+
 tools::Rectangle aOutputArea = pWin->PixelToLogic( aPixRect, 
GetLogicMode() );
 pEditView[eWhich]->SetOutputArea( aOutputArea );
 


[Libreoffice-commits] core.git: editeng/source sc/source sd/qa

2022-11-03 Thread Stephan Bergmann (via logerrit)
 editeng/source/accessibility/AccessibleEditableTextPara.cxx |3 +--
 sc/source/ui/drawfunc/drtxtob.cxx   |3 ++-
 sc/source/ui/view/editsh.cxx|3 ++-
 sd/qa/unit/tiledrendering/tiledrendering.cxx|8 
 4 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit e0121b2478526d803681d57d59af0cbf9cf602b4
Author: Stephan Bergmann 
AuthorDate: Thu Nov 3 09:14:18 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Nov 3 13:58:13 2022 +0100

-Werror=dangling-reference

In


"c++: Implement -Wdangling-reference [PR106393]" grew a new warning, 
included in
-Wall, and based on some more-or-less shaky heuristics, that warns about
"possibly dangling reference to a temporary".  It produces quite a number of
false positives, but for these uses of SfxItemSet::Get it does look 
plausible
that the returned item references could, at least in theory, point at data 
that
is destroyed along with the temporary SfxItemSet.

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

diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx 
b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index aacb01522f51..ee2f47254765 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -1505,8 +1505,7 @@ namespace accessibility
 // NumberingLevel
 if (rRes.Name == "NumberingLevel")
 {
-const SvxNumBulletItem& rNumBullet = 
rCacheTF.GetParaAttribs(GetParagraphIndex()).Get(EE_PARA_NUMBULLET);
-if(rNumBullet.GetNumRule().GetLevelCount()==0)
+
if(rCacheTF.GetParaAttribs(GetParagraphIndex()).Get(EE_PARA_NUMBULLET).GetNumRule().GetLevelCount()==0)
 {
 rRes.Value <<= sal_Int16(-1);
 rRes.Handle = -1;
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx 
b/sc/source/ui/drawfunc/drtxtob.cxx
index ec796f4a8521..5d2e5a2e4019 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -205,7 +205,8 @@ void ScDrawTextObjectBar::Execute( SfxRequest  )
 
 case SID_CHARMAP:
 {
-const SvxFontItem& rItem = 
pOutView->GetAttribs().Get(EE_CHAR_FONTINFO);
+auto const attribs = pOutView->GetAttribs();
+const SvxFontItem& rItem = attribs.Get(EE_CHAR_FONTINFO);
 
 OUString aString;
 std::shared_ptr 
aNewItem(std::make_shared(EE_CHAR_FONTINFO));
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 0fd33f62ed6d..bdd0d32d551b 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -383,8 +383,9 @@ void ScEditShell::Execute( SfxRequest& rReq )
 sal_uInt16 nFontWhich = ( nScript == SvtScriptType::ASIAN ) ? 
EE_CHAR_FONTINFO_CJK :
 ( ( nScript == SvtScriptType::COMPLEX ) ? 
EE_CHAR_FONTINFO_CTL :
 
EE_CHAR_FONTINFO );
+auto const attribs = pTableView->GetAttribs();
 const SvxFontItem& rItem = static_cast(
-pTableView->GetAttribs().Get(nFontWhich));
+attribs.Get(nFontWhich));
 
 OUString aString;
 std::shared_ptr 
aNewItem(std::make_shared(EE_CHAR_FONTINFO));
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 3529290162c9..a7e9095ed950 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1490,8 +1490,8 @@ void SdTiledRenderingTest::testTdf102223()
 EditView& rEditView = pView->GetTextEditOutlinerView()->GetEditView();
 rEditView.SetSelection(ESelection(0, 0, 0, 3)); // start para, start char, 
end para, end char.
 CPPUNIT_ASSERT_EQUAL(OUString("Red"), rEditView.GetSelected());
-const SvxFontHeightItem& rItem = 
rEditView.GetAttribs().Get(EE_CHAR_FONTHEIGHT);
-CPPUNIT_ASSERT_EQUAL(int(1411), static_cast(rItem.GetHeight()));
+CPPUNIT_ASSERT_EQUAL(
+int(1411), 
static_cast(rEditView.GetAttribs().Get(EE_CHAR_FONTHEIGHT).GetHeight()));
 
 // cut contents of cell
 uno::Sequence aArgs;
@@ -1502,8 +1502,8 @@ void SdTiledRenderingTest::testTdf102223()
 CPPUNIT_ASSERT(pView->GetTextEditObject());
 EditView& rEditView2 = pView->GetTextEditOutlinerView()->GetEditView();
 rEditView2.SetSelection(ESelection(0, 0, 0, 1)); // start para, start 
char, end para, end char.
-const SvxFontHeightItem& 

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

2022-06-02 Thread Noel Grandin (via logerrit)
 editeng/source/editeng/impedit.cxx |5 -
 sc/source/ui/app/inputhdl.cxx  |4 
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 7ac26ea039ea0c355b80232e30c29a07e2bb027d
Author: Noel Grandin 
AuthorDate: Tue Mar 29 08:45:52 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Jun 2 15:01:16 2022 +0200

tdf#148087 assert editing a cell with OnSelectionChange macro breakpoint

assert was introduced in
commit e1972743d692c8d8611912c31aae2cb08ae7636d
Author: Noel Grandin 
Date:   Sun Sep 5 15:01:44 2021 +0200
be more disciplined with SetUpdateLayout on editengine

We want to restore UpdateLayout when we're done doing layout, we should
not just leave it FALSE

Change-Id: Ic0431ffc3c66d0d02bfd10c323b18383f52dbc95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132209
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 8c373127d3db..87ddc0bcd994 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1739,8 +1739,11 @@ bool ImpEditView::MouseButtonDown( const MouseEvent& 
rMouseEvent )
 nTravelXPos = TRAVEL_X_DONTKNOW;
 nExtraCursorFlags   = GetCursorFlags::NONE;
 nCursorBidiLevel= CURSOR_BIDILEVEL_DONTKNOW;
+bool bPrevUpdateLayout = 
pEditEngine->pImpEditEngine->SetUpdateLayout(true);
 bClickedInSelection = IsSelectionAtPoint( rMouseEvent.GetPosPixel() );
-return pEditEngine->pImpEditEngine->MouseButtonDown( rMouseEvent, 
GetEditViewPtr() );
+bool bRet = pEditEngine->pImpEditEngine->MouseButtonDown( rMouseEvent, 
GetEditViewPtr() );
+pEditEngine->pImpEditEngine->SetUpdateLayout(bPrevUpdateLayout);
+return bRet;
 }
 
 bool ImpEditView::MouseMove( const MouseEvent& rMouseEvent )
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index a1b7afa38976..3cd4c3cfaebf 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3133,6 +3133,8 @@ void ScInputHandler::EnterHandler( ScEnterMode 
nBlockMode, bool bBeforeSavingInL
 }
 
 std::vector aMisspellRanges;
+// UpdateLayout must be true during CompleteOnlineSpelling
+const bool bUpdateLayout = mpEditEngine->SetUpdateLayout( true );
 mpEditEngine->CompleteOnlineSpelling();
 bool bSpellErrors = !bFormulaMode && mpEditEngine->HasOnlineSpellErrors();
 if ( bSpellErrors )
@@ -3399,6 +3401,8 @@ void ScInputHandler::EnterHandler( ScEnterMode 
nBlockMode, bool bBeforeSavingInL
 
 bInOwnChange = false;
 bInEnterHandler = false;
+if (bUpdateLayout)
+mpEditEngine->SetUpdateLayout( true );
 }
 
 void ScInputHandler::CancelHandler()


[Libreoffice-commits] core.git: editeng/source sc/source sd/source svx/source

2021-09-20 Thread Noel Grandin (via logerrit)
 editeng/source/editeng/editeng.cxx  |   20 +---
 editeng/source/editeng/editundo.cxx |6 --
 editeng/source/editeng/editview.cxx |   24 
 editeng/source/editeng/impedit2.cxx |   10 +-
 editeng/source/editeng/impedit4.cxx |8 +---
 editeng/source/editeng/impedit5.cxx |9 ++---
 editeng/source/outliner/outlvw.cxx  |8 
 sc/source/core/data/column2.cxx |4 ++--
 sc/source/ui/app/inputwin.cxx   |4 ++--
 sc/source/ui/view/output2.cxx   |4 ++--
 sd/source/ui/view/Outliner.cxx  |2 +-
 sd/source/ui/view/outlview.cxx  |4 ++--
 svx/source/svdraw/svdedxv.cxx   |4 ++--
 13 files changed, 64 insertions(+), 43 deletions(-)

New commits:
commit e1972743d692c8d8611912c31aae2cb08ae7636d
Author: Noel Grandin 
AuthorDate: Sun Sep 5 15:01:44 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Sep 20 19:20:54 2021 +0200

be more disciplined with SetUpdateLayout on editengine

save/restore in more places, and check in more places
before doing layout, so we dont waste time on expensive layout

Change-Id: I311f1f7f97a508da296078e936cb3704938dfdc3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121687
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index e9f19cbd3194..d22c74ade973 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1637,7 +1637,8 @@ void EditEngine::RemoveParagraph( sal_Int32 nPara )
 pImpEditEngine->ImpRemoveParagraph( nPara );
 pImpEditEngine->InvalidateFromParagraph( nPara );
 pImpEditEngine->UpdateSelections();
-pImpEditEngine->FormatAndLayout();
+if (pImpEditEngine->IsUpdateLayout())
+pImpEditEngine->FormatAndLayout();
 }
 }
 
@@ -1712,7 +1713,8 @@ void EditEngine::InsertParagraph( sal_Int32 nPara, const 
EditTextObject& rTxtObj
 
 pImpEditEngine->UndoActionEnd();
 
-pImpEditEngine->FormatAndLayout();
+if (pImpEditEngine->IsUpdateLayout())
+pImpEditEngine->FormatAndLayout();
 }
 
 void EditEngine::InsertParagraph(sal_Int32 nPara, const OUString& rTxt)
@@ -1730,7 +1732,8 @@ void EditEngine::InsertParagraph(sal_Int32 nPara, const 
OUString& rTxt)
 pImpEditEngine->RemoveCharAttribs( nPara );
 pImpEditEngine->UndoActionEnd();
 pImpEditEngine->ImpInsertText( EditSelection( aPaM, aPaM ), rTxt );
-pImpEditEngine->FormatAndLayout();
+if (pImpEditEngine->IsUpdateLayout())
+pImpEditEngine->FormatAndLayout();
 }
 
 void EditEngine::SetText(sal_Int32 nPara, const OUString& rTxt)
@@ -1741,7 +1744,8 @@ void EditEngine::SetText(sal_Int32 nPara, const OUString& 
rTxt)
 pImpEditEngine->UndoActionStart( EDITUNDO_INSERT );
 pImpEditEngine->ImpInsertText( *pSel, rTxt );
 pImpEditEngine->UndoActionEnd();
-pImpEditEngine->FormatAndLayout();
+if (pImpEditEngine->IsUpdateLayout())
+pImpEditEngine->FormatAndLayout();
 }
 }
 
@@ -1773,7 +1777,8 @@ void EditEngine::SetCharAttribs(sal_Int32 nPara, const 
SfxItemSet& rSet)
 // This is called by sd::View::OnBeginPasteOrDrop(), updating the cursor 
position on undo is not
 // wanted.
 pImpEditEngine->SetAttribs(aSel, rSet, /*nSpecial=*/SetAttribsMode::NONE, 
/*bSetSelection=*/false);
-pImpEditEngine->FormatAndLayout();
+if (pImpEditEngine->IsUpdateLayout())
+pImpEditEngine->FormatAndLayout();
 }
 
 void EditEngine::GetCharAttribs( sal_Int32 nPara, std::vector& 
rLst ) const
@@ -1803,7 +1808,8 @@ void EditEngine::RemoveAttribs( const ESelection& 
rSelection, bool bRemoveParaAt
 EditSelection aSel( pImpEditEngine->ConvertSelection( 
rSelection.nStartPara, rSelection.nStartPos, rSelection.nEndPara, 
rSelection.nEndPos ) );
 pImpEditEngine->RemoveCharAttribs( aSel, eMode, nWhich  );
 pImpEditEngine->UndoActionEnd();
-pImpEditEngine->FormatAndLayout();
+if (pImpEditEngine->IsUpdateLayout())
+pImpEditEngine->FormatAndLayout();
 }
 
 vcl::Font EditEngine::GetStandardFont( sal_Int32 nPara )
@@ -2327,7 +2333,7 @@ EFieldInfo EditEngine::GetFieldInfo( sal_Int32 nPara, 
sal_uInt16 nField ) const
 bool EditEngine::UpdateFields()
 {
 bool bChanges = pImpEditEngine->UpdateFields();
-if ( bChanges )
+if ( bChanges && pImpEditEngine->IsUpdateLayout())
 pImpEditEngine->FormatAndLayout();
 return bChanges;
 }
diff --git a/editeng/source/editeng/editundo.cxx 
b/editeng/source/editeng/editundo.cxx
index 8df80a629a1d..dc9c3a104b6c 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -75,7 +75,8 @@ bool EditUndoManager::Undo()
 
 aNewSel.Min() = aNewSel.Max();
 mpEditEngine->GetActiveView()->GetImpEditView()->SetEditSelection( aNewSel 
);
-mpEditEngine->FormatAndLayout( mpEditEngine->GetActiveView(), true );
+if 

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

2021-08-12 Thread Noel Grandin (via logerrit)
 editeng/source/editeng/editeng.cxx  |5 +++--
 sc/source/filter/oox/commentsbuffer.cxx |3 +++
 svx/source/svdraw/svdotext.cxx  |6 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit b2a1c29d5958e0cc6d8f0e68c11121131dfa1513
Author: Noel Grandin 
AuthorDate: Thu Aug 12 12:37:16 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Aug 12 13:52:07 2021 +0200

tdf#95549 speed up load of xls

we don't need to perform layout during load, so disable a few places
that do that

reduces load time by 50%

Change-Id: Ie746ca0b46de3b76ca1b7291e0528b525333278f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120384
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index c9aec527b222..fff07dfdc836 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1490,7 +1490,7 @@ void EditEngine::Clear()
 void EditEngine::SetText( const OUString& rText )
 {
 pImpEditEngine->SetText( rText );
-if ( !rText.isEmpty() )
+if ( !rText.isEmpty() && pImpEditEngine->GetUpdateMode() )
 pImpEditEngine->FormatAndUpdate();
 }
 
@@ -1747,7 +1747,8 @@ void EditEngine::SetText(sal_Int32 nPara, const OUString& 
rTxt)
 void EditEngine::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
 {
 pImpEditEngine->SetParaAttribs( nPara, rSet );
-pImpEditEngine->FormatAndUpdate();
+if ( pImpEditEngine->GetUpdateMode() )
+pImpEditEngine->FormatAndUpdate();
 }
 
 const SfxItemSet& EditEngine::GetParaAttribs( sal_Int32 nPara ) const
diff --git a/sc/source/filter/oox/commentsbuffer.cxx 
b/sc/source/filter/oox/commentsbuffer.cxx
index d2d1ca2ccad6..90c93f8019be 100644
--- a/sc/source/filter/oox/commentsbuffer.cxx
+++ b/sc/source/filter/oox/commentsbuffer.cxx
@@ -198,7 +198,10 @@ void Comment::finalizeImport()
 // insert text and convert text formatting
 maModel.mxText->finalizeImport();
 Reference< XText > xAnnoText( xAnnoShape, UNO_QUERY_THROW );
+Reference< css::document::XActionLockable > xAnnoLock( xAnnoShape, 
UNO_QUERY_THROW );
+xAnnoLock->addActionLock();
 maModel.mxText->convert( xAnnoText );
+xAnnoLock->removeActionLock();
 }
 catch( Exception& )
 {
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index e6d7e0f0cfef..57020917c79e 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -241,14 +241,10 @@ void SdrTextObj::NbcSetText(const OUString& rStr)
 {
 SdrOutliner& rOutliner=ImpGetDrawOutliner();
 rOutliner.SetStyleSheet( 0, GetStyleSheet());
-rOutliner.SetUpdateMode(true);
 rOutliner.SetText(rStr,rOutliner.GetParagraph( 0 ));
 std::unique_ptr pNewText=rOutliner.CreateParaObject();
-Size aSize(rOutliner.CalcTextSize());
-rOutliner.Clear();
 NbcSetOutlinerParaObject(std::move(pNewText));
-maTextSize = aSize;
-mbTextSizeDirty=false;
+mbTextSizeDirty=true;
 }
 
 void SdrTextObj::SetText(const OUString& rStr)


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

2021-06-20 Thread Caolán McNamara (via logerrit)
 editeng/source/rtf/svxrtf.cxx|5 +
 sc/source/filter/excel/excel.cxx |   14 +-
 2 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit f2bcf8f5b383232a4f9f345b94f4b40b646edb22
Author: Caolán McNamara 
AuthorDate: Sun Jun 20 14:55:34 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Jun 20 18:20:36 2021 +0200

ofz#24932 Timeout

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

diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index fe1f18adcb0d..8bde87443c49 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -633,6 +634,10 @@ SvxRTFItemStackType* SvxRTFParser::GetAttrSet_()
 xNew->SetRTFDefaults( GetRTFDefaults() );
 
 aAttrStack.push_back( std::move(xNew) );
+
+if (aAttrStack.size() > 1024 && utl::ConfigManager::IsFuzzing())
+throw std::range_error("ecStackOverflow");
+
 bNewGroup = false;
 return aAttrStack.back().get();
 }
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx
index b3bd251fff82..2a42a7df2819 100644
--- a/sc/source/filter/excel/excel.cxx
+++ b/sc/source/filter/excel/excel.cxx
@@ -425,7 +425,19 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool 
TestImportCalcRTF(SvStream )
 aDocument.EnableExecuteLink(false);
 aDocument.SetInsertingFromOtherDoc(true);
 ScRange aRange;
-return ScFormatFilter::Get().ScImportRTF(rStream, OUString(), , 
aRange) == ERRCODE_NONE;
+
+bool bRet;
+
+try
+{
+bRet = ScFormatFilter::Get().ScImportRTF(rStream, OUString(), 
, aRange) == ERRCODE_NONE;
+}
+catch (const std::range_error&)
+{
+return false;
+}
+
+return bRet;
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportXLS(SvStream& rStream)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source sc/source sd/source svl/source sw/source writerfilter/source

2021-03-21 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/editdoc.cxx|2 +-
 editeng/source/editeng/editobj.cxx|2 +-
 editeng/source/outliner/outliner.cxx  |2 +-
 sc/source/ui/view/gridwin_dbgutil.cxx |2 +-
 sd/source/core/drawdoc.cxx|2 +-
 svl/source/undo/undo.cxx  |2 +-
 sw/source/core/doc/docfmt.cxx |2 +-
 sw/source/core/text/xmldump.cxx   |2 +-
 writerfilter/source/dmapper/TagLogger.cxx |2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit f8538ec4967b205b03f8e06fba86c6f09a679bc9
Author: Caolán McNamara 
AuthorDate: Sun Mar 21 14:34:47 2021 +
Commit: Caolán McNamara 
CommitDate: Sun Mar 21 20:43:51 2021 +0100

cid#1473798 silence Unchecked return value from library

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

diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index a5e28d0c6b34..d429cbe1e762 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -2695,7 +2695,7 @@ void EditDoc::dumpAsXml(xmlTextWriterPtr pWriter) const
 {
 pWriter = xmlNewTextWriterFilename("editdoc.xml", 0);
 xmlTextWriterSetIndent(pWriter,1);
-xmlTextWriterSetIndentString(pWriter, BAD_CAST("  "));
+(void)xmlTextWriterSetIndentString(pWriter, BAD_CAST("  "));
 (void)xmlTextWriterStartDocument(pWriter, nullptr, nullptr, nullptr);
 bOwns = true;
 }
diff --git a/editeng/source/editeng/editobj.cxx 
b/editeng/source/editeng/editobj.cxx
index 05abf41a7b67..af80e2845bd6 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -421,7 +421,7 @@ void EditTextObject::dumpAsXml(xmlTextWriterPtr pWriter) 
const
 {
 pWriter = xmlNewTextWriterFilename("editTextObject.xml", 0);
 xmlTextWriterSetIndent(pWriter,1);
-xmlTextWriterSetIndentString(pWriter, BAD_CAST("  "));
+(void)xmlTextWriterSetIndentString(pWriter, BAD_CAST("  "));
 (void)xmlTextWriterStartDocument(pWriter, nullptr, nullptr, nullptr);
 bOwns = true;
 }
diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 7b259959ea04..34ef7f981121 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -2166,7 +2166,7 @@ void Outliner::dumpAsXml(xmlTextWriterPtr pWriter) const
 {
 pWriter = xmlNewTextWriterFilename("outliner.xml", 0);
 xmlTextWriterSetIndent(pWriter,1);
-xmlTextWriterSetIndentString(pWriter, BAD_CAST("  "));
+(void)xmlTextWriterSetIndentString(pWriter, BAD_CAST("  "));
 (void)xmlTextWriterStartDocument(pWriter, nullptr, nullptr, nullptr);
 bOwns = true;
 }
diff --git a/sc/source/ui/view/gridwin_dbgutil.cxx 
b/sc/source/ui/view/gridwin_dbgutil.cxx
index bcb1da5ff695..f9c2209bda88 100644
--- a/sc/source/ui/view/gridwin_dbgutil.cxx
+++ b/sc/source/ui/view/gridwin_dbgutil.cxx
@@ -91,7 +91,7 @@ void ScGridWindow::dumpCellProperties()
 
 xmlTextWriterPtr writer = xmlNewTextWriterFilename( "dump.xml", 0 );
 xmlTextWriterSetIndent(writer,1);
-xmlTextWriterSetIndentString(writer, BAD_CAST(""));
+(void)xmlTextWriterSetIndentString(writer, BAD_CAST(""));
 
 (void)xmlTextWriterStartDocument( writer, nullptr, nullptr, nullptr );
 
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 182377c2dff7..4e7c6c5dbd88 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -1184,7 +1184,7 @@ void SdDrawDocument::dumpAsXml(xmlTextWriterPtr pWriter) 
const
 {
 pWriter = xmlNewTextWriterFilename("model.xml", 0);
 xmlTextWriterSetIndent(pWriter,1);
-xmlTextWriterSetIndentString(pWriter, BAD_CAST("  "));
+(void)xmlTextWriterSetIndentString(pWriter, BAD_CAST("  "));
 (void)xmlTextWriterStartDocument(pWriter, nullptr, nullptr, nullptr);
 bOwns = true;
 }
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index 71d7b6f254a7..ee9af634a4ba 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -1146,7 +1146,7 @@ void SfxUndoManager::dumpAsXml(xmlTextWriterPtr pWriter) 
const
 {
 pWriter = xmlNewTextWriterFilename("undo.xml", 0);
 xmlTextWriterSetIndent(pWriter,1);
-xmlTextWriterSetIndentString(pWriter, BAD_CAST("  "));
+(void)xmlTextWriterSetIndentString(pWriter, BAD_CAST("  "));
 (void)xmlTextWriterStartDocument(pWriter, nullptr, nullptr, nullptr);
 bOwns = true;
 }
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index ee4854e142e0..a552585df6ab 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1935,7 +1935,7 @@ void 

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

2020-03-06 Thread Marco Cecchetti (via logerrit)
 editeng/source/editeng/impedit.cxx |   40 +
 sc/source/ui/app/inputwin.cxx  |5 
 2 files changed, 45 insertions(+)

New commits:
commit 6fdd5e3ec95712d03b30fc32acffa358b7fef46e
Author: Marco Cecchetti 
AuthorDate: Tue Jan 14 14:35:11 2020 +0100
Commit: Marco Cecchetti 
CommitDate: Fri Mar 6 10:42:46 2020 +0100

lok: calc: send text selection rectangles for the input bar

Change-Id: I3caeaddd7a5ddc6e496650539b88e2fd81b37e6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86790
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90069
Tested-by: Jenkins
Reviewed-by: Marco Cecchetti 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 53900c16aa76..0162856b0e36 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -382,6 +382,33 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, 
vcl::Region* pRegion,
 
 if (comphelper::LibreOfficeKit::isActive() && mpViewShell && 
!pOldRegion && pOutWin)
 {
+VclPtr pParent = pOutWin->GetParentWithLOKNotifier();
+if (pParent && pParent->GetLOKWindowId() != 0)
+{
+const long nX = pOutWin->GetOutOffXPixel() - 
pParent->GetOutOffXPixel();
+const long nY = pOutWin->GetOutOffYPixel() - 
pParent->GetOutOffYPixel();
+
+std::vector aRectangles;
+pRegion->GetRegionRectangles(aRectangles);
+
+std::vector v;
+for (tools::Rectangle & rRectangle : aRectangles)
+{
+rRectangle = pOutWin->LogicToPixel(rRectangle);
+rRectangle.Move(nX, nY);
+v.emplace_back(rRectangle.toString().getStr());
+}
+OString sRectangle = comphelper::string::join("; ", v);
+
+const vcl::ILibreOfficeKitNotifier* pNotifier = 
pParent->GetLOKNotifier();
+const OUString rAction("text_selection");
+std::vector aItems;
+aItems.emplace_back("rectangles", sRectangle);
+pNotifier->notifyWindow(pParent->GetLOKWindowId(), rAction, 
aItems);
+pPolyPoly.reset();
+return;
+}
+
 pOutWin->Push(PushFlags::MAPMODE);
 if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::MapTwip)
 {
@@ -1743,6 +1770,19 @@ void ImpEditView::DeselectAll()
 aNewSelection.Min() = aNewSelection.Max();
 SetEditSelection(aNewSelection);
 // const_cast(GetEditSelection().Min()) = 
GetEditSelection().Max();
+
+if (comphelper::LibreOfficeKit::isActive() && mpViewShell)
+{
+VclPtr pParent = pOutWin->GetParentWithLOKNotifier();
+if (pParent && pParent->GetLOKWindowId())
+{
+const vcl::ILibreOfficeKitNotifier* pNotifier = 
pParent->GetLOKNotifier();
+const OUString rAction("text_selection");
+std::vector aItems;
+aItems.emplace_back("rectangles", "");
+pNotifier->notifyWindow(pParent->GetLOKWindowId(), rAction, 
aItems);
+}
+}
 }
 
 bool ImpEditView::IsSelectionAtPoint( const Point& rPosPixel )
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 2108f1c9dd8d..2702bb2705f1 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1500,6 +1500,9 @@ void ScTextWnd::InitEditEngine()
 mpEditView = std::make_unique(mpEditEngine.get(), this);
 mpEditView->SetInsertMode(bIsInsertMode);
 
+if (comphelper::LibreOfficeKit::isActive())
+mpEditView->RegisterViewShell(mpViewShell);
+
 // Text from Clipboard is taken over as ASCII in a single row
 EVControlBits n = mpEditView->GetControlWord();
 mpEditView->SetControlWord( n | EVControlBits::SINGLELINEPASTE );
@@ -2016,6 +2019,8 @@ void ScTextWnd::MakeDialogEditView()
 mpEditEngine->SetUpdateMode( true );
 
 mpEditView = std::make_unique(mpEditEngine.get(), this);
+if (comphelper::LibreOfficeKit::isActive())
+mpEditView->RegisterViewShell(mpViewShell);
 mpEditEngine->InsertView( mpEditView.get(), EE_APPEND );
 
 Resize();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2019-12-30 Thread Kemal Ayhan (via logerrit)
 editeng/source/editeng/impedit3.cxx |2 +-
 sc/source/ui/view/printfun.cxx  |2 +-
 sc/source/ui/view/viewdata.cxx  |4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 3a3110564bcda4678fb804d01013e226fd2fbe93
Author: Kemal Ayhan 
AuthorDate: Sun Dec 29 18:34:40 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Dec 30 10:36:12 2019 +0100

tdf#96505 - Get rid of cargo cult long integer literals

Change-Id: Iaf0cfc96771e33493becfad77af9b7f3b7c817d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85950
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 6e50e842d097..58c90a589dcb 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -2922,7 +2922,7 @@ void ImpEditEngine::RecalcFormatterFontMetrics( 
FormatterFontMetric& rCurMetrics
 {
 // Now in consideration of Escape/Propr
 // possibly enlarge Ascent or Descent
-short nDiff = 
static_cast(rFont.GetFontSize().Height()*rFont.GetEscapement()/100L);
+short nDiff = 
static_cast(rFont.GetFontSize().Height()*rFont.GetEscapement()/100);
 if ( rFont.GetEscapement() > 0 )
 {
 nAscent = 
static_cast(static_cast(nAscent)*nPropr/100 + nDiff);
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 2b3760fbeeac..dc1930baff27 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -792,7 +792,7 @@ void ScPrintFunc::UpdateHFHeight( ScPrintHFParam& rParam )
 
 if (rParam.pShadow && rParam.pShadow->GetLocation() != 
SvxShadowLocation::NONE)
 nPaperWidth -= ( 
rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::LEFT) +
- 
rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::RIGHT) ) * 100L / nZoom;
+ 
rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::RIGHT) ) * 100 / nZoom;
 
 pEditEngine->SetPaperSize( Size( nPaperWidth, 1 ) );
 
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 564c367d60f3..b719605dde56 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -3226,9 +3226,9 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& 
rDocOpt )
 
 // zoom for each sheet
 if( rTabSett.mnNormalZoom )
-rViewTab.aZoomX = rViewTab.aZoomY = Fraction( 
rTabSett.mnNormalZoom, 100L );
+rViewTab.aZoomX = rViewTab.aZoomY = Fraction( 
rTabSett.mnNormalZoom, 100 );
 if( rTabSett.mnPageZoom )
-rViewTab.aPageZoomX = rViewTab.aPageZoomY = Fraction( 
rTabSett.mnPageZoom, 100L );
+rViewTab.aPageZoomX = rViewTab.aPageZoomY = Fraction( 
rTabSett.mnPageZoom, 100 );
 
 rViewTab.bShowGrid = rTabSett.mbShowGrid;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-13 Thread Caolán McNamara
 editeng/source/editeng/editeng.cxx |2 --
 sc/source/filter/rtf/eeimpars.cxx  |   11 ++-
 2 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 79742eab111e5f3722075abc3cdb1333faacd076
Author: Caolán McNamara 
Date:   Mon Nov 13 15:03:04 2017 +

ofz#4202 Null-dereference READ

Change-Id: Ib9beadaea1bc6521faf7d8080d301e4b5451fb1d
Reviewed-on: https://gerrit.libreoffice.org/44685
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 3e3b691d207b..bb09af238d99 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1492,8 +1492,6 @@ EditTextObject* EditEngine::CreateTextObject()
 EditTextObject* EditEngine::CreateTextObject( const ESelection& rESelection )
 {
 EditSelection aSel( pImpEditEngine->CreateSel( rESelection ) );
-if (aSel.IsInvalid())
-return nullptr;
 return pImpEditEngine->CreateTextObject( aSel );
 }
 
diff --git a/sc/source/filter/rtf/eeimpars.cxx 
b/sc/source/filter/rtf/eeimpars.cxx
index cac30a4db058..89b8b088be0c 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -104,6 +104,15 @@ ErrCode ScEEImport::Read( SvStream& rStream, const 
OUString& rBaseURL )
 return nErr;
 }
 
+namespace
+{
+bool IsValidSel(const ScTabEditEngine& rEngine, const ESelection& rSel)
+{
+const auto nParaCount = rEngine.GetParagraphCount();
+return rSel.nStartPara < nParaCount && rSel.nEndPara < nParaCount;
+}
+}
+
 void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, 
SvNumberFormatter* pFormatter, bool bConvertDate )
 {
 std::unique_ptr pProgress( new ScProgress( 
mpDoc->GetDocumentShell(),
@@ -400,7 +409,7 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, 
double nOutputFactor, SvNu
 mpDoc->SetString(nCol, nRow, nTab, aStr, );
 }
 }
-else if (EditTextObject* pTextObject = 
mpEngine->CreateTextObject(pE->aSel))
+else if (EditTextObject* pTextObject = IsValidSel(*mpEngine, 
pE->aSel) ? mpEngine->CreateTextObject(pE->aSel) : nullptr)
 {
 // The cell will own the text object instance.
 mpDoc->SetEditText(ScAddress(nCol,nRow,nTab), pTextObject);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-10 Thread Caolán McNamara
 editeng/source/editeng/editeng.cxx |2 ++
 sc/source/filter/rtf/eeimpars.cxx  |4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit d64f6caf22715fb421f4b89820c0842b7cae6905
Author: Caolán McNamara 
Date:   Fri Nov 10 09:58:31 2017 +

ofz#4163 Null-dereference READ

Change-Id: I3d1ae5f55343b1b8ec3b0d79a56c9368385a0af8
Reviewed-on: https://gerrit.libreoffice.org/44581
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index bb09af238d99..3e3b691d207b 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1492,6 +1492,8 @@ EditTextObject* EditEngine::CreateTextObject()
 EditTextObject* EditEngine::CreateTextObject( const ESelection& rESelection )
 {
 EditSelection aSel( pImpEditEngine->CreateSel( rESelection ) );
+if (aSel.IsInvalid())
+return nullptr;
 return pImpEditEngine->CreateTextObject( aSel );
 }
 
diff --git a/sc/source/filter/rtf/eeimpars.cxx 
b/sc/source/filter/rtf/eeimpars.cxx
index f84cc987ef8d..cac30a4db058 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -400,10 +400,10 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, 
double nOutputFactor, SvNu
 mpDoc->SetString(nCol, nRow, nTab, aStr, );
 }
 }
-else
+else if (EditTextObject* pTextObject = 
mpEngine->CreateTextObject(pE->aSel))
 {
 // The cell will own the text object instance.
-mpDoc->SetEditText(ScAddress(nCol,nRow,nTab), 
mpEngine->CreateTextObject(pE->aSel));
+mpDoc->SetEditText(ScAddress(nCol,nRow,nTab), pTextObject);
 }
 if ( !pE->maImageList.empty() )
 bHasGraphics |= GraphicSize( nCol, nRow, pE );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source sc/source sd/qa sd/source sfx2/source svl/source svx/source sw/qa sw/source

2016-11-16 Thread Noel Grandin
 editeng/source/editeng/editattr.cxx  |2 +-
 editeng/source/editeng/editdoc.cxx   |8 
 editeng/source/editeng/editobj.cxx   |4 ++--
 editeng/source/items/frmitems.cxx|   10 +-
 editeng/source/items/numitem.cxx |4 ++--
 editeng/source/items/textitem.cxx|   12 ++--
 editeng/source/outliner/outliner.cxx |2 +-
 editeng/source/outliner/outlobj.cxx  |2 +-
 editeng/source/outliner/paralist.cxx |4 ++--
 sc/source/core/data/attrib.cxx   |2 +-
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   14 +++---
 sd/source/core/drawdoc.cxx   |2 +-
 sd/source/core/sdpage2.cxx   |2 +-
 sfx2/source/view/viewsh.cxx  |2 +-
 svl/source/items/cenumitm.cxx|2 +-
 svl/source/items/intitem.cxx |2 +-
 svl/source/items/itempool.cxx|2 +-
 svl/source/items/itemset.cxx |2 +-
 svl/source/items/poolitem.cxx|4 ++--
 svl/source/items/stritem.cxx |2 +-
 svl/source/undo/undo.cxx |6 +++---
 svx/source/sdr/properties/defaultproperties.cxx  |2 +-
 svx/source/svdraw/svdmodel.cxx   |2 +-
 svx/source/svdraw/svdobj.cxx |2 +-
 svx/source/svdraw/svdogrp.cxx|2 +-
 svx/source/svdraw/svdpage.cxx|2 +-
 svx/source/svdraw/svdtext.cxx|2 +-
 svx/source/table/cell.cxx|2 +-
 svx/source/table/svdotable.cxx   |4 ++--
 svx/source/table/tablelayouter.cxx   |4 ++--
 svx/source/table/tablemodel.cxx  |2 +-
 svx/source/xoutdev/xattr.cxx |6 +++---
 svx/source/xoutdev/xattr2.cxx|8 
 svx/source/xoutdev/xattrbmp.cxx  |2 +-
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |2 +-
 sw/qa/extras/uiwriter/uiwriter.cxx   |8 
 sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx |2 +-
 sw/source/core/crsr/bookmrk.cxx  |4 ++--
 sw/source/core/crsr/crsrsh.cxx   |2 +-
 sw/source/core/crsr/pam.cxx  |4 ++--
 sw/source/core/doc/docbm.cxx |2 +-
 sw/source/core/doc/docfmt.cxx|4 ++--
 sw/source/core/doc/docredln.cxx  |8 
 sw/source/core/doc/fmtcol.cxx|4 ++--
 sw/source/core/doc/number.cxx|4 ++--
 sw/source/core/docnode/nodes.cxx |2 +-
 sw/source/core/docnode/section.cxx   |4 ++--
 sw/source/core/fields/docufld.cxx|2 +-
 sw/source/core/fields/fldbas.cxx |4 ++--
 sw/source/core/layout/atrfrm.cxx |   22 +++---
 sw/source/core/para/paratr.cxx   |2 +-
 sw/source/core/text/xmldump.cxx  |2 +-
 sw/source/core/txtnode/atrfld.cxx|2 +-
 sw/source/core/txtnode/chrfmt.cxx|4 ++--
 sw/source/core/txtnode/fmtatr2.cxx   |2 +-
 sw/source/core/txtnode/ndtxt.cxx |8 
 sw/source/core/txtnode/txatbase.cxx  |2 +-
 sw/source/core/view/viewsh.cxx   |2 +-
 sw/source/uibase/uiview/viewprt.cxx  |2 +-
 sw/source/uibase/utlui/attrdesc.cxx  |4 ++--
 60 files changed, 119 insertions(+), 119 deletions(-)

New commits:
commit 72ffa98e892ad1b64ff3a00b1e26a995cba3076f
Author: Noel Grandin 
Date:   Wed Nov 16 08:59:00 2016 +0200

make the element names in dumpAsXml match the class names

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

diff --git a/editeng/source/editeng/editattr.cxx 
b/editeng/source/editeng/editattr.cxx
index dbd428b..33dd25b 100644
--- a/editeng/source/editeng/editattr.cxx
+++ b/editeng/source/editeng/editattr.cxx
@@ -71,7 +71,7 @@ void EditCharAttrib::SetFont( SvxFont&, OutputDevice* )
 
 void EditCharAttrib::dumpAsXml(xmlTextWriterPtr pWriter) const
 {
-xmlTextWriterStartElement(pWriter, BAD_CAST("editCharAttrib"));
+xmlTextWriterStartElement(pWriter, BAD_CAST("EditCharAttrib"));
 xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("nStart"), "%d", 
nStart);
 xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("nEnd"), "%d", nEnd);
 pItem->dumpAsXml(pWriter);
diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index 

[Libreoffice-commits] core.git: editeng/source sc/source sfx2/source svx/source vcl/source

2015-06-05 Thread Julien Nabet
 editeng/source/editeng/editdoc.cxx  |2 +-
 editeng/source/outliner/outlvw.cxx  |4 ++--
 sc/source/core/data/table3.cxx  |2 +-
 sfx2/source/view/viewfrm.cxx|2 +-
 svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx |2 +-
 vcl/source/gdi/region.cxx   |6 +++---
 6 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit c27798b20097602739e3e81a5063109b8c66447d
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sat Jun 6 00:04:47 2015 +0200

Typo: emty-empty

Change-Id: I495ae28194da449ab1b31b2b5ec0d9e08fbcc291

diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index a67add0..b5b2e4c 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -1309,7 +1309,7 @@ void ContentNode::ExpandAttribs( sal_Int32 nIndex, 
sal_Int32 nNew, SfxItemPool
 // 0: Expand empty attribute, if at insertion point
 else if ( pAttrib-IsEmpty() )
 {
-// Do not check Index, a emty one could only be there
+// Do not check Index, a empty one could only be there
 // When later checking it anyhow:
 //   Special caase: Start == 0; AbsLen == 1, nNew = 1
 // = Expand, because of paragraph break!
diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index 92f9678..be1bc25 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -64,7 +64,7 @@ OutlinerView::~OutlinerView()
 
 void OutlinerView::Paint( const Rectangle rRect, OutputDevice* pTargetDevice )
 {
-// For the first Paint/KeyInput/Drop an emty Outliner is turned into
+// For the first Paint/KeyInput/Drop an empty Outliner is turned into
 // an Outliner with exactly one paragraph.
 if( pOwner-bFirstParaIsEmpty )
 pOwner-Insert( OUString() );
@@ -74,7 +74,7 @@ void OutlinerView::Paint( const Rectangle rRect, 
OutputDevice* pTargetDevice )
 
 bool OutlinerView::PostKeyEvent( const KeyEvent rKEvt, vcl::Window* pFrameWin 
)
 {
-// For the first Paint/KeyInput/Drop an emty Outliner is turned into
+// For the first Paint/KeyInput/Drop an empty Outliner is turned into
 // an Outliner with exactly one paragraph.
 if( pOwner-bFirstParaIsEmpty )
 pOwner-Insert( OUString() );
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 044802e..92773b6 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1921,7 +1921,7 @@ bool ScTable::DoSubTotals( ScSubTotalParam rParam )
 SCROW nEndRow= rParam.nRow2;// will change
 sal_uInt16 i;
 
-//  Remove emty rows at the end
+//  Remove empty rows at the end
 //  so that all exceeding (MAXROW) can be found by InsertRow (#35180#)
 //  If sorted, all empty rows are at the end.
 SCSIZE nEmpty = GetEmptyLinesInBlock( nStartCol, nStartRow, nEndCol, 
nEndRow, DIR_BOTTOM );
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 4c27c32..29736a9 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -590,7 +590,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest rReq )
 bool bHandsOff =
 ( pMedium-GetURLObject().GetProtocol() == 
INetProtocol::File  !xOldObj-IsDocShared() );
 
-// Emty existing SfxMDIFrames for this Document
+// Empty existing SfxMDIFrames for this Document
 // in native format or R/O, open it now for editing?
 SfxObjectShellLock xNewObj;
 
diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx 
b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
index 2a75b4b..ea4ffa3 100644
--- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
@@ -54,7 +54,7 @@ namespace drawinglayer
 #ifdef WNT // Little point in displaying the broken OLE graphic on OSes that 
don't have real OLE, maybe?
 if(GRAPHIC_NONE == aGraphic.GetType())
 {
-// no source, use fallback resource emty OLE graphic
+// no source, use fallback resource empty OLE graphic
 aGraphic = SdrOle2Obj::GetEmptyOLEReplacementGraphic();
 bScaleContent = true;
 }
diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx
index 1543d83..9435595 100644
--- a/vcl/source/gdi/region.cxx
+++ b/vcl/source/gdi/region.cxx
@@ -973,7 +973,7 @@ bool vcl::Region::Intersect( const vcl::Region rRegion )
 
 if(IsEmpty())
 {
-// local region is empty, cannot get more emty than that. Nothing to do
+// local region is empty, cannot get more empty than that. Nothing to 
do
 return true;
 }
 
@@ 

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

2015-01-04 Thread Julien Nabet
 editeng/source/editeng/impedit4.cxx |   10 +-
 sc/source/core/data/documen8.cxx|6 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit d279115a14faab0005c4dd20e2b2be43a4849b18
Author: Julien Nabet serval2...@yahoo.fr
Date:   Tue Feb 3 15:39:54 2015 +0100

Typo: translitaration-transliteration

Change-Id: If722e7d025db65b72419499f1443d5f0cda609dd

diff --git a/editeng/source/editeng/impedit4.cxx 
b/editeng/source/editeng/impedit4.cxx
index 63932c9..5494413 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -2740,8 +2740,8 @@ EditSelection ImpEditEngine::TransliterateText( const 
EditSelection rSelection,
 bool bLenChanged = false;
 EditUndoTransliteration* pUndo = NULL;
 
-utl::TransliterationWrapper aTranslitarationWrapper( 
::comphelper::getProcessComponentContext(), nTransliterationMode );
-bool bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode();
+utl::TransliterationWrapper aTransliterationWrapper( 
::comphelper::getProcessComponentContext(), nTransliterationMode );
+bool bConsiderLanguage = aTransliterationWrapper.needLanguageForTheMode();
 
 for ( sal_Int32 nNode = nStartNode; nNode = nEndNode; nNode++ )
 {
@@ -2814,7 +2814,7 @@ EditSelection ImpEditEngine::TransliterateText( const 
EditSelection rSelection,
 #endif
 
 Sequence sal_Int32  aOffsets;
-OUString aNewText( 
aTranslitarationWrapper.transliterate(aNodeStr,
+OUString aNewText( 
aTransliterationWrapper.transliterate(aNodeStr,
 GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ),
 nCurrentStart, nLen, aOffsets ));
 
@@ -2902,7 +2902,7 @@ EditSelection ImpEditEngine::TransliterateText( const 
EditSelection rSelection,
 #endif
 
 Sequence sal_Int32  aOffsets;
-OUString aNewText( aTranslitarationWrapper.transliterate( 
aNodeStr,
+OUString aNewText( aTransliterationWrapper.transliterate( 
aNodeStr,
 GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ),
 nCurrentStart, nLen, aOffsets ));
 
@@ -2942,7 +2942,7 @@ EditSelection ImpEditEngine::TransliterateText( const 
EditSelection rSelection,
 const sal_Int32 nLen = nCurrentEnd - nCurrentStart;
 
 Sequence sal_Int32  aOffsets;
-OUString aNewText( aTranslitarationWrapper.transliterate( 
aNodeStr, nLanguage, nCurrentStart, nLen, aOffsets ) );
+OUString aNewText( aTransliterationWrapper.transliterate( 
aNodeStr, nLanguage, nCurrentStart, nLen, aOffsets ) );
 
 if (aNodeStr != aNewText.copy( nCurrentStart, nLen ))
 {
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index ee3bd90..7d7eca8 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1200,8 +1200,8 @@ void ScDocument::TransliterateText( const ScMarkData 
rMultiMark, sal_Int32 nTyp
 {
 OSL_ENSURE( rMultiMark.IsMultiMarked(), TransliterateText: no selection 
);
 
-utl::TransliterationWrapper aTranslitarationWrapper( 
comphelper::getProcessComponentContext(), nType );
-bool bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode();
+utl::TransliterationWrapper aTransliterationWrapper( 
comphelper::getProcessComponentContext(), nType );
+bool bConsiderLanguage = aTransliterationWrapper.needLanguageForTheMode();
 sal_uInt16 nLanguage = LANGUAGE_SYSTEM;
 
 boost::scoped_ptrScEditEngineDefaulter pEngine;// not using 
pEditEngine member because of defaults
@@ -1300,7 +1300,7 @@ void ScDocument::TransliterateText( const ScMarkData 
rMultiMark, sal_Int32 nTyp
 }
 
 uno::Sequencesal_Int32 aOffsets;
-OUString aNewStr = aTranslitarationWrapper.transliterate( 
aOldStr, nLanguage, 0, nOldLen, aOffsets );
+OUString aNewStr = aTransliterationWrapper.transliterate( 
aOldStr, nLanguage, 0, nOldLen, aOffsets );
 
 if ( aNewStr != aOldStr )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-09-11 Thread Ricardo Montania
 editeng/source/items/frmitems.cxx   |2 -
 sc/source/core/tool/stylehelper.cxx |5 --
 sc/source/filter/html/htmlexp.cxx   |   65 ++--
 sc/source/filter/html/htmlexp2.cxx  |   16 
 sc/source/filter/inc/htmlexp.hxx|   16 
 5 files changed, 45 insertions(+), 59 deletions(-)

New commits:
commit 80e5e65c93a405f54089c59cf18e04486f9634b7
Author: Ricardo Montania rica...@linuxafundo.com.br
Date:   Tue Sep 10 23:03:56 2013 +

String cleanup

Conflicts:
cui/source/tabpages/backgrnd.cxx
editeng/source/items/frmitems.cxx
editeng/source/items/numitem.cxx
include/editeng/brushitem.hxx
include/svx/xoutbmp.hxx
sc/source/filter/html/htmlexp.cxx
sc/source/filter/html/htmlexp2.cxx
svx/source/core/extedit.cxx
svx/source/core/graphichelper.cxx
svx/source/sidebar/nbdtmg.cxx
sw/source/ui/shells/txtnum.cxx

Change-Id: I1f548a01574a18e3f3a402ee491358fa36b349e7
Reviewed-on: https://gerrit.libreoffice.org/5907
Reviewed-by: Thomas Arnhold tho...@arnhold.org
Tested-by: Thomas Arnhold tho...@arnhold.org

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 177c20d..0c5917d 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3524,7 +3524,7 @@ SvxBrushItem::SvxBrushItem( SvStream rStream, sal_uInt16 
nVersion,
 // TODO/MBA: how can we get a BaseURL here?!
 OSL_FAIL(No BaseURL!);
 OUString aAbs = INetURLObject::GetAbsURL( , aRel );
-DBG_ASSERT( aAbs.getLength(), Invalid URL! );
+DBG_ASSERT( !aAbs.isEmpty(), Invalid URL! );
 maStrLink = aAbs;
 }
 
diff --git a/sc/source/core/tool/stylehelper.cxx 
b/sc/source/core/tool/stylehelper.cxx
index a5e5b5b..8cfd679 100644
--- a/sc/source/core/tool/stylehelper.cxx
+++ b/sc/source/core/tool/stylehelper.cxx
@@ -124,10 +124,7 @@ OUString ScStyleNameConversion::DisplayToProgrammaticName( 
const OUString rDisp
 {
 //  add the (user) suffix if the display name matches any style's 
programmatic name
 //  or if it already contains the suffix
-
-String aRet(rDispName);
-aRet.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SC_SUFFIX_USER ) );
-return aRet;
+return rDispName + SC_SUFFIX_USER;
 }
 
 return rDispName;
diff --git a/sc/source/filter/html/htmlexp.cxx 
b/sc/source/filter/html/htmlexp.cxx
index e0a7185..f5e2713 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -125,7 +125,6 @@ const sal_Char ScHTMLExport::sIndentSource[nIndentMax+1] =
  GetIndentStr())
 
 #define OUT_SP_CSTR_ASS( s )rStrm  ' '  s  '='
-#define APPEND_SPACE( s )   s.AppendAscii( )
 
 #define GLOBSTR(id) ScGlobal::GetRscString( id )
 
@@ -163,7 +162,7 @@ static OString lcl_getColGroupString(sal_Int32 nSpan, 
sal_Int32 nWidth)
 }
 
 
-static void lcl_AddStamp( String rStr, const String rName,
+static void lcl_AddStamp( OUString rStr, const OUString rName,
 const ::com::sun::star::util::DateTime rDateTime,
 const LocaleDataWrapper rLoc )
 {
@@ -172,33 +171,30 @@ static void lcl_AddStamp( String rStr, const String 
rName,
 rDateTime.NanoSeconds);
 DateTime aDateTime(aD,aT);
 
-String  aStrDate= rLoc.getDate( aDateTime );
-String  aStrTime= rLoc.getTime( aDateTime );
+OUStringaStrDate= rLoc.getDate( aDateTime );
+OUStringaStrTime= rLoc.getTime( aDateTime );
 
-rStr += GLOBSTR( STR_BY );
-APPEND_SPACE( rStr );
-if (rName.Len())
+rStr += GLOBSTR( STR_BY ) +  ;
+if (!rName.isEmpty())
 rStr += rName;
 else
-rStr.AppendAscii( ??? );
-APPEND_SPACE( rStr );
-rStr += GLOBSTR( STR_ON );
-APPEND_SPACE( rStr );
-if (aStrDate.Len())
+rStr += ???;
+rStr +=   + GLOBSTR( STR_ON ) +  ;
+if (!aStrDate.isEmpty())
 rStr += aStrDate;
 else
-rStr.AppendAscii( ??? );
-rStr.AppendAscii( ,  );
-if (aStrTime.Len())
+rStr += ???;
+rStr += , ;
+if (!aStrTime.isEmpty())
 rStr += aStrTime;
 else
-rStr.AppendAscii( ??? );
+rStr += ???;
 }
 
 
 static OString lcl_makeHTMLColorTriplet(const Color rColor)
 {
-OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM(\#));
+OStringBuffer aStr( \# );
 // font COLOR=#00FF40hello/font
 sal_Charbuf[64];
 sal_Char*   p = buf;
@@ -259,7 +255,7 @@ ScHTMLExport::ScHTMLExport( SvStream rStrmP, const String 
rBaseURL, ScDocument
 if( pItem )
 {
 aCId = ((const SfxStringItem *)pItem)-GetValue();
-OSL_ENSURE( aCId.Len(), CID without length! );
+OSL_ENSURE( !aCId.isEmpty(), CID without length! );
 }
 }
 }
@@ -356,8 +352,7 @@ void ScHTMLExport::WriteHeader()
 if 

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

2013-03-26 Thread Thomas Arnhold
 editeng/source/items/frmitems.cxx  |   22 --
 sc/source/core/data/fillinfo.cxx   |   17 -
 sc/source/core/data/olinetab.cxx   |7 ---
 sc/source/filter/inc/xihelper.hxx  |2 --
 sc/source/ui/miscdlgs/acredlin.cxx |8 
 sc/source/ui/miscdlgs/highred.cxx  |8 
 sc/source/ui/view/drawutil.cxx |9 -
 sw/source/core/doc/number.cxx  |9 -
 sw/source/core/docnode/nodes.cxx   |5 -
 sw/source/ui/dialog/uiregionsw.cxx |5 -
 vcl/source/app/settings.cxx|8 
 xmloff/source/text/txtflde.cxx |   12 
 12 files changed, 112 deletions(-)

New commits:
commit 646daee253b69404591c006ec6e717b6660af30b
Author: Thomas Arnhold tho...@arnhold.org
Date:   Wed Mar 27 02:57:35 2013 +0100

kill some unused inlines

Change-Id: I17160b264b547067c694dd268eb0d3bd1086565d

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 869f3a1..65b5fa0 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -88,28 +88,6 @@ using namespace ::com::sun::star::table::BorderLineStyle;
 #define TWIP_TO_MM100_UNSIGNED(TWIP) TWIP)*127L+36L)/72L))
 #define MM100_TO_TWIP_UNSIGNED(MM100)MM100)*72L+63L)/127L))
 
-// STATIC DATA ---
-
-inline void SetValueProp( XubString rStr, const sal_uInt16 nValue,
-  const sal_uInt16 nProp )
-{
-if( 100 == nProp )
-rStr += OUString::number( nValue );
-else
-rStr += OUString::number(nProp) + %;
-}
-
-inline void SetValueProp( XubString rStr, const short nValue,
-  const sal_uInt16 nProp )
-{
-if( 100 == nProp )
-rStr += OUString::number( nValue );
-else
-rStr += OUString::number(nProp) + %;
-}
-
-// ---
-
 /*
 SvxBorderLine is not an SfxPoolItem, and has no Store/Create 
serialization/deserialization methods.
 Since border line information needs to be serialized by the table autoformat 
code, these file-local
diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx
index f7366cd..40ed6ba 100644
--- a/sc/source/core/data/fillinfo.cxx
+++ b/sc/source/core/data/fillinfo.cxx
@@ -57,23 +57,6 @@ enum FillInfoLinePos
 };
 
 
-inline const ::editeng::SvxBorderLine* GetNullOrLine( const SvxBoxItem* pBox, 
FillInfoLinePos eWhich )
-{
-if (pBox)
-{
-if (eWhich==FILP_TOP)
-return pBox-GetTop();
-else if (eWhich==FILP_BOTTOM)
-return pBox-GetBottom();
-else if (eWhich==FILP_LEFT)
-return pBox-GetLeft();
-else
-return pBox-GetRight();
-}
-else
-return NULL;
-}
-
 //  aehnlich wie in output.cxx
 
 static void lcl_GetMergeRange( SCsCOL nX, SCsROW nY, SCSIZE nArrY,
diff --git a/sc/source/core/data/olinetab.cxx b/sc/source/core/data/olinetab.cxx
index eb6461b..307aba1 100644
--- a/sc/source/core/data/olinetab.cxx
+++ b/sc/source/core/data/olinetab.cxx
@@ -108,13 +108,6 @@ void ScOutlineEntry::SetVisible( bool bNewVisible )
 
 ScOutlineCollection::ScOutlineCollection() {}
 
-inline short IntCompare( SCCOLROW nX, SCCOLROW nY )
-{
-if ( nX==nY ) return 0;
-else if ( nXnY ) return -1;
-else return 1;
-}
-
 size_t ScOutlineCollection::size() const
 {
 return maEntries.size();
diff --git a/sc/source/filter/inc/xihelper.hxx 
b/sc/source/filter/inc/xihelper.hxx
index 33f7cea..8057fff 100644
--- a/sc/source/filter/inc/xihelper.hxx
+++ b/sc/source/filter/inc/xihelper.hxx
@@ -310,8 +310,6 @@ public:
 inline sal_uInt8GetXclError() const { return (mnType == 
EXC_CACHEDVAL_ERROR) ? mnBoolErr : EXC_ERR_NA; }
 /** Returns the cached Calc error code, if this value has Error type, else 
0. */
 sal_uInt16  GetScError() const;
-/** Returns the token array if this is a Boolean value or error value, 
else 0. */
-inline const ScTokenArray* GetBoolErrFmla() const { return mxTokArr.get(); 
}
 
 protected:
 typedef ::std::auto_ptr StringStringPtr;
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx 
b/sc/source/ui/miscdlgs/acredlin.cxx
index 004cf24..8415540 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -51,14 +51,6 @@
 
 #define ERRORBOX(s) ErrorBox(this,WinBits(WB_OK|WB_DEF_OK),s).Execute();
 
-inline void EnableDisable( Window rWin, bool bEnable )
-{
-if (bEnable)
-rWin.Enable();
-else
-rWin.Disable();
-}
-
 #define RD_SPECIAL_NONE 0
 #define RD_SPECIAL_CONTENT  1
 #define RD_SPECIAL_VISCONTENT   2
diff --git a/sc/source/ui/miscdlgs/highred.cxx 
b/sc/source/ui/miscdlgs/highred.cxx
index 6b0a227..752bf70 100644
--- a/sc/source/ui/miscdlgs/highred.cxx
+++ b/sc/source/ui/miscdlgs/highred.cxx
@@ -42,14 +42,6 @@
 
 #define ERRORBOX(s) 

[Libreoffice-commits] core.git: editeng/source sc/source sw/inc sw/source vcl/inc vcl/Package_inc.mk vcl/source

2013-02-28 Thread Tor Lillqvist
 editeng/source/editeng/impedit2.cxx |  106 
 sc/source/ui/app/inputwin.cxx   |2 
 sc/source/ui/view/gridwin.cxx   |   28 -
 sw/inc/pch/precompiled_sw.hxx   |1 
 sw/source/ui/docvw/edtwin.cxx   |   90 --
 vcl/Package_inc.mk  |1 
 vcl/inc/vcl/cmdevt.h|   50 
 vcl/inc/vcl/cmdevt.hxx  |   53 --
 vcl/source/control/edit.cxx |   37 
 9 files changed, 2 insertions(+), 366 deletions(-)

New commits:
commit 04df3cb2b9e1026b8aeb809805bc4878c047eb76
Author: Tor Lillqvist t...@iki.fi
Date:   Thu Feb 28 00:11:15 2013 +0200

Remove dead voice command code

I don't see voice input commands being generated anywhere. Nobody seems to
know what this code has been used for.

Change-Id: I4e4221dd4dff76086d0268be286c3605e669bae7
Reviewed-on: https://gerrit.libreoffice.org/2452
Reviewed-by: Niko Rönkkö ron...@iki.fi
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index 8129570..d34a387 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -49,7 +49,6 @@
 #include editeng/frmdiritem.hxx
 #include editeng/fontitem.hxx
 #include editeng/justifyitem.hxx
-#include vcl/cmdevt.h
 
 #include com/sun/star/i18n/CharacterIteratorMode.hpp
 #include com/sun/star/i18n/WordType.hpp
@@ -348,110 +347,7 @@ void ImpEditEngine::Command( const CommandEvent rCEvt, 
EditView* pView )
 {
 GetSelEngine().SetCurView( pView );
 SetActiveView( pView );
-if ( rCEvt.GetCommand() == COMMAND_VOICE )
-{
-const CommandVoiceData* pData = rCEvt.GetVoiceData();
-if ( pData-GetType() == VOICECOMMANDTYPE_DICTATION )
-{
-// Turn functions into KeyEvent if no corresponding method to
-// EditView/EditEngine so that Undo remains consistent.
-SfxPoolItem* pNewAttr = NULL;
-
-switch ( pData-GetCommand() )
-{
-case DICTATIONCOMMAND_UNKNOWN:
-{
-pView-InsertText( pData-GetText() );
-}
-break;
-case DICTATIONCOMMAND_NEWPARAGRAPH:
-{
-pView-PostKeyEvent( KeyEvent( 0, KeyCode( KEY_RETURN, 0 ) 
) );
-}
-break;
-case DICTATIONCOMMAND_NEWLINE:
-{
-pView-PostKeyEvent( KeyEvent( 0, KeyCode( KEY_RETURN, 
KEY_SHIFT ) ) );
-}
-break;
-case DICTATIONCOMMAND_TAB:
-{
-pView-PostKeyEvent( KeyEvent( 0, KeyCode( KEY_TAB, 0 ) ) 
);
-}
-break;
-case DICTATIONCOMMAND_LEFT:
-{
-pView-PostKeyEvent( KeyEvent( 0, KeyCode( KEY_LEFT, 
KEY_MOD1  ) ) );
-}
-break;
-case DICTATIONCOMMAND_RIGHT:
-{
-pView-PostKeyEvent( KeyEvent( 0, KeyCode( KEY_RIGHT, 
KEY_MOD1  ) ) );
-}
-break;
-case DICTATIONCOMMAND_UP:
-{
-pView-PostKeyEvent( KeyEvent( 0, KeyCode( KEY_UP, 0 ) ) );
-}
-break;
-case DICTATIONCOMMAND_DOWN:
-{
-pView-PostKeyEvent( KeyEvent( 0, KeyCode( KEY_UP, 0 ) ) );
-}
-break;
-case DICTATIONCOMMAND_UNDO:
-{
-pView-Undo();
-}
-break;
-case DICTATIONCOMMAND_DEL:
-{
-pView-PostKeyEvent( KeyEvent( 0, KeyCode( KEY_LEFT, 
KEY_MOD1|KEY_SHIFT  ) ) );
-pView-DeleteSelected();
-}
-break;
-case DICTATIONCOMMAND_BOLD_ON:
-{
-pNewAttr = new SvxWeightItem( WEIGHT_BOLD, EE_CHAR_WEIGHT 
);
-}
-break;
-case DICTATIONCOMMAND_BOLD_OFF:
-{
-pNewAttr = new SvxWeightItem( WEIGHT_NORMAL, 
EE_CHAR_WEIGHT );
-}
-break;
-case DICTATIONCOMMAND_ITALIC_ON:
-{
-pNewAttr = new SvxPostureItem( ITALIC_NORMAL, 
EE_CHAR_ITALIC );
-}
-break;
-case DICTATIONCOMMAND_ITALIC_OFF:
-{
-pNewAttr = new SvxPostureItem( ITALIC_NORMAL, 
EE_CHAR_ITALIC );
-}
-break;
-case DICTATIONCOMMAND_UNDERLINE_ON:
-{
-pNewAttr =