[Libreoffice-commits] core.git: desktop/source sc/source vcl/inc vcl/jsdialog vcl/source

2022-04-30 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx  |2 
 sc/source/ui/app/inputwin.cxx|   86 ---
 sc/source/ui/inc/inputwin.hxx|3 -
 vcl/inc/jsdialog/jsdialogbuilder.hxx |7 ++
 vcl/jsdialog/jsdialogbuilder.cxx |   34 +
 vcl/source/window/builder.cxx|   11 +++-
 6 files changed, 52 insertions(+), 91 deletions(-)

New commits:
commit cdf2a60de28d7f36b5404451474cadb65db40a11
Author: Szymon Kłos 
AuthorDate: Sat Apr 9 22:51:49 2022 +0200
Commit: Szymon Kłos 
CommitDate: Sat Apr 30 11:47:53 2022 +0200

jsdialog: used for formulabar

- do not block painting
- use welded wrappers to send JSON
- don't send tunneled dialog

Change-Id: I54c3cd02ab63bad4a50a3623a32f13b0c94a3595
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132757
Reviewed-by: Mert Tumer 
Tested-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133651
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 462e2e5d25af..914885b30065 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4057,6 +4057,8 @@ static void lcl_sendDialogEvent(unsigned long long int 
nWindowId, const char* pA
 bFoundWeldedControl = 
jsdialog::ExecuteAction(std::to_string(nCurrentShellId) + "sidebar", 
sControlId, aMap);
 if (!bFoundWeldedControl)
 bFoundWeldedControl = 
jsdialog::ExecuteAction(std::to_string(nCurrentShellId) + "notebookbar", 
sControlId, aMap);
+if (!bFoundWeldedControl)
+bFoundWeldedControl = 
jsdialog::ExecuteAction(std::to_string(nCurrentShellId) + "formulabar", 
sControlId, aMap);
 if (!bFoundWeldedControl && !SfxViewShell::Current())
 {
 // this is needed for dialogs shown before document is loaded: 
MacroWarning dialog, etc...
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index aae96bbf281d..ff717e5acf44 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -308,11 +308,8 @@ void ScInputWindow::dispose()
 
 if (comphelper::LibreOfficeKit::isActive())
 {
-if(const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
-{
-pNotifier->notifyWindow(GetLOKWindowId(), "close");
+if (GetLOKNotifier())
 ReleaseLOKNotifier();
-}
 }
 
 mxTextWindow.disposeAndClear();
@@ -419,24 +416,6 @@ void ScInputWindow::Select()
 }
 }
 
-void ScInputWindow::Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect)
-{
-if (comphelper::LibreOfficeKit::isActive() && 
!comphelper::LibreOfficeKit::isDialogPainting())
-return;
-
-ToolBox::Paint(rRenderContext, rRect);
-
-if (!comphelper::LibreOfficeKit::isActive())
-{
-// draw a line at the bottom to distinguish that from the grid
-// const StyleSettings& rStyleSettings = 
rRenderContext.GetSettings().GetStyleSettings();
-// rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());
-// Size aSize = GetSizePixel();
-// rRenderContext.DrawLine(Point(0, aSize.Height() - 1),
-//Point(aSize.Width() - 1, aSize.Height() - 
1));
-}
-}
-
 void ScInputWindow::PixelInvalidate(const tools::Rectangle* pRectangle)
 {
 if (comphelper::LibreOfficeKit::isDialogPainting() || 
!comphelper::LibreOfficeKit::isActive())
@@ -476,20 +455,6 @@ void ScInputWindow::SetSizePixel( const Size& rNewSize )
 ToolBox::SetSizePixel(rNewSize);
 }
 
-void ScInputWindow::setPosSizePixel(tools::Long nX, tools::Long nY, 
tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags)
-{
-ToolBox::setPosSizePixel(nX, nY, nWidth, nHeight, nFlags);
-if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
-{
-std::vector aItems;
-aItems.emplace_back(std::make_pair("position", 
Point(GetOutOffXPixel(), GetOutOffYPixel()).toString()));
-aItems.emplace_back("size", GetSizePixel().toString());
-aItems.emplace_back("lines", 
OString::number(mxTextWindow->GetNumLines()));
-pNotifier->notifyWindow(GetLOKWindowId(), "size_changed", aItems);
-Invalidate();
-}
-}
-
 void ScInputWindow::Resize()
 {
 ToolBox::Resize();
@@ -520,15 +485,6 @@ void ScInputWindow::Resize()
 }
 SetSizePixel(aSize);
 
-if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
-{
-std::vector aItems;
-aItems.emplace_back(std::make_pair("position", 
Point(GetOutOffXPixel(), GetOutOffYPixel()).toString()));
-aItems.emplace_back("size", GetSizePixel().toString());
-aItems.emplace_back("lines", 
OString::number(mxTextWindow->GetNumLines()));
-pNotifier->notifyWindow(GetLOKWindowId(), "size_changed", aItems);
-}
-
 Invalidate();
 }
 
@@ -536,21 +492,6 @@ void ScInputWindow::Notify

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

2021-07-20 Thread Eike Rathke (via logerrit)
 desktop/source/app/dispatchwatcher.cxx |   19 +++--
 sc/source/ui/docshell/docsh.cxx|   48 +++--
 2 files changed, 45 insertions(+), 22 deletions(-)

New commits:
commit 0cda081c9aa3b3dcb363f97bac60c845ce9a13e0
Author: Eike Rathke 
AuthorDate: Tue Jul 20 23:09:59 2021 +0200
Commit: Eike Rathke 
CommitDate: Wed Jul 21 01:26:15 2021 +0200

Related: tdf#135762 Suppress cout if not command line

Change-Id: I9431221aadf97739bb197871f25fa151ef4c391c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119294
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index 1c4d878614c5..0e39415d8fab 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -608,15 +608,17 @@ bool DispatchWatcher::executeDispatchRequests( const 
std::vector conversionProperties( 
nProps );
-conversionProperties[0].Name = "Overwrite";
-conversionProperties[0].Value <<= true;
+conversionProperties[0].Name = 
"ConversionRequestOrigin";
+conversionProperties[0].Value <<= 
OUString("CommandLine");
+conversionProperties[1].Name = "Overwrite";
+conversionProperties[1].Value <<= true;
 
-conversionProperties[1].Name = "FilterName";
+conversionProperties[2].Name = "FilterName";
 if( 0 < nFilterOptionsIndex )
 {
 OUString sFilterName = aFilter.copy(0, 
nFilterOptionsIndex);
@@ -641,18 +643,19 @@ bool DispatchWatcher::executeDispatchRequests( const 
std::vector & rArgs = 
rMed.GetArgs();
+const auto pProp = std::find_if( rArgs.begin(), rArgs.end(),
+[](const css::beans::PropertyValue& rProp) { return 
rProp.Name == "ConversionRequestOrigin"; });
+if (pProp != rArgs.end())
+{
+OUString aOrigin;
+pProp->Value >>= aOrigin;
+bVerbose = (aOrigin == "CommandLine");
+}
+
 SCTAB nStartTab;
 SCTAB nCount = m_aDocument.GetTableCount();
 if (aOptions.nSheetToExport == -1)
@@ -2433,11 +2446,14 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
 else
 {
 // Usage error, no export but log.
-if (aOptions.nSheetToExport < 0)
-std::cout << "Bad sheet number string given." << std::endl;
-else
-std::cout << "No sheet number " << 
OString::number(aOptions.nSheetToExport)
-<< ", number of sheets is 
" << nCount << std::endl;
+if (bVerbose)
+{
+if (aOptions.nSheetToExport < 0)
+std::cout << "Bad sheet number string given." << 
std::endl;
+else
+std::cout << "No sheet number " << 
aOptions.nSheetToExport
+<< ", number of sheets is " << nCount << std::endl;
+}
 nStartTab = 0;
 nCount = 0;
 SetError(SCERR_EXPORT_DATA);
@@ -2462,15 +2478,19 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
 
 // log similar to DispatchWatcher::executeDispatchRequests
 OUString aOutFile = 
aSheetURLObject.GetMainURL(INetURLObject::DecodeMechanism::NONE);
-OUString aDisplayedName;
-if (osl::FileBase::E_None != 
osl::FileBase::getSystemPathFromFileURL(aOutFile, aDisplayedName))
-aDisplayedName = aOutFile;
-std::cout << "Writing sheet " << OUStringToOString(sTabName, 
osl_getThreadTextEncoding()) << " -> "
-  << 
OUStringToOString(aDisplayedName, osl_getThreadTextEncoding())
-  << std::endl;
-
-if (FStatHelper::IsDocument(aOutFile))
-std::cout << "Overwriting: " << 
OUStringToOString(aDisplayedName, osl_getThreadTextEncoding()) << std::endl ;
+if (bVerbose)
+{
+OUString aDisplayedName;
+if (osl::FileBase::E_None != 
osl::FileBase::getSystemPathFromFileURL(aOutFile, aDisplayedName))
+aDisplayedName = aOutFile;
+std::cout << "Writing sheet " << 
OUStringToOString(sTabName, osl_getThreadTextEncoding()) << " -> "
+  << 
OUStringToOString(aDisplayedName, osl_getThreadTextEncoding())
+  << std::endl;
+
+  

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

2021-07-15 Thread Eike Rathke (via logerrit)
 desktop/source/app/dispatchwatcher.cxx |   13 ++--
 sc/source/ui/dbgui/imoptdlg.cxx|   15 +++---
 sc/source/ui/docshell/docsh.cxx|   34 ++---
 sc/source/ui/inc/imoptdlg.hxx  |8 +++
 4 files changed, 58 insertions(+), 12 deletions(-)

New commits:
commit fda91f8be16ba760e360940ebafd6244c648cb8c
Author: Eike Rathke 
AuthorDate: Thu Jul 15 10:37:57 2021 +0200
Commit: Eike Rathke 
CommitDate: Thu Jul 15 13:02:04 2021 +0200

Related: tdf#135762 Allow --convert-to csv to specify 1-based sheet number

Same multifile mechanism as for -1 all sheets is used, so

soffice --convert-to csv:"Text - txt - csv 
(StarCalc)":44,34,UTF8,1,,0,false,true,false,false,false,2 sample.ods

writes a file sample-Sheet2.csv

Change-Id: Ib9248c9561e4e340c88458ac5dfd159e443a4cfd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118971
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index 8541c273cc83..1c4d878614c5 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -625,11 +625,20 @@ bool DispatchWatcher::executeDispatchRequests( const 
std::vector0 then that sheet 
(1-based) with the output
+// filename concatenated with the 
sheet name. So even if
+// that is a single file, the multi 
file target mechanism is
+// used.
+const OUString 
aTok(sFilterOptions.getToken(11, ',', nIdx));
+// Actual validity is checked in Calc, 
here just check for
+// presence of numeric value at start.
+bMultiFileTarget = (!aTok.isEmpty() && 
aTok.toInt32() != 0);
 }
 
 conversionProperties[1].Value <<= 
sFilterName;
diff --git a/sc/source/ui/dbgui/imoptdlg.cxx b/sc/source/ui/dbgui/imoptdlg.cxx
index d8c4fd810ea3..a362e4df0ee7 100644
--- a/sc/source/ui/dbgui/imoptdlg.cxx
+++ b/sc/source/ui/dbgui/imoptdlg.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -43,7 +44,7 @@ ScImportOptions::ScImportOptions( const OUString& rStr )
 bSaveNumberAsSuch = true;
 bSaveFormulas = false;
 bRemoveSpace = false;
-bNewFilePerSheet = false;
+nSheetToExport = 0;
 sal_Int32 nTokenCount = comphelper::string::getTokenCount(rStr, ',');
 if ( nTokenCount < 3 )
 return;
@@ -79,7 +80,15 @@ ScImportOptions::ScImportOptions( const OUString& rStr )
 if ( nTokenCount >= 11 )
 bRemoveSpace = rStr.getToken(0, ',', nIdx) == "true";
 if ( nTokenCount >= 12 )
-bNewFilePerSheet = rStr.getToken(0, ',', nIdx) == "-1";
+{
+const OUString aTok(rStr.getToken(0, ',', nIdx));
+if (aTok == "-1")
+nSheetToExport = -1;// all
+else if (aTok.isEmpty() || CharClass::isAsciiNumeric(aTok))
+nSheetToExport = aTok.toInt32();
+else
+nSheetToExport = -23;   // invalid, force error
+}
 }
 }
 
@@ -104,7 +113,7 @@ OUString ScImportOptions::BuildString() const
 "," +
 OUString::boolean( bRemoveSpace ) +  // same as "Remove space" in 
ScAsciiOptions
 "," +
-std::u16string_view(bNewFilePerSheet ? u"-1" : u"0") ;  // Only 
available for command line --convert-to
+OUString::number(nSheetToExport) ;  // Only available for command 
line --convert-to
 
 return aResult;
 }
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 873e5c598bab..21137a7bb1b6 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2412,16 +2412,44 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
 weld::WaitObject aWait( GetActiveDialogParent() );
 ScImportOptions aOptions( sItStr );
 
-if (aOptions.bNewFilePerSheet)
+if (aOptions.nSheetToExport)
 {
+// Only from command line --convert-to
 bRet = true;
 
+SCTAB nStartTab;
+SCTAB nCount = m_aDocument.GetTableCount();
+if (aOptions.nSheetToExport == -1)
+{
+// All sheets.
+nStartTab = 0;
+}
+else if (0 < aOptions.nSheetToExport && aOptions.nSheetToExport <= 
nCount)
+{
+// One sheet, 1-based.
+nCount = aOptions.nSheetToExport;
+nStartTab = nCount - 1;
+}
+else
+{
+// Usage error, no export but log.
+if (aOptions.nSheetToExport < 0)
+ 

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

2021-07-14 Thread Caolán McNamara (via logerrit)
 desktop/source/app/dispatchwatcher.cxx |   26 +++-
 sc/source/ui/dbgui/imoptdlg.cxx|7 ++
 sc/source/ui/docshell/docsh.cxx|   97 -
 sc/source/ui/inc/docsh.hxx |2 
 sc/source/ui/inc/imoptdlg.hxx  |6 +-
 5 files changed, 106 insertions(+), 32 deletions(-)

New commits:
commit b8903bc106dad036acb3d117e5c4fc955697fe02
Author: Caolán McNamara 
AuthorDate: Tue Jul 13 12:38:07 2021 +0100
Commit: Eike Rathke 
CommitDate: Wed Jul 14 20:37:33 2021 +0200

rhbz#1980800 allow --convert-to csv to write each sheet to a separate file

Related: tdf#135762 except only currently implemented for command line use

sample usage:
soffice --convert-to csv:"Text - txt - csv 
(StarCalc)":44,34,UTF8,1,,0,false,true,false,false,false,-1 sample.ods
where the new (11th!) final token ("-1") enables writing each sheet to a
new file based on the suggested target name so output in this example
is files sample-Sheet1.csv and sample-Sheet2.csv

Only -1 for 'all sheets' vs 0 for existing 'current sheet only' (which
is always sheet 0 from the command line) are currently options but the
token could be expanded in the future to select specific sheets to
export.

Change-Id: Ib99a120f1a2c8d1008a7a3c59a6b39f572fb346e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118850
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index a2e79d8283ae..8541c273cc83 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -30,6 +30,7 @@
 #include "officeipcthread.hxx"
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -598,6 +599,8 @@ bool DispatchWatcher::executeDispatchRequests( const 
std::vector " << aTargetURL8;
+std::cout << "convert " << aSource8;
+if (!bMultiFileTarget)
+std::cout << " -> " << aTargetURL8;
 std::cout << " using filter : " << 
OUStringToOString(aFilter, osl_getThreadTextEncoding()) << std::endl;
-if (FStatHelper::IsDocument(aOutFile))
+if (!bMultiFileTarget && 
FStatHelper::IsDocument(aOutFile))
 std::cout << "Overwriting: " << 
OUStringToOString(aTempName, osl_getThreadTextEncoding()) << std::endl ;
 }
 try
diff --git a/sc/source/ui/dbgui/imoptdlg.cxx b/sc/source/ui/dbgui/imoptdlg.cxx
index 071f1b0257bc..d8c4fd810ea3 100644
--- a/sc/source/ui/dbgui/imoptdlg.cxx
+++ b/sc/source/ui/dbgui/imoptdlg.cxx
@@ -43,6 +43,7 @@ ScImportOptions::ScImportOptions( const OUString& rStr )
 bSaveNumberAsSuch = true;
 bSaveFormulas = false;
 bRemoveSpace = false;
+bNewFilePerSheet = false;
 sal_Int32 nTokenCount = comphelper::string::getTokenCount(rStr, ',');
 if ( nTokenCount < 3 )
 return;
@@ -77,6 +78,8 @@ ScImportOptions::ScImportOptions( const OUString& rStr )
 bSaveFormulas = rStr.getToken(0, ',', nIdx) == "true";
 if ( nTokenCount >= 11 )
 bRemoveSpace = rStr.getToken(0, ',', nIdx) == "true";
+if ( nTokenCount >= 12 )
+bNewFilePerSheet = rStr.getToken(0, ',', nIdx) == "-1";
 }
 }
 
@@ -99,7 +102,9 @@ OUString ScImportOptions::BuildString() const
 "," +
 OUString::boolean( bSaveFormulas ) +  // "save formulas": not in 
ScAsciiOptions
 "," +
-OUString::boolean( bRemoveSpace );// same as "Remove space" in 
ScAsciiOptions
+OUString::boolean( bRemoveSpace ) +  // same as "Remove space" in 
ScAsciiOptions
+"," +
+std::u16string_view(bNewFilePerSheet ? u"-1" : u"0") ;  // Only 
available for command line --convert-to
 
 return aResult;
 }
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 055f2fdf727a..873e5c598bab 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -44,6 +44,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -120,6 +121,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1926,7 +1928,7 @@ void escapeTextSep(sal_Int32 nPos, const StrT& rStrDelim, 
StrT& rStr)
 
 }
 
-void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& 
rAsciiOpt )
+void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& 
rAsciiOpt, SCTAB nTab )
 {
 sal_Unicode cDelim= rAsciiOpt.nFieldSepCode;
 sal_Unicode cStrDelim = rAsciiOpt.nTextSepCode;
@@ -1972,7 +1974,6 @@ void ScDocShell::AsciiSave( SvStream& rStream, const 
ScImportOptions& rAsciiOpt
 
 SCCOL nStartCol = 0;
 SCROW nSta

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

2021-03-15 Thread Gökay Şatır (via logerrit)
 desktop/source/lib/init.cxx   |1 +
 sc/source/ui/view/gridwin.cxx |1 +
 2 files changed, 2 insertions(+)

New commits:
commit 10f8764ff9c3945e3e51c7d483dc7a07bdea29f9
Author: Gökay Şatır 
AuthorDate: Sun Mar 14 12:36:30 2021 +0300
Commit: Gökay ŞATIR 
CommitDate: Mon Mar 15 10:29:07 2021 +0100

Calc: Update selected cell range before calculating the selection area.

Change-Id: I7a814be03acb246e1eb9d68425418ee1357510fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112472
Tested-by: Jenkins
Reviewed-by: Dennis Francis 
Reviewed-by: Gökay ŞATIR 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5701f5965ce2..6275bf691946 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1442,6 +1442,7 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 case LOK_CALLBACK_CELL_VIEW_CURSOR:
 case LOK_CALLBACK_CELL_FORMULA:
 case LOK_CALLBACK_CELL_ADDRESS:
+case LOK_CALLBACK_CELL_SELECTION_AREA:
 case LOK_CALLBACK_CURSOR_VISIBLE:
 case LOK_CALLBACK_VIEW_CURSOR_VISIBLE:
 case LOK_CALLBACK_SET_PART:
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 790ab75713b0..1497988b7f16 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5863,6 +5863,7 @@ void ScGridWindow::UpdateKitSelection(const 
std::vector& rRect
 }
 
 ScTabViewShell* pViewShell = mrViewData.GetViewShell();
+pViewShell->UpdateInputHandler();
 OString sBoundingBoxString = "EMPTY";
 if (!aBoundingBox.IsEmpty())
 sBoundingBoxString = aBoundingBox.toString();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-15 Thread Noel Grandin (via logerrit)
 desktop/source/lib/init.cxx   |4 ++--
 sc/source/core/tool/chgtrack.cxx  |4 ++--
 sw/source/uibase/uno/unotxdoc.cxx |4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 042bb632978a1d01f3240890ea9d39ead707633d
Author: Noel Grandin 
AuthorDate: Wed Jan 6 12:59:29 2021 +0200
Commit: Michael Meeks 
CommitDate: Fri Jan 15 17:41:15 2021 +0100

fix location of change tracking boxes in Online

Change-Id: I65fcb52e224dce7df2a5a7baed2b8f23d0d49397
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108849
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6a88eb05701b..86cab63684f9 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4832,12 +4832,12 @@ static char* getTrackedChanges(LibreOfficeKitDocument* 
pThis)
 // construct the tracked changes JSON from inside the sw/, not here using 
UNO
 if (doc_getDocumentType(pThis) != LOK_DOCTYPE_TEXT && 
xRedlinesSupplier.is())
 {
-auto redlinesNode = aJson.startNode("redlines");
+auto redlinesNode = aJson.startArray("redlines");
 uno::Reference xRedlines = 
xRedlinesSupplier->getRedlines()->createEnumeration();
 for (size_t nIndex = 0; xRedlines->hasMoreElements(); ++nIndex)
 {
 uno::Reference 
xRedline(xRedlines->nextElement(), uno::UNO_QUERY);
-auto redlineNode = aJson.startNode("");
+auto redlineNode = aJson.startStruct();
 aJson.put("index", static_cast(nIndex));
 
 OUString sAuthor;
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index 86be82346c47..7abcc01864ac 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -4682,7 +4682,7 @@ static void lcl_getTrackedChange(ScDocument& rDoc, int 
nIndex, const ScChangeAct
 if (pAction->GetType() != SC_CAT_CONTENT)
 return;
 
-auto redlinesNode = rRedlines.startNode("");
+auto redlinesNode = rRedlines.startStruct();
 rRedlines.put("index", static_cast(nIndex));
 
 rRedlines.put("author", pAction->GetUser());
@@ -4701,7 +4701,7 @@ static void lcl_getTrackedChange(ScDocument& rDoc, int 
nIndex, const ScChangeAct
 
 void ScChangeTrack::GetChangeTrackInfo(tools::JsonWriter& aRedlines)
 {
-auto redlinesNode = aRedlines.startNode("redlines");
+auto redlinesNode = aRedlines.startArray("redlines");
 
 ScChangeAction* pAction = GetFirst();
 if (pAction)
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 9c457cf49c19..7fa248a90e65 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3269,7 +3269,7 @@ PointerStyle SwXTextDocument::getPointer()
 
 void SwXTextDocument::getTrackedChanges(tools::JsonWriter& rJson)
 {
-auto redlinesNode = rJson.startNode("redlines");
+auto redlinesNode = rJson.startArray("redlines");
 
 // Disable since usability is very low beyond some small number of changes.
 static bool bDisableRedlineComments = getenv("DISABLE_REDLINE") != nullptr;
@@ -3280,7 +3280,7 @@ void 
SwXTextDocument::getTrackedChanges(tools::JsonWriter& rJson)
 = m_pDocShell->GetDoc()->getIDocumentRedlineAccess().GetRedlineTable();
 for (SwRedlineTable::size_type i = 0; i < rRedlineTable.size(); ++i)
 {
-auto redlineNode = rJson.startNode("");
+auto redlineNode = rJson.startStruct();
 rJson.put("index", rRedlineTable[i]->GetId());
 rJson.put("author", rRedlineTable[i]->GetAuthorString(1));
 rJson.put("type", SwRedlineTypeToOUString(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-21 Thread Gabriel Masei (via logerrit)
 desktop/source/lib/init.cxx|   15 ++-
 sc/source/ui/view/tabvwsha.cxx |   19 ---
 2 files changed, 22 insertions(+), 12 deletions(-)

New commits:
commit 137440e161f0f8631e7e67ba0609680d6686fa94
Author: Gabriel Masei 
AuthorDate: Wed Sep 2 19:22:23 2020 +0300
Commit: Jan Holesovsky 
CommitDate: Mon Sep 21 14:39:17 2020 +0200

lok: remove .uno:ModifiedStatus message from deduplication mechanism

This fixes the following issue in Online:

When a save is performed while a cell is still edited the save icon
does not reflect the correct state of the document: it shows that
the document is dirty although it is not. This is generated by two facts:

1. The status cache is avoided when sending the -dirty- status right
after the cell editing is finished. Because the cache has an old value
of -false- for ModifiedStatus, the notification that is sent after saving,
with -false- value, is ignored. We should not avoid the status cache.

2. Because there is a mechanism that keeps only the last notification
value for a status change in the queue that keeps messages that were not
sent yet (deduplication), the .uno:ModifiedStatus message with a value of 
-true-
that is enqueued right after the cell edit is finished is replaced by the 
same
message with a value of -false- that is enqueued after the save is finished.
This happens if the flush mechanism doesn't occur between them.

Change-Id: I3348bf230ba53a154c29e7d8ab064df7694adeae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101948
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a5c2b7c4ea8b..ecef209842a8 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1571,11 +1571,16 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 if (pos != std::string::npos)
 {
 const std::string name = payload.substr(0, pos + 1);
-removeAll(
-[type, &name] (const queue_type::value_type& elem) {
-return (elem.Type == type) && 
(elem.PayloadString.compare(0, name.size(), name) == 0);
-}
-);
+// This is needed because otherwise it creates some 
problems when
+// a save occurs while a cell is still edited in Calc.
+if (name != ".uno:ModifiedStatus=")
+{
+removeAll(
+[type, &name] (const queue_type::value_type& elem) 
{
+return (elem.Type == type) && 
(elem.PayloadString.compare(0, name.size(), name) == 0);
+}
+);
+}
 }
 }
 break;
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 210500e651d9..211a047c9bb1 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -742,20 +742,25 @@ void ScTabViewShell::ExecuteSave( SfxRequest& rReq )
 // Finish entering unless 'DontTerminateEdit' is specified, even if a 
formula is being processed
 if (bCommitChanges)
 {
+SC_MOD()->InputEnterHandler();
+
 if (comphelper::LibreOfficeKit::isActive())
 {
 // Normally this isn't needed, but in Calc when editing a cell 
formula
 // and manually saving (without changing cells or hitting enter), 
while
 // InputEnterHandler will mark the doc as modified (when it is), 
because
 // we will save the doc immediately afterwards, the modified state 
event
-// is clobbered. To avoid that, we notify all views immediately of 
the
-// modified state, apply the modification, then save the document.
-ScInputHandler* pHdl = GetInputHandler();
-if (pHdl != nullptr && pHdl->GetModified())
-SfxLokHelper::notifyAllViews(LOK_CALLBACK_STATE_CHANGED, 
".uno:ModifiedStatus=true");
+// is clobbered. To avoid that, we need to update SID_DOC_MODIFIED 
so that
+// a possible state of "true" after "InputEnterHandler" will be 
sent
+// as a notification. It is important that the notification goes 
through
+// normal process (cache) rather than directly notifying the views.
+// Otherwise, because there is a previous state of "false" in 
cache, the
+// "false" state after saving will be ignored.
+// This will work only if .uno:ModifiedStatus message will be 
removed from
+// the mechanism that keeps in the message queue only last message 
of
+// a particular status even if the values are different.
+
GetViewData().GetDocShell()->Ge

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

2020-05-05 Thread Pranam Lashkari (via logerrit)
 desktop/source/lib/init.cxx   |5 ++---
 sc/source/ui/app/inputwin.cxx |2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 50724c796dbb52b73aa47a85d720d2e3200a0dec
Author: Pranam Lashkari 
AuthorDate: Wed Apr 29 00:20:12 2020 +0530
Commit: Marco Cecchetti 
CommitDate: Tue May 5 14:44:44 2020 +0200

tdf#131230: Sidebar: Can't set Automatic color

This also solved the issue in sidebar with some controls
when selecting an item it selects the item below

Change-Id: I607b8bc44402b57b5c4833f918fb41b23ddf48c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93099
Tested-by: Marco Cecchetti 
Reviewed-by: Marco Cecchetti 
(cherry picked from commit 756bbe3f94fe1736406b7fd16ce62a67e7e62769)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93380
Tested-by: Jenkins
Reviewed-by: Pranam Lashkari 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 26dda0f96908..ccd32a035ff5 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3829,9 +3829,8 @@ static void 
doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned
 return;
 }
 
-Size aOffset(pWindow->GetOutOffXPixel(), pWindow->GetOutOffYPixel());
-Point aPos(nX, nY);
-aPos.Move(aOffset);
+const Point aPos(nX, nY);
+
 MouseEvent aEvent(aPos, nCount, MouseEventModifiers::SIMPLECLICK, 
nButtons, nModifier);
 
 vcl::EnableDialogInput(pWindow);
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index c9b69f63ad5e..4c186610e0ad 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -524,7 +524,7 @@ void ScInputWindow::NotifyLOKClient()
 {
 std::vector aItems;
 aItems.emplace_back("type", "calc-input-win");
-aItems.emplace_back(std::make_pair("position", Point(0, 
0).toString()));
+aItems.emplace_back(std::make_pair("position", 
Point(GetOutOffXPixel(), GetOutOffYPixel()).toString()));
 aItems.emplace_back(std::make_pair("size", aSize.toString()));
 pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-06 Thread Marco Cecchetti (via logerrit)
 desktop/source/lib/init.cxx|4 +
 sc/source/ui/app/inputhdl.cxx  |8 ++-
 sc/source/ui/app/inputwin.cxx  |  103 +
 sc/source/ui/inc/inputwin.hxx  |4 +
 sc/source/ui/view/tabvwshc.cxx |   11 
 vcl/source/window/cursor.cxx   |4 -
 6 files changed, 120 insertions(+), 14 deletions(-)

New commits:
commit 366e328dc7f36061971c549c2d33d365026b65ca
Author: Marco Cecchetti 
AuthorDate: Mon Nov 4 17:10:45 2019 +0100
Commit: Marco Cecchetti 
CommitDate: Fri Mar 6 10:40:29 2020 +0100

lok: calc formula bar tunneling

Change-Id: I92026098222e04a163796225a048c6d7dc1b37c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89857
Tested-by: Jenkins
Reviewed-by: Marco Cecchetti 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 3e9332bca713..da2a29c3f7d4 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3827,7 +3827,9 @@ static void 
doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned
 return;
 }
 
-const Point aPos(nX, nY);
+Size aOffset(pWindow->GetOutOffXPixel(), pWindow->GetOutOffYPixel());
+Point aPos(nX, nY);
+aPos.Move(aOffset);
 MouseEvent aEvent(aPos, nCount, MouseEventModifiers::SIMPLECLICK, 
nButtons, nModifier);
 
 vcl::EnableDialogInput(pWindow);
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 46321002fbf1..076acd2f06de 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -775,6 +775,12 @@ ScInputHandler::ScInputHandler()
 pDelayTimer.reset( new Timer( "ScInputHandlerDelay timer" ) );
 pDelayTimer->SetTimeout( 500 ); // 500 ms delay
 pDelayTimer->SetInvokeHandler( LINK( this, ScInputHandler, DelayTimer ) );
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+ScInputHandler::bOptLoaded = true;// Evaluate App options
+ScInputHandler::bAutoComplete = true; // Is set in KeyInput
+}
 }
 
 ScInputHandler::~ScInputHandler()
@@ -3793,7 +3799,7 @@ void ScInputHandler::InputCommand( const CommandEvent& 
rCEvt )
 {
 if (pTableView)
 pTableView->Command( rCEvt );
-if (pTopView)
+if (pTopView && !comphelper::LibreOfficeKit::isActive())
 pTopView->Command( rCEvt );
 
 if ( rCEvt.GetCommand() == CommandEventId::EndExtTextInput )
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index cbbc8b2d0cf1..6a3fbb89f92d 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -168,6 +168,7 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, const 
SfxBindings* pBind ) :
 pRuntimeWindow  ( lcl_chooseRuntimeImpl( this, pBind ) ),
 aTextWindow ( *pRuntimeWindow ),
 pInputHdl   ( nullptr ),
+mpViewShell ( nullptr ),
 mnMaxY  (0),
 bIsOkCancelMode ( false ),
 bInResize   ( false )
@@ -184,10 +185,15 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, const 
SfxBindings* pBind ) :
 }
 OSL_ENSURE( pViewSh, "no view shell for input window" );
 
+mpViewShell = pViewSh;
+
 // Position window, 3 buttons, input window
-InsertWindow(1, aWndPos.get(), ToolBoxItemBits::NONE, 0);
-InsertSeparator (1);
-InsertItem  (SID_INPUT_FUNCTION, Image(StockImage::Yes, 
RID_BMP_INPUT_FUNCTION), ToolBoxItemBits::NONE, 2);
+if (!comphelper::LibreOfficeKit::isActive())
+{
+InsertWindow(1, aWndPos.get(), ToolBoxItemBits::NONE, 0);
+InsertSeparator (1);
+InsertItem  (SID_INPUT_FUNCTION, Image(StockImage::Yes, 
RID_BMP_INPUT_FUNCTION), ToolBoxItemBits::NONE, 2);
+}
 InsertItem  (SID_INPUT_SUM,  Image(StockImage::Yes, 
RID_BMP_INPUT_SUM), ToolBoxItemBits::DROPDOWNONLY, 3);
 InsertItem  (SID_INPUT_EQUAL,Image(StockImage::Yes, 
RID_BMP_INPUT_EQUAL), ToolBoxItemBits::NONE, 4);
 InsertItem  (SID_INPUT_CANCEL,   Image(StockImage::Yes, 
RID_BMP_INPUT_CANCEL), ToolBoxItemBits::NONE, 5);
@@ -199,14 +205,20 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, const 
SfxBindings* pBind ) :
 InsertWindow(7, &aTextWindow, ToolBoxItemBits::NONE, 8);
 SetDropdownClickHdl( LINK( this, ScInputWindow, DropdownClickHdl ));
 
-aWndPos   ->SetQuickHelpText(ScResId(SCSTR_QHELP_POSWND));
-aWndPos   ->SetHelpId   (HID_INSWIN_POS);
+if (!comphelper::LibreOfficeKit::isActive())
+{
+aWndPos   ->SetQuickHelpText(ScResId(SCSTR_QHELP_POSWND));
+aWndPos   ->SetHelpId   (HID_INSWIN_POS);
+}
 aTextWindow.SetQuickHelpText(ScResId(SCSTR_QHELP_INPUTWND));
 aTextWindow.SetHelpId   (HID_INSWIN_INPUT);
 
-// No SetHelpText: the helptexts come from the Help
-SetItemText (SID_INPUT_FUNCTION, ScResId(SCSTR_QHELP_BTNCALC));
-SetHelpId   (SID_INPUT_FUNC

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

2017-03-07 Thread Julien Nabet
 desktop/source/deployment/gui/license_dialog.cxx |9 +
 sc/source/ui/dbgui/pvfundlg.cxx  |9 +
 svx/source/tbxctrls/SvxPresetListBox.cxx |   10 +-
 sw/source/ui/dbui/mmaddressblockpage.cxx |   10 ++
 4 files changed, 5 insertions(+), 33 deletions(-)

New commits:
commit bb4cf1da125344d5ef4fe51b0f1549718a11affa
Author: Julien Nabet 
Date:   Tue Mar 7 22:39:40 2017 +0100

tdf#91222 VclBuilder constructor cleanup

Change-Id: I951bfda566e0aae3b0a82f30be28e66601797cc8
Reviewed-on: https://gerrit.libreoffice.org/34958
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/desktop/source/deployment/gui/license_dialog.cxx 
b/desktop/source/deployment/gui/license_dialog.cxx
index 52ddc8e..12542e6 100644
--- a/desktop/source/deployment/gui/license_dialog.cxx
+++ b/desktop/source/deployment/gui/license_dialog.cxx
@@ -120,14 +120,7 @@ LicenseView::LicenseView( vcl::Window* pParent, WinBits 
nStyle )
 StartListening( *GetTextEngine() );
 }
 
-VCL_BUILDER_DECL_FACTORY(LicenseView)
-{
-WinBits nWinStyle = WB_CLIPCHILDREN|WB_LEFT;
-OString sBorder = VclBuilder::extractCustomProperty(rMap);
-if (!sBorder.isEmpty())
-nWinStyle |= WB_BORDER;
-rRet = VclPtr::Create(pParent, nWinStyle | WB_VSCROLL);
-}
+VCL_BUILDER_FACTORY_CONSTRUCTOR(LicenseView, 
WB_CLIPCHILDREN|WB_LEFT|WB_VSCROLL)
 
 LicenseView::~LicenseView()
 {
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index 940ab46..4dcecad 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -157,14 +157,7 @@ ScDPFunctionListBox::ScDPFunctionListBox(vcl::Window* 
pParent, WinBits nStyle)
 FillFunctionNames();
 }
 
-VCL_BUILDER_DECL_FACTORY(ScDPFunctionListBox)
-{
-WinBits nWinStyle = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE;
-OString sBorder = VclBuilder::extractCustomProperty(rMap);
-if (!sBorder.isEmpty())
-nWinStyle |= WB_BORDER;
-rRet = VclPtr::Create(pParent, nWinStyle);
-}
+VCL_BUILDER_FACTORY_CONSTRUCTOR(ScDPFunctionListBox, 
WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE)
 
 void ScDPFunctionListBox::SetSelection( PivotFunc nFuncMask )
 {
diff --git a/svx/source/tbxctrls/SvxPresetListBox.cxx 
b/svx/source/tbxctrls/SvxPresetListBox.cxx
index c0b3ed1..89f96da 100644
--- a/svx/source/tbxctrls/SvxPresetListBox.cxx
+++ b/svx/source/tbxctrls/SvxPresetListBox.cxx
@@ -37,16 +37,8 @@ SvxPresetListBox::SvxPresetListBox(vcl::Window* pParent, 
WinBits nWinStyle)
 SetExtraSpacing(4);
 }
 
-VCL_BUILDER_DECL_FACTORY(SvxPresetListBox)
-{
-WinBits nWinBits = WB_TABSTOP;
 
-OString sBorder = VclBuilder::extractCustomProperty(rMap);
-if(!sBorder.isEmpty())
-nWinBits |= WB_BORDER;
-nWinBits |= (WB_ITEMBORDER| WB_3DLOOK|WB_OWNERDRAWDECORATION);
-rRet = VclPtr::Create(pParent, nWinBits);
-}
+VCL_BUILDER_FACTORY_CONSTRUCTOR(SvxPresetListBox, WB_ITEMBORDER| 
WB_3DLOOK|WB_OWNERDRAWDECORATION|WB_TABSTOP)
 
 void SvxPresetListBox::Resize()
 {
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx 
b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 335127b..af25e2d 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -1324,14 +1324,8 @@ Size AddressMultiLineEdit::GetOptimalSize() const
 return LogicToPixel(Size(160, 60), MapUnit::MapAppFont);
 }
 
-VCL_BUILDER_DECL_FACTORY(AddressMultiLineEdit)
-{
-WinBits nWinStyle = WB_LEFT|WB_TABSTOP;
-OString sBorder = VclBuilder::extractCustomProperty(rMap);
-if (!sBorder.isEmpty())
-nWinStyle |= WB_BORDER;
-rRet = VclPtr::Create(pParent, nWinStyle);
-}
+
+VCL_BUILDER_FACTORY_CONSTRUCTOR(AddressMultiLineEdit, WB_LEFT|WB_TABSTOP)
 
 void AddressMultiLineEdit::SetAddressDialog(SwCustomizeAddressBlockDialog 
*pParent)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-10-03 Thread Ashod Nakashian
 desktop/source/lib/init.cxx|3 ++-
 sc/source/ui/view/gridwin4.cxx |   20 ++--
 2 files changed, 12 insertions(+), 11 deletions(-)

New commits:
commit 051a9eb9ca205787e0763ef5118ef8e3c4b0aec9
Author: Ashod Nakashian 
Date:   Sat Oct 1 21:25:42 2016 -0400

Calc LOK: clear cell background when editing in parallel

Change-Id: Id8eccf00ec6555d62c49e06130e3aa3a0eaaddea
Reviewed-on: https://gerrit.libreoffice.org/29450
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 
(cherry picked from commit b16ba7314ef93b657dea4d6dd676b2dfd265bcaa)
Reviewed-on: https://gerrit.libreoffice.org/29486
Reviewed-by: Marco Cecchetti 
Tested-by: Marco Cecchetti 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2de46cf..1b49e1f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -267,7 +267,8 @@ static OUString getAbsoluteURL(const char* pURL)
 if (!aWorkingDir.endsWith("/"))
 aWorkingDir += "/";
 
-try {
+try
+{
 return rtl::Uri::convertRelToAbs(aWorkingDir, aURL);
 }
 catch (const rtl::MalformedUriException &)
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 86889e1..0aa4322 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -936,15 +936,16 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
 Rectangle aBackground(aStart, aEnd);
 if (bIsTiledRendering)
 {
-aBackground += Point(nScrX, nScrY);
+// Need to draw the background in absolute coords.
+auto aOrigin = aOriginalMode.GetOrigin();
+aOrigin.setX(aOrigin.getX() / TWIPS_PER_PIXEL + nScrX);
+aOrigin.setY(aOrigin.getY() / TWIPS_PER_PIXEL + nScrY);
+aBackground += aOrigin;
 rDevice.SetMapMode(aDrawMode);
 }
 else
 rDevice.SetMapMode(pViewData->GetLogicMode());
 
-// paint the background
-rDevice.DrawRect(rDevice.PixelToLogic(aBackground));
-
 if (bIsTiledRendering)
 {
 auto aOrigin = aOriginalMode.GetOrigin();
@@ -958,8 +959,12 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
 rDevice.SetMapMode(aNew);
 }
 
+// paint the background
+rDevice.DrawRect(rDevice.PixelToLogic(aBackground));
+
 // paint the editeng text
-pEditView->Paint(rDevice.PixelToLogic(Rectangle(Point(nScrX, nScrY), 
Size(aOutputData.GetScrW(), aOutputData.GetScrH(, &rDevice);
+Rectangle aEditRect(Point(nScrX, nScrY), Size(aOutputData.GetScrW(), 
aOutputData.GetScrH()));
+pEditView->Paint(rDevice.PixelToLogic(aEditRect), &rDevice);
 rDevice.SetMapMode(MAP_PIXEL);
 
 // restore the cursor it was originally visible
@@ -967,7 +972,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const 
ScTableInfo& rTableI
 pCrsr->Show();
 }
 
-
 if (comphelper::LibreOfficeKit::isActive())
 {
 ScTabViewShell* pThisViewShell = pViewData->GetViewShell();
@@ -1052,10 +1056,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
 
 }
 
-
-
-
-
 if (pViewData->HasEditView(eWhich))
 {
 // flush OverlayManager before changing the MapMode
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits