[Libreoffice-bugs] [Bug 131273] Crash when pasting quotes with fixed width

2020-03-12 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=131273

Samuel Mehrbrodt (CIB)  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|libreoffice-b...@lists.free |serval2...@yahoo.fr
   |desktop.org |

--- Comment #4 from Samuel Mehrbrodt (CIB)  ---
(In reply to Julien Nabet from comment #3)
> Don't know if it's a naive patch but I don't reproduce the crash with it:
> diff --git a/sc/source/ui/docshell/impex.cxx
> b/sc/source/ui/docshell/impex.cxx
> index f99a8ce5fff5..56aa2e7f2506 100644
> --- a/sc/source/ui/docshell/impex.cxx
> +++ b/sc/source/ui/docshell/impex.cxx
> @@ -1278,7 +1278,7 @@ static OUString lcl_GetFixed( const OUString& rLine,
> sal_Int32 nStart, sal_Int32
>  bool bFits = (nSpace - nStart - 3 <= SAL_MAX_UINT16);
>  OSL_ENSURE( bFits, "lcl_GetFixed: line doesn't fit into data");
>  if (bFits)
> -return rLine.copy(nStart+1, nSpace-nStart-2);
> +return rLine.copy(nStart+1, std::max(0, nSpace-nStart-2));
>  else
>  {
>  rbOverflowCell = true;

Just upload to gerrit. Thx!

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 131273] Crash when pasting quotes with fixed width

2020-03-11 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=131273

Julien Nabet  changed:

   What|Removed |Added

 CC||serval2...@yahoo.fr

--- Comment #3 from Julien Nabet  ---
Don't know if it's a naive patch but I don't reproduce the crash with it:
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index f99a8ce5fff5..56aa2e7f2506 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1278,7 +1278,7 @@ static OUString lcl_GetFixed( const OUString& rLine,
sal_Int32 nStart, sal_Int32
 bool bFits = (nSpace - nStart - 3 <= SAL_MAX_UINT16);
 OSL_ENSURE( bFits, "lcl_GetFixed: line doesn't fit into data");
 if (bFits)
-return rLine.copy(nStart+1, nSpace-nStart-2);
+return rLine.copy(nStart+1, std::max(0, nSpace-nStart-2));
 else
 {
 rbOverflowCell = true;

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 131273] Crash when pasting quotes with fixed width

2020-03-11 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=131273

--- Comment #2 from Samuel Mehrbrodt (CIB)  ---
Paste unformatted, then choose "Fixed width" in the dialog which appears.

Backtrace:

#3  0x77a78006 in __GI___assert_fail
(assertion=0x77f8d84b "false", file=0x77f8ca28
"/libreoffice/core/sal/rtl/strtmpl.cxx", line=1390, function=0x77f8d7f0
"void rtl_uString_newFromSubString(rtl_uString**, const rtl_uString*,
sal_Int32, sal_Int32)") at assert.c:101
#4  0x77f379e3 in rtl_uString_newFromSubString(rtl_uString**,
rtl_uString const*, sal_Int32, sal_Int32) (ppThis=0x7ffefdd0,
pFrom=0x5b5cbb30, beginIndex=1, count=-1)
at /libreoffice/core/sal/rtl/strtmpl.cxx:1390
#5  0x7fffdbd89cbc in rtl::OUString::copy(int, int) const
(this=0x7ffefec8, beginIndex=1, count=-1) at
/libreoffice/core/include/rtl/ustring.hxx:2256
#6  0x7fffdcadc844 in lcl_GetFixed(rtl::OUString const&, sal_Int32,
sal_Int32, bool&, bool&)
(rLine="\"", nStart=0, nNext=1, rbIsQuoted=@0x7ffefed8: true,
rbOverflowCell=@0x586e8843: false) at
/libreoffice/core/sc/source/ui/docshell/impex.cxx:1281
#7  0x7fffdcadd31d in ScImportExport::ExtText2Doc(SvStream&)
(this=0x586e87f0, rStrm=...)
at /libreoffice/core/sc/source/ui/docshell/impex.cxx:1418
#8  0x7fffdcad934f in ScImportExport::ImportStream(SvStream&, rtl::OUString
const&, SotClipboardFormatId) (this=0x586e87f0, rStrm=..., rBaseURL="",
nFmt=SotClipboardFormatId::STRING)
at /libreoffice/core/sc/source/ui/docshell/impex.cxx:383
#9  0x7fffdcad8beb in ScImportExport::ImportString(rtl::OUString const&,
SotClipboardFormatId)
(this=0x586e87f0, rText="\n1\n\"", nFmt=SotClipboardFormatId::STRING)
at /libreoffice/core/sc/source/ui/docshell/impex.cxx:309
#10 0x7fffdd07b0a5 in
ScViewFuncoperator()(sal_Int32) const
(__closure=0x5b48b160, nResult=1) at
/libreoffice/core/sc/source/ui/view/viewfun5.cxx:361
#11 0x7fffdd07f3a4 in std::_Function_handler&,
SCCOL, SCROW, const Point*, bool, bool):: >::_M_invoke(const
std::_Any_data &, int &&)

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 131273] Crash when pasting quotes with fixed width

2020-03-11 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=131273

Samuel Mehrbrodt (CIB)  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
 CC||s.mehrbr...@gmail.com

--- Comment #1 from Samuel Mehrbrodt (CIB)  ---
Reproduced in current master. This is what you need to copy:

1
"

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs