bin/symbolstore.py              |   48 ++++++++++++++++++++--------------------
 sw/source/core/edit/autofmt.cxx |   16 +++++++++----
 2 files changed, 35 insertions(+), 29 deletions(-)

New commits:
commit 62df2dc0192653d5b62fa8ad84f9f9b53514cf5f
Author:     Xisco Fauli <[email protected]>
AuthorDate: Wed Nov 29 16:47:26 2023 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Mon Dec 11 20:40:45 2023 +0100

    symbolstore: update to python3
    
    Otherwise, it fails on new AlmaLinux 8 baseline
    
    rm -fr /home/buildslave/build/workdir/symbols/
    mkdir -p /home/buildslave/build/workdir/symbols/
    /home/buildslave/source/libo-core/bin/symbolstore.py 
/home/buildslave/build/workdir/UnpackedTarball/breakpad/src/tools/linux/dump_syms/dump_syms
 /home/buildslave/build/workdir/symbols/ 
/home/buildslave/build/instdir/program/*
    /usr/bin/env: 'python': No such file or directory
    make: *** [Makefile:478: symbols] Error 127
    
    Change-Id: I27a57a24a2f4bc7067041b2d4045ae0844e22d55
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160113
    Tested-by: Jenkins
    Reviewed-by: Christian Lohmaier <[email protected]>
    (cherry picked from commit 2225531bf5e7254a3aa607cd89eef7be59aadfd9)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160574
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/bin/symbolstore.py b/bin/symbolstore.py
index 2101e396153b..3e7b6f7799f7 100755
--- a/bin/symbolstore.py
+++ b/bin/symbolstore.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # ***** BEGIN LICENSE BLOCK *****
 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
 #
@@ -150,7 +150,7 @@ class CVSFileInfo(VCSFileInfo):
         f.close()
         if root_name:
             return root_name
-        print >> sys.stderr, "Failed to get CVS Root for %s" % filename
+        print("Failed to get CVS Root for %s" % filename, file=sys.stderr)
         return None
 
     def GetCleanRoot(self):
@@ -158,7 +158,7 @@ class CVSFileInfo(VCSFileInfo):
         if len(parts) > 1:
             # we don't want the extra colon
             return parts[1].replace(":","")
-        print >> sys.stderr, "Failed to get CVS Root for %s" % filename
+        print("Failed to get CVS Root for %s" % filename, file=sys.stderr)
         return None
 
     def GetRevision(self):
@@ -171,7 +171,7 @@ class CVSFileInfo(VCSFileInfo):
             parts = line.split("/")
             if len(parts) > 1 and parts[1] == filename:
                 return parts[2]
-        print >> sys.stderr, "Failed to get CVS Revision for %s" % filename
+        print("Failed to get CVS Revision for %s" % filename, file=sys.stderr)
         return None
 
     def GetFilename(self):
@@ -227,7 +227,7 @@ class SVNFileInfo(VCSFileInfo):
 
             exitStatus = command.close()
             if exitStatus:
-              print >> sys.stderr, "Failed to get SVN info for %s" % file
+              print("Failed to get SVN info for %s" % file, file=sys.stderr)
 
     def GetRoot(self):
         key = "Repository Root"
@@ -235,7 +235,7 @@ class SVNFileInfo(VCSFileInfo):
             match = self.rootRegex.match(self.svndata[key])
             if match:
                 return match.group(1)
-        print >> sys.stderr, "Failed to get SVN Root for %s" % self.file
+        print("Failed to get SVN Root for %s" % self.file, file=sys.stderr)
         return None
 
     # File bug to get this teased out from the current GetRoot, this is 
temporary
@@ -246,7 +246,7 @@ class SVNFileInfo(VCSFileInfo):
         key = "Revision"
         if key in self.svndata:
             return self.svndata[key]
-        print >> sys.stderr, "Failed to get SVN Revision for %s" % self.file
+        print("Failed to get SVN Revision for %s" % self.file, file=sys.stderr)
         return None
 
     def GetFilename(self):
@@ -255,7 +255,7 @@ class SVNFileInfo(VCSFileInfo):
                 url, repo = self.svndata["URL"], self.svndata["Repository 
Root"]
                 file = url[len(repo) + 1:]
             return "svn:%s:%s:%s" % (self.root, file, self.revision)
-        print >> sys.stderr, "Failed to get SVN Filename for %s" % self.file
+        print("Failed to get SVN Filename for %s" % self.file, file=sys.stderr)
         return self.file
 
 # Utility functions
@@ -304,7 +304,7 @@ def GetPlatformSpecificDumper(**kwargs):
     that is appropriate for the current platform."""
     return {'win32': Dumper_Win32,
             'cygwin': Dumper_Win32,
-            'linux2': Dumper_Linux,
+            'linux': Dumper_Linux,
             'sunos5': Dumper_Solaris,
             'darwin': Dumper_Mac}[sys.platform](**kwargs)
 
@@ -412,7 +412,7 @@ class Dumper:
         for arch in self.archs:
             try:
                 cmd = os.popen("%s %s %s" % (self.dump_syms, arch, file), "r")
-                module_line = cmd.next()
+                module_line = cmd.read()
                 if module_line.startswith("MODULE"):
                     # MODULE os cpu guid debug_file
                     (guid, debug_file) = (module_line.split())[3:5]
@@ -448,7 +448,7 @@ class Dumper:
                                 if cvs_root is None:
                                   if rootname:
                                      cvs_root = rootname
-                            # gather up files with cvs for indexing   
+                            # gather up files with cvs for indexing
                             if filename.startswith("cvs"):
                                 (ver, checkout, source_file, revision) = 
filename.split(":", 3)
                                 sourceFileStream += sourcepath + "*MYSERVER*" 
+ source_file + '*' + revision + "\r\n"
@@ -460,12 +460,12 @@ class Dumper:
                     command_exit = cmd.close()
                     if command_exit:
                         if command_exit == 11:
-                            print >> sys.stderr, "INFO: dump_syms segfault 
while processing {}, retrying".format(file)
+                            print("INFO: dump_syms segfault while processing 
{}, retrying".format(file), file=sys.stderr)
                             return self.ProcessFile(file)
                         raise Exception("ERROR - dump_syms error while 
processing {} (exit code {})".format(file, command_exit))
                     # we output relative paths so callers can get a list of 
what
                     # was generated
-                    print rel_path
+                    print(rel_path)
                     if self.copy_debug:
                         self.CopyDebug(file, debug_file, guid)
                     if self.srcsrv:
@@ -473,10 +473,10 @@ class Dumper:
                         result = self.SourceServerIndexing(debug_file, guid, 
sourceFileStream, cvs_root)
                     result = True
             except StopIteration:
-                print >> sys.stderr, "WARN: dump_syms - no debug info 
extracted for {}".format(file)
+                print("WARN: dump_syms - no debug info extracted for 
{}".format(file), file=sys.stderr)
                 pass
             except:
-                print >> sys.stderr, "Unexpected error: ", sys.exc_info()[0]
+                print("Unexpected error: ", sys.exc_info()[0], file=sys.stderr)
                 raise
         return result
 
@@ -509,7 +509,7 @@ class Dumper_Win32(Dumper):
            # ignore python distutils stubs and scripts
            return False
         elif ext == "":
-           print >> sys.stderr, "INFO: Skipping {}, has no 
extension".format(file)
+           print("INFO: Skipping {}, has no extension".format(file), 
file=sys.stderr)
            return False
         return True
 
@@ -540,12 +540,12 @@ class Dumper_Win32(Dumper):
         rel_path = os.path.join(debug_file,
                                 guid,
                                 debug_file).replace("\\", "/")
-        print rel_path
+        print(rel_path)
         full_path = os.path.normpath(os.path.join(self.symbol_path,
                                                   rel_path))
         shutil.copyfile(file, full_path)
         pass
-        
+
     def SourceServerIndexing(self, debug_file, guid, sourceFileStream, 
cvs_root):
         # Creates a .pdb.stream file in the mozilla\objdir to be used for 
source indexing
         cwd = os.getcwd()
@@ -553,7 +553,7 @@ class Dumper_Win32(Dumper):
         stream_output_path = os.path.join(cwd, streamFilename)
         # Call SourceIndex to create the .stream file
         result = SourceIndex(sourceFileStream, stream_output_path, cvs_root)
-        
+
         if self.copy_debug:
             pdbstr_path = os.environ.get("PDBSTR_PATH")
             pdbstr = os.path.normpath(pdbstr_path)
@@ -583,7 +583,7 @@ class Dumper_Linux(Dumper):
         file_dbg = file + ".dbg"
         os.system("objcopy --only-keep-debug %s %s" % (file, file_dbg))
         os.system("objcopy --add-gnu-debuglink=%s %s" % (file_dbg, file))
-        
+
         rel_path = os.path.join(debug_file,
                                 guid,
                                 debug_file + ".dbg")
@@ -592,7 +592,7 @@ class Dumper_Linux(Dumper):
         shutil.copyfile(file_dbg, full_path)
         # gzip the shipped debug files
         os.system("gzip %s" % full_path)
-        print rel_path + ".gz"
+        print(rel_path + ".gz")
 
 class Dumper_Solaris(Dumper):
     def RunFileCommand(self, file):
@@ -641,14 +641,14 @@ def main():
                       action="store_true", dest="srcsrv", default=False,
                       help="Add source index information to debug files, 
making them suitable for use in a source server.")
     (options, args) = parser.parse_args()
-    
+
     #check to see if the pdbstr.exe exists
     if options.srcsrv:
         pdbstr = os.environ.get("PDBSTR_PATH")
         if not os.path.exists(pdbstr):
-            print >> sys.stderr, "Invalid path to pdbstr.exe - please 
set/check PDBSTR_PATH.\n"
+            print("Invalid path to pdbstr.exe - please set/check 
PDBSTR_PATH.\n", file=sys.stderr)
             sys.exit(1)
-            
+
     if len(args) < 3:
         parser.error("not enough arguments")
         exit(1)
commit 127ec9a20d837775bf46714dba9eccda62b12dde
Author:     Matt K <[email protected]>
AuthorDate: Sun Dec 10 12:32:51 2023 -0600
Commit:     Xisco Fauli <[email protected]>
CommitDate: Mon Dec 11 20:40:32 2023 +0100

    tdf#117651 Fix AutoCorrect crash for italic, strike, bold, and underline
    
    This change fixes correction of indices when autocorrecting for one
    of the categories of bold, italic, strike, or underline.  Previously,
    the code would hit a debug assert when selecting "Apply" because of
    incorrect indices into the string being autocorrected.
    
    Change-Id: I5484c589ff43cd2fc78332cdc0d63e74cdc8e256
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160547
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160487

diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index fda00e5dfa4c..b569ca389ed8 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -2092,8 +2092,12 @@ void SwAutoFormat::AutoCorrect(TextFrameIndex nPos)
                                 aFInfo.SetFrame( nullptr );
                             }
                             //#125102# in case of the mode 
RedlineFlags::ShowDelete the ** are still contained in pText
-                            
if(!(m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags() & 
RedlineFlags::ShowDelete))
-                                nPos = 
m_pCurTextFrame->MapModelToViewPos(*m_aDelPam.GetPoint()) - TextFrameIndex(1);
+                            if 
(m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags() & 
RedlineFlags::ShowDelete)
+                            {
+                                nPos = 
m_pCurTextFrame->MapModelToViewPos(*m_aDelPam.GetPoint())
+                                       - TextFrameIndex(1);
+                                bBreak++;
+                            }
                             // Was a character deleted before starting?
                             if (cBlank && cBlank != 
(*pText)[sal_Int32(nSttPos) - 1])
                                 --nSttPos;
@@ -2141,11 +2145,13 @@ void SwAutoFormat::AutoCorrect(TextFrameIndex nPos)
                                 m_aDelPam.DeleteMark();
                                 aFInfo.SetFrame(nullptr);
                             }
-                            //#125102# in case of the mode 
RedlineFlags::ShowDelete the ** are still contained in pText
-                            if 
(!(m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags()
-                                  & RedlineFlags::ShowDelete))
+                            //#125102# in case of the mode 
RedlineFlags::ShowDelete the // or -- are still contained in pText
+                            if 
(m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags() & 
RedlineFlags::ShowDelete)
+                            {
                                 nPos = 
m_pCurTextFrame->MapModelToViewPos(*m_aDelPam.GetPoint())
                                        - TextFrameIndex(1);
+                                bBreak++;
+                            }
                             // Was a character deleted before starting?
                             if (cBlank && cBlank != 
(*pText)[sal_Int32(nSttPos) - 1])
                                 --nSttPos;

Reply via email to