From d04a2fc89b15e87581b1b7f1d6abe04a13cae368 Mon Sep 17 00:00:00 2001 From: h3xds1nz Date: Sun, 25 May 2025 13:48:24 +0200 Subject: [PATCH] Remove non-CLS exceptions catch statements that are never executed --- .../MS/Internal/PtsHost/PtsHost.cs | 649 +++--------------- 1 file changed, 84 insertions(+), 565 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/PtsHost/PtsHost.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/PtsHost/PtsHost.cs index aa8e1f3f505..040700b56ab 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/PtsHost/PtsHost.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/PtsHost/PtsHost.cs @@ -158,13 +158,6 @@ internal int GetFigureProperties( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - dur = dvr = cPolygons = cVertices = 0; fsfigprops = new PTS.FSFIGUREPROPS(); - durDistTextLeft = durDistTextRight = dvrDistTextTop = dvrDistTextBottom = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } return fserr; } @@ -197,12 +190,6 @@ internal unsafe int GetFigurePolygons( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - ccVertices = cfspt = fWrapThrough = 0; rgfspt = null; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } return fserr; } @@ -240,12 +227,6 @@ internal int CalcFigurePosition( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fPushToNextTrack = 0; fsrcFlow = fsrcOverlap = fsrcSearch = new PTS.FSRECT(); fsbbox = new PTS.FSBBOX(); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } return fserr; } @@ -270,12 +251,7 @@ internal int FSkipPage( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fSkip = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int GetPageDimensions( @@ -301,12 +277,7 @@ internal int GetPageDimensions( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fswdir = 0; fHeaderFooterAtTopBottom = durPage = dvrPage = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int GetNextSection( @@ -328,12 +299,7 @@ internal int GetNextSection( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fSuccess = 0; nmsNext = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int GetSectionProperties( @@ -361,13 +327,7 @@ internal int GetSectionProperties( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fNewPage = fApplyColumnBalancing = ccol = 0; fswdir = 0; - cSegmentDefinedColumnSpanAreas = cHeightDefinedColumnSpanAreas = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } @@ -396,13 +356,7 @@ internal unsafe int GetJustificationProperties( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fJustify = fCancelAtLastColumn = 0; - fskal = default(PTS.FSKALIGNPAGE); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int GetMainTextSegment( @@ -423,12 +377,7 @@ internal int GetMainTextSegment( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - nmSegment = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } @@ -458,12 +407,7 @@ internal int GetHeaderSegment( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fHeaderPresent = fHardMargin = dvrMaxHeight = dvrFromEdge = 0; fswdirHeader = 0; nmsHeader = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } @@ -493,12 +437,7 @@ internal int GetFooterSegment( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fFooterPresent = fHardMargin = dvrMaxHeight = dvrFromEdge = 0; fswdirFooter = 0; nmsFooter = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int UpdGetSegmentChange( @@ -519,12 +458,7 @@ internal int UpdGetSegmentChange( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fskch = default(PTS.FSKCHANGE); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } @@ -549,12 +483,7 @@ internal unsafe int GetSectionColumnInfo( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - ccol = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } @@ -602,12 +531,7 @@ internal int GetFirstPara( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fSuccessful = 0; nmp = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int GetNextPara( @@ -632,12 +556,7 @@ internal int GetNextPara( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fFound = 0; nmpNext = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int UpdGetFirstChangeInSegment( @@ -660,12 +579,7 @@ internal int UpdGetFirstChangeInSegment( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fFound = fChangeFirst = 0; nmpBeforeChange = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int UpdGetParaChange( @@ -688,13 +602,7 @@ internal int UpdGetParaChange( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fskch = default(PTS.FSKCHANGE); - fNoFurtherChanges = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int GetParaProperties( @@ -714,11 +622,6 @@ internal int GetParaProperties( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } return fserr; } internal int CreateParaclient( @@ -739,12 +642,7 @@ internal int CreateParaclient( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - pfsparaclient = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int TransferDisplayInfo( @@ -766,11 +664,7 @@ internal int TransferDisplayInfo( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int DestroyParaclient( @@ -789,11 +683,7 @@ internal int DestroyParaclient( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int FInterruptFormattingAfterPara( @@ -826,12 +716,7 @@ internal int GetEndnoteSeparators( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - nmsEndnoteSeparator = nmsEndnoteContSeparator = nmsEndnoteContNotice = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int GetEndnoteSegment( @@ -853,12 +738,7 @@ internal int GetEndnoteSegment( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fEndnotesPresent = 0; nmsEndnotes = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int GetNumberEndnoteColumns( @@ -976,12 +856,7 @@ internal int DuplicateMcsclient( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - pmcsclientNew = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int DestroyMcsclient( @@ -1000,11 +875,7 @@ internal int DestroyMcsclient( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int FEqualMcsclient( @@ -1034,13 +905,8 @@ internal int FEqualMcsclient( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fEqual = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } } + return fserr; } internal int ConvertMcsclient( @@ -1073,12 +939,7 @@ internal int ConvertMcsclient( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - dvr = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int GetObjectHandlerInfo( @@ -1107,11 +968,7 @@ internal int GetObjectHandlerInfo( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } // ------------------------------------------------------------------ @@ -1163,14 +1020,7 @@ internal int CreateParaBreakingSession( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - ppfsparabreakingsession = IntPtr.Zero; - fParagraphJustified = PTS.False; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } return fserr; } internal int DestroyParaBreakingSession( @@ -1204,11 +1054,7 @@ internal int GetTextProperties( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int GetNumberFootnotes( @@ -1231,12 +1077,7 @@ internal int GetNumberFootnotes( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - nFootnote = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal unsafe int GetFootnotes( @@ -1330,12 +1171,7 @@ internal int FormatBottomText(IntPtr pfsclient, // IN: client PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - pmcsclientOut = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int FormatLine( @@ -1389,13 +1225,7 @@ internal int FormatLine( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - pfsline = ppbrlineOut = IntPtr.Zero; dcpLine = fForcedBroken = dvrAscent = dvrDescent = urBBox = durBBox = dcpDepend = fReformatNeighborsAsLastLine = 0; - fsflres = default(PTS.FSFLRES); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int FormatLineForced( @@ -1448,13 +1278,7 @@ internal int FormatLineForced( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - pfsline = ppbrlineOut = IntPtr.Zero; dcpLine = dvrAscent = dvrDescent = urBBox = durBBox = dcpDepend = 0; - fsflres = default(PTS.FSFLRES); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal unsafe int FormatLineVariants( @@ -1568,13 +1392,7 @@ out iLineVariantBest PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - nLineVariantsActual = 0; - iLineVariantBest = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int ReconstructLineVariant( @@ -1628,13 +1446,7 @@ internal int ReconstructLineVariant( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - pfsline = ppbrlineOut = IntPtr.Zero; dcpLine = fForcedBroken = dvrAscent = dvrDescent = urBBox = durBBox = dcpDepend = fReformatNeighborsAsLastLine = 0; - fsflres = default(PTS.FSFLRES); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int DestroyLine( @@ -1664,12 +1476,7 @@ internal int DuplicateLineBreakRecord( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - pbrlineDup = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int DestroyLineBreakRecord( @@ -1688,11 +1495,7 @@ internal int DestroyLineBreakRecord( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int SnapGridVertical( @@ -1733,12 +1536,7 @@ internal int GetDvrSuppressibleBottomSpace(IntPtr pfsclient, / PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - dvrSuppressible = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int GetDvrAdvance( @@ -1762,12 +1560,7 @@ internal int GetDvrAdvance( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - dvr = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int UpdGetChangeInText( @@ -1790,12 +1583,7 @@ internal int UpdGetChangeInText( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - dcpStart = ddcpOld = ddcpNew = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int UpdGetDropCapChange( @@ -1828,12 +1616,7 @@ internal int FInterruptFormattingText( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fInterruptFormatting = PTS.False; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int GetTextParaCache( @@ -1932,12 +1715,7 @@ internal int GetNumberAttachedObjectsBeforeTextLine( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - cAttachedObjects = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } @@ -1989,13 +1767,7 @@ internal unsafe int GetAttachedObjectsBeforeTextLine( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - cObjects = 0; - fEndOfParagraph = PTS.False; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } @@ -2044,12 +1816,7 @@ internal int GetNumberAttachedObjectsInTextLine( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - cAttachedObjects = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } @@ -2102,12 +1869,7 @@ internal unsafe int GetAttachedObjectsInTextLine( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - cObjects = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int UpdGetAttachedObjectChange( @@ -2130,12 +1892,7 @@ internal int UpdGetAttachedObjectChange( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fskchObject = default(PTS.FSKCHANGE); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int GetDurFigureAnchor( @@ -2172,12 +1929,7 @@ internal int GetDurFigureAnchor( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - dur = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } // ------------------------------------------------------------------ @@ -2202,12 +1954,7 @@ internal int GetFloaterProperties( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fsfloaterprops = new PTS.FSFLOATERPROPS(); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } @@ -2253,12 +2000,7 @@ internal int FormatFloaterContentFinite( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fsfmtr = new PTS.FSFMTR(); pfsFloatContent = pbrkrecpara = IntPtr.Zero; durFloaterWidth = dvrFloaterHeight = cPolygons = cVertices = 0; fsbbox = new PTS.FSBBOX(); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int FormatFloaterContentBottomless( @@ -2296,13 +2038,7 @@ internal int FormatFloaterContentBottomless( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fsfmtrbl = default(PTS.FSFMTRBL); - pfsFloatContent = IntPtr.Zero; durFloaterWidth = dvrFloaterHeight = cPolygons = cVertices = 0; fsbbox = new PTS.FSBBOX(); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int UpdateBottomlessFloaterContent( @@ -2339,13 +2075,7 @@ internal int UpdateBottomlessFloaterContent( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fsfmtrbl = default(PTS.FSFMTRBL); - durFloaterWidth = dvrFloaterHeight = cPolygons = cVertices = 0; fsbbox = new PTS.FSBBOX(); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } @@ -2378,12 +2108,7 @@ internal unsafe int GetFloaterPolygons( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - ccVertices = cfspt = fWrapThrough = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } @@ -2593,12 +2318,7 @@ internal int GetMCSClientAfterFloater( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - pmcsclientOut = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int GetDvrUsedForFloater( @@ -2629,12 +2349,7 @@ internal int GetDvrUsedForFloater( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - dvrUsed = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } // ------------------------------------------------------------------ @@ -2713,13 +2428,7 @@ internal int SubtrackFormatParaFinite( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fsfmtr = new PTS.FSFMTR(); pfspara = pbrkrecpara = pmcsclientOut = IntPtr.Zero; dvrUsed = dvrTopSpace = 0; fsbbox = new PTS.FSBBOX(); - fskclearOut = default(PTS.FSKCLEAR); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } @@ -2770,14 +2479,7 @@ internal int SubtrackFormatParaBottomless( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fsfmtrbl = default(PTS.FSFMTRBL); - pfspara = pmcsclientOut = IntPtr.Zero; dvrUsed = dvrTopSpace = fPageBecomesUninterruptable = 0; fsbbox = new PTS.FSBBOX(); - fskclearOut = default(PTS.FSKCLEAR); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } @@ -2828,14 +2530,7 @@ internal int SubtrackUpdateBottomlessPara( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fsfmtrbl = default(PTS.FSFMTRBL); - pfspara = pmcsclientOut = IntPtr.Zero; dvrUsed = dvrTopSpace = fPageBecomesUninterruptable = 0; fsbbox = new PTS.FSBBOX(); - fskclearOut = default(PTS.FSKCLEAR); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } @@ -2858,11 +2553,7 @@ internal int SubtrackSynchronizeBottomlessPara( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } @@ -3028,13 +2719,7 @@ internal int SubpageFormatParaFinite( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fsfmtr = new PTS.FSFMTR(); pfspara = pbrkrecpara = pmcsclientOut = IntPtr.Zero; dvrUsed = dvrTopSpace = 0; fsbbox = new PTS.FSBBOX(); - fskclearOut = default(PTS.FSKCLEAR); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int SubpageFormatParaBottomless( @@ -3085,14 +2770,7 @@ internal int SubpageFormatParaBottomless( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fsfmtrbl = default(PTS.FSFMTRBL); - pfspara = pmcsclientOut = IntPtr.Zero; dvrUsed = dvrTopSpace = fPageBecomesUninterruptable = 0; fsbbox = new PTS.FSBBOX(); - fskclearOut = default(PTS.FSKCLEAR); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } @@ -3143,14 +2821,7 @@ internal int SubpageUpdateBottomlessPara( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fsfmtrbl = default(PTS.FSFMTRBL); - pfspara = pmcsclientOut = IntPtr.Zero; dvrUsed = dvrTopSpace = fPageBecomesUninterruptable = 0; fsbbox = new PTS.FSBBOX(); - fskclearOut = default(PTS.FSKCLEAR); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; } internal int SubpageSynchronizeBottomlessPara( @@ -3274,12 +2945,7 @@ internal int GetTableProperties( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fstableobjprops = new PTS.FSTABLEOBJPROPS(); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int AutofitTable( @@ -3304,12 +2970,7 @@ internal int AutofitTable( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - durTableWidth = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int UpdAutofitTable( // calculate widths of table @@ -3338,13 +2999,7 @@ internal int UpdAutofitTable( // calculate widths of table PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - durTableWidth = 0; - fNoChangeInCellWidths = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int GetMCSClientAfterTable( @@ -3369,12 +3024,7 @@ internal int GetMCSClientAfterTable( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - ppmcsclientOut = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int GetFirstHeaderRow( @@ -3399,13 +3049,7 @@ internal int GetFirstHeaderRow( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fFound = 0; - pnmFirstHeaderRow = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int GetNextHeaderRow( @@ -3431,13 +3075,7 @@ internal int GetNextHeaderRow( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fFound = 0; - pnmNextHeaderRow = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int GetFirstFooterRow( @@ -3462,13 +3100,7 @@ internal int GetFirstFooterRow( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fFound = 0; - pnmFirstFooterRow = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int GetNextFooterRow( @@ -3494,13 +3126,7 @@ internal int GetNextFooterRow( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fFound = 0; - pnmNextFooterRow = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int GetFirstRow( @@ -3524,13 +3150,7 @@ internal int GetFirstRow( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fFound = 0; - pnmFirstRow = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int GetNextRow( @@ -3555,13 +3175,7 @@ internal int GetNextRow( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fFound = 0; - pnmNextRow = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int UpdFChangeInHeaderFooter( // we don't do update in header/footer @@ -3593,15 +3207,7 @@ internal int GetNextRow( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fHeaderChanged = 0; - fFooterChanged = 0; - fRepeatedHeaderChanged = 0; - fRepeatedFooterChanged = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int UpdGetFirstChangeInTable( @@ -3630,14 +3236,7 @@ internal int UpdGetFirstChangeInTable( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fFound = 0; - fChangeFirst = 0; - pnmRowBeforeChange = IntPtr.Zero; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int UpdGetRowChange( @@ -3665,13 +3264,7 @@ internal int UpdGetRowChange( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fskch = default(PTS.FSKCHANGE); - fNoFurtherChanges = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int UpdGetCellChange( @@ -3696,13 +3289,7 @@ internal int UpdGetCellChange( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fWidthChanged = 0; - fskchCell = default(PTS.FSKCHANGE); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int GetDistributionKind( @@ -3725,12 +3312,7 @@ internal int GetDistributionKind( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - tabledistr = PTS.FSKTABLEHEIGHTDISTRIBUTION.fskdistributeUnchanged; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int GetRowProperties( @@ -3753,12 +3335,7 @@ internal int GetRowProperties( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - rowprops = new PTS.FSTABLEROWPROPS(); - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } @@ -3782,11 +3359,7 @@ internal unsafe int GetCells( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int FInterruptFormattingTable( @@ -3810,12 +3383,7 @@ internal int FInterruptFormattingTable( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fInterrupt = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } @@ -3848,13 +3416,7 @@ internal unsafe int CalcHorizontalBBoxOfRow( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - urBBox = 0; - durBBox = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } // unless cell has vertical text or is special in some other ways, @@ -3896,15 +3458,7 @@ internal int FormatCellFinite( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - pfmtr = new PTS.FSFMTR(); - ppfscell = IntPtr.Zero; - pfsbrkcellOut = IntPtr.Zero; - dvrUsed = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int FormatCellBottomless( @@ -3940,14 +3494,7 @@ internal int FormatCellBottomless( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fmtrbl = default(PTS.FSFMTRBL); - ppfscell = IntPtr.Zero; - dvrUsed = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } // unless cell has vertical text or is special in some other ways, @@ -3986,13 +3533,7 @@ internal int UpdateBottomlessCell( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - fmtrbl = default(PTS.FSFMTRBL); - dvrUsed = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } @@ -4046,11 +3587,7 @@ internal int SetCellHeight( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } @@ -4082,11 +3619,7 @@ internal int DestroyCell( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int GetCellNumberFootnotes( @@ -4108,12 +3641,7 @@ internal int GetCellNumberFootnotes( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - cFtn = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } internal int GetCellMinColumnBalancingStep( @@ -4135,12 +3663,7 @@ internal int GetCellMinColumnBalancingStep( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - dvrMinStep = 0; - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return (fserr); } @@ -4162,11 +3685,7 @@ internal int TransferDisplayInfoCell( PtsContext.CallbackException = e; fserr = PTS.fserrCallbackException; } - catch - { - PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); - fserr = PTS.fserrCallbackException; - } + return fserr; }