Skip to content

fix: no warning docformatlib - #505

Open
Aiiaiiio wants to merge 7 commits into
mainfrom
fix/no-warning-docformatlib
Open

Aiiaiiio wants to merge 7 commits into
mainfrom
fix/no-warning-docformatlib

Conversation

@Aiiaiiio

@Aiiaiiio Aiiaiiio commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

DocFormatLib now builds with 0 warnings. Mostly mechanical; worth a look:

Behaviour changes

  • WordDocument::GetFileCharacterPositions: the "last FKP" check used the wrong counter, so it missed the real last page when earlier pages were skipped.
  • SlicerCacheExt.h: inline constructors and destructors deleted a forward-declared COfficeArtExtensionList (undefined behaviour, leak). It now includes DrawingExt.h.

Non-mechanical

  • PPTX_LOGIC_BASE* copy constructors delegate to the default constructor; explicit = default operator= added.
  • using Base::name; added for hidden virtual overloads.
  • boost → std (shared_ptr, optional) in a few DocFile spots to get rid of GCC false positives.

Known bug, not fixed (TODO in the code): the EncryptionHeader flag bits are read one position off (same in XLS RC4EncryptionHeader). It needs encrypted test files. #506

🤖 Generated with Claude Code

@Aiiaiiio
Aiiaiiio force-pushed the fix/no-warning-docformatlib branch from 1c08a52 to d999897 Compare December 2, 2026 13:29
@Aiiaiiio
Aiiaiiio marked this pull request as ready for review December 2, 2026 13:29
@Aiiaiiio
Aiiaiiio requested a review from a team as a code owner December 2, 2026 13:29
@Aiiaiiio
Aiiaiiio requested review from OlhaUshkalenko and rikled and a balanced review from Copilot and removed request for a team December 2, 2026 13:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new std::optional declarations require C++17, but the default qmake and checked-in Windows configurations do not enable it, breaking those builds.

1 open issue
What changed in this PR

Reduces DocFormatLib compiler warnings across document conversion code and shared OOXML types, alongside targeted correctness fixes.

Changes:

  • Makes copy operations, overload visibility, initialization order, and signedness explicit.
  • Fixes last-page detection, slicer extension destruction, and permission-group fallthrough.
  • Migrates selected Boost types to standard-library equivalents; documents the deferred encryption issue #506.
File Description
OOXML/​XlsxFormat/​WritingElement.h Exposes base XML overload; removes obsolete comments.
OOXML/​XlsxFormat/​Slicer/​SlicerCacheExt.h Includes complete extension-list type.
OOXML/​PPTXFormat/​WrapperWritingElement.h Delegates copy constructors to defaults.
OOXML/​PPTXFormat/​ViewProps/​SorterViewPr.h Defaults copy assignment.
OOXML/​PPTXFormat/​ViewProps/​SlideViewPr.h Defaults copy assignment.
OOXML/​PPTXFormat/​ViewProps/​Scale.h Defaults copy assignment.
OOXML/​PPTXFormat/​ViewProps/​Restored.h Defaults copy assignment.
OOXML/​PPTXFormat/​ViewProps/​Ratio.h Defaults copy assignment.
OOXML/​PPTXFormat/​ViewProps/​OutlineViewPr.h Defaults copy assignment.
OOXML/​PPTXFormat/​ViewProps/​Origin.h Defaults copy assignment.
OOXML/​PPTXFormat/​ViewProps/​NotesViewPr.h Defaults copy assignment.
OOXML/​PPTXFormat/​ViewProps/​NotesTextViewPr.h Defaults copy assignment.
OOXML/​PPTXFormat/​ViewProps/​NormalViewPr.h Defaults copy assignment.
OOXML/​PPTXFormat/​ViewProps/​Guide.h Defaults copy assignment.
OOXML/​PPTXFormat/​ViewProps/​GridSpacing.h Defaults copy assignment.
OOXML/​PPTXFormat/​ViewProps/​CViewPr.h Defaults copy assignment.
OOXML/​PPTXFormat/​Theme/​ThemeElements.h Defaults copy assignment.
OOXML/​PPTXFormat/​Theme/​FontScheme.h Defaults copy assignment.
OOXML/​PPTXFormat/​Theme/​ExtraClrScheme.h Defaults copy assignment.
OOXML/​PPTXFormat/​Theme.h Exposes inherited read overloads.
OOXML/​PPTXFormat/​ShowPr/​SldRg.h Defaults copy assignment.
OOXML/​PPTXFormat/​ShowPr/​SldAll.h Defaults copy assignment.
OOXML/​PPTXFormat/​ShowPr/​PresentationPr.h Defaults show and print assignments.
OOXML/​PPTXFormat/​ShowPr/​Present.h Defaults copy assignment.
OOXML/​PPTXFormat/​ShowPr/​Kiosk.h Defaults copy assignment.
OOXML/​PPTXFormat/​ShowPr/​CustomShowId.h Defaults copy assignment.
OOXML/​PPTXFormat/​ShowPr/​Browse.h Defaults copy assignment.
OOXML/​PPTXFormat/​Presentation/​PresentationChildElements.h Defaults child-element assignments.
OOXML/​PPTXFormat/​Logic/​XmlId.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​UniPath2D.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​TxStyles.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Transitions/​ZoomTransition.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Transitions/​WheelTransition.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Transitions/​Transition.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Transitions/​StSnd.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Transitions/​SplitTransition.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Transitions/​SndAc.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Transitions/​SideDirectionTransition.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Transitions/​OrientationTransition.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Transitions/​OptionalBlackTransition.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Transitions/​EmptyTransition.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Transitions/​EightDirectionTransition.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Transitions/​CornerDirectionTransition.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​Video.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​TxEl.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​Tmpl.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​Timing.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​TgtEl.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​Tav.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​SpTgt.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​Set.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​Seq.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​Par.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​Iterate.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​GraphicEl.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​Excl.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​CTn.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​Cond.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​CMediaNode.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​Cmd.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​ChildTnLst.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​CBhvr.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​BldSub.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​BldP.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​BldOleChart.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​BldGraphic.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​BldDgm.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​Audio.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​AttrName.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​AnimVariant.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​AnimScale.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​AnimRot.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​AnimMotion.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​AnimEffect.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​AnimClr.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Timing/​Anim.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​TextSpacing.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​TextFont.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​TextFont.cpp Delegates copy construction.
OOXML/​PPTXFormat/​Logic/​TcTxStyle.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​TcStyle.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​TcBdr.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​TableStyle.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​TablePartStyle.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​TableBgStyle.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Tab.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​SupplementalFont.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Runs/​MathParaWrapper.h Exposes inherited binary-reader overload.
OOXML/​PPTXFormat/​Logic/​RunProperties.h Defaults RTL copy assignment.
OOXML/​PPTXFormat/​Logic/​Rot.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Rect.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​PrstDash.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Path.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​PartTitle.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​LineStyle.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​LineJoin.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​LineEnd.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Lin.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​LightRig.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Hf.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​HeadingVariant.h Defaults variant assignments.
OOXML/​PPTXFormat/​Logic/​Gd.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​FillStyle.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Controls.h Defaults control assignments.
OOXML/​PPTXFormat/​Logic/​Colors/​SysClr.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Colors/​SrgbClr.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Colors/​SchemeClr.h Defaults color assignments.
OOXML/​PPTXFormat/​Logic/​Colors/​PrstClr.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​ClrMapOvr.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​ClrMap.h Defaults copy construction.
OOXML/​PPTXFormat/​Logic/​Camera.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​BgPr.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​Backdrop.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​AhXY.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​AhPolar.h Defaults copy assignment.
OOXML/​PPTXFormat/​Logic/​AhBase.h Defaults copy assignment.
OOXML/​PPTXFormat/​Comments.h Defaults comment and moniker assignments.
OOXML/​PPTXFormat/​CommentAuthors.h Defaults author assignment.
OOXML/​DocxFormat/​Media/​VbaProject.h Exposes inherited read overloads.
OOXML/​DocxFormat/​Logic/​Vml.h Exposes inherited merge overload.
OOXML/​Base/​Nullable.h Uses base-class copy constructors.
MsBinaryFile/​XlsFile/​Format/​Logic/​Biff_structures/​BorderFillInfo.h Makes comparison grouping explicit.
MsBinaryFile/​XlsFile/​Format/​Logic/​Biff_structures/​BiffString.h Exposes inherited save overloads.
MsBinaryFile/​XlsFile/​Format/​Logic/​Biff_structures/​BiffAttribute.h Corrects template constructor syntax.
MsBinaryFile/​PptFile/​Drawing/​Attributes.h Defaults file-info and color copying.
MsBinaryFile/​DocFile/​WordDocument.cpp Fixes last-page detection; adds encryption TODO.
MsBinaryFile/​DocFile/​VMLShapeMapping.cpp Migrates optionals; guards image indexing.
MsBinaryFile/​DocFile/​TextboxMapping.cpp Makes index conversions explicit.
MsBinaryFile/​DocFile/​TablePropertiesMapping.cpp Migrates table optionals to std::optional.
MsBinaryFile/​DocFile/​TableMapping.cpp Avoids size underflow in bounds checks.
MsBinaryFile/​DocFile/​TableCellPropertiesMapping.cpp Clarifies index checks and loop types.
MsBinaryFile/​DocFile/​StringTable.h Cleans comparisons and unused state.
MsBinaryFile/​DocFile/​Spa.cpp Uses unsigned container index.
MsBinaryFile/​DocFile/​Plex.h Orders initialization; simplifies bounds check.
MsBinaryFile/​DocFile/​OleObject.cpp Makes size comparison signedness explicit.
MsBinaryFile/​DocFile/​OfficeDrawing/​Record.cpp Guards signed size conversion.
MsBinaryFile/​DocFile/​NumberingMapping.cpp Explicitly guards negative indices.
MsBinaryFile/​DocFile/​ListData.h Migrates shared-pointer aliases.
MsBinaryFile/​DocFile/​ListData.cpp Uses std::make_shared; removes unused includes.
MsBinaryFile/​DocFile/​HeaderAndFooterTable.cpp Aligns comparison types; adds braces.
MsBinaryFile/​DocFile/​FormattedDiskPagePAPX.cpp Makes size conversion explicit.
MsBinaryFile/​DocFile/​FormattedDiskPageCHPX.cpp Makes size conversion explicit.
MsBinaryFile/​DocFile/​EncryptionHeader.cpp Simplifies RC4 selection; documents deferred flag bug.
MsBinaryFile/​DocFile/​DocumentProperties.cpp Removes unused storage while preserving reads.
MsBinaryFile/​DocFile/​DocumentMapping.cpp Fixes permission fallthrough and bounds checks.
MsBinaryFile/​DocFile/​CharacterPropertiesMapping.h Corrects virtual override signature.
MsBinaryFile/​DocFile/​CharacterPropertiesMapping.cpp Matches override; removes redundant checks.
MsBinaryFile/​Common/​Base/​utf8.h Uses unsigned values for bit shifts.
MsBinaryFile/​Common/​Base/​FormatUtils.h Corrects initializer order.
DesktopEditor/​common/​ASCVariant.h Matches initialization to declaration order.

Review effort: Balanced

Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
…in GetFileCharacterPositions

Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
…-bounds warning goes away

Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>

This branch was previously deployed

1 inactive deployment
build-cache — a9f7ead0 Deployed Dec 4, 2026 by Aiiaiiio via publish / publish #1065
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants