diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-08-14 18:22:06 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-14 18:22:06 +0000 |
commit | b9c3e2712f75363372622282023143b86b72f2df (patch) | |
tree | b8b4443fbf792143ade73b0fdd2ccf3e50c9a1e1 | |
parent | f46d49b52d39f8a56e40a95e0d9d2b574301fa04 (diff) | |
download | pdfium-b9c3e2712f75363372622282023143b86b72f2df.tar.xz |
Remove more default arg = nullptr cases.
Bring in line with standards.
Remove argument entirely for mac code that is always nullptr.
Change-Id: I0710bdbd51fc0bc2e1d428ef44976be39a631147
Reviewed-on: https://pdfium-review.googlesource.com/40091
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
24 files changed, 69 insertions, 73 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp index 860f6d6b3b..d0be6b3193 100644 --- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp +++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp @@ -1201,14 +1201,14 @@ CPDF_ColorSpace* CPDF_StreamContentParser::FindColorSpace( } return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK); } - return m_pDocument->LoadColorSpace(pDefObj); + return m_pDocument->LoadColorSpace(pDefObj, nullptr); } const CPDF_Object* pCSObj = FindResourceObj("ColorSpace", name); if (!pCSObj) { m_bResourceMissing = true; return nullptr; } - return m_pDocument->LoadColorSpace(pCSObj); + return m_pDocument->LoadColorSpace(pCSObj, nullptr); } CPDF_Pattern* CPDF_StreamContentParser::FindPattern(const ByteString& name, diff --git a/core/fpdfapi/page/cpdf_streamparser.cpp b/core/fpdfapi/page/cpdf_streamparser.cpp index 8652490a22..4b27cb32f3 100644 --- a/core/fpdfapi/page/cpdf_streamparser.cpp +++ b/core/fpdfapi/page/cpdf_streamparser.cpp @@ -141,7 +141,7 @@ std::unique_ptr<CPDF_Stream> CPDF_StreamParser::ReadInlineStream( if (pCSObj) { uint32_t bpc = pDict->GetIntegerFor("BitsPerComponent"); uint32_t nComponents = 1; - CPDF_ColorSpace* pCS = pDoc->LoadColorSpace(pCSObj); + CPDF_ColorSpace* pCS = pDoc->LoadColorSpace(pCSObj, nullptr); if (pCS) { nComponents = pCS->CountComponents(); pDoc->GetPageData()->ReleaseColorSpace(pCSObj); diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h index 81860a926d..8261441f64 100644 --- a/core/fpdfapi/parser/cpdf_document.h +++ b/core/fpdfapi/parser/cpdf_document.h @@ -90,7 +90,7 @@ class CPDF_Document : public Observable<CPDF_Document>, // |pFontDict| must not be null. CPDF_Font* LoadFont(CPDF_Dictionary* pFontDict); CPDF_ColorSpace* LoadColorSpace(const CPDF_Object* pCSObj, - const CPDF_Dictionary* pResources = nullptr); + const CPDF_Dictionary* pResources); CPDF_Pattern* LoadPattern(CPDF_Object* pObj, bool bShading, diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp index 568e350302..85e446f1a5 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.cpp +++ b/core/fpdfapi/render/cpdf_renderstatus.cpp @@ -2633,7 +2633,7 @@ FX_ARGB CPDF_RenderStatus::GetBackColor(const CPDF_Dictionary* pSMaskDict, if (pGroup) pCSObj = pGroup->GetDirectObjectFor(pdfium::transparency::kCS); const CPDF_ColorSpace* pCS = - m_pContext->GetDocument()->LoadColorSpace(pCSObj); + m_pContext->GetDocument()->LoadColorSpace(pCSObj, nullptr); if (!pCS) return kDefaultColor; diff --git a/core/fxcodec/codec/ccodec_gifmodule.h b/core/fxcodec/codec/ccodec_gifmodule.h index e7b250fe27..cbc8fc6815 100644 --- a/core/fxcodec/codec/ccodec_gifmodule.h +++ b/core/fxcodec/codec/ccodec_gifmodule.h @@ -42,7 +42,7 @@ class CCodec_GifModule { ~CCodec_GifModule(); std::unique_ptr<Context> Start(Delegate* pDelegate); - uint32_t GetAvailInput(Context* context, uint8_t** avail_buf_ptr = nullptr); + uint32_t GetAvailInput(Context* context, uint8_t** avail_buf_ptr); void Input(Context* context, const uint8_t* src_buf, uint32_t src_size); CFX_GifDecodeStatus ReadHeader(Context* context, int* width, diff --git a/core/fxcodec/codec/fx_codec_progress.cpp b/core/fxcodec/codec/fx_codec_progress.cpp index d1c04b9790..8ebb119dff 100644 --- a/core/fxcodec/codec/fx_codec_progress.cpp +++ b/core/fxcodec/codec/fx_codec_progress.cpp @@ -457,7 +457,7 @@ void CCodec_ProgressiveDecoder::PngFillScanlineBufCompleted(int pass, #ifdef PDF_ENABLE_XFA_GIF void CCodec_ProgressiveDecoder::GifRecordCurrentPosition(uint32_t& cur_pos) { uint32_t remain_size = - m_pCodecMgr->GetGifModule()->GetAvailInput(m_pGifContext.get()); + m_pCodecMgr->GetGifModule()->GetAvailInput(m_pGifContext.get(), nullptr); cur_pos = m_offSet - remain_size; } diff --git a/core/fxge/apple/apple_int.h b/core/fxge/apple/apple_int.h index d57989180d..e84387a3c8 100644 --- a/core/fxge/apple/apple_int.h +++ b/core/fxge/apple/apple_int.h @@ -31,8 +31,7 @@ class CQuartz2D { uint16_t* glyphIndices, CGPoint* glyphPositions, int32_t chars, - FX_ARGB argb, - CFX_Matrix* matrix = nullptr); + FX_ARGB argb); void saveGraphicsState(void* graphics); void restoreGraphicsState(void* graphics); }; diff --git a/core/fxge/apple/fx_apple_platform.cpp b/core/fxge/apple/fx_apple_platform.cpp index 3c1e4d7766..cafe44730c 100644 --- a/core/fxge/apple/fx_apple_platform.cpp +++ b/core/fxge/apple/fx_apple_platform.cpp @@ -76,9 +76,9 @@ bool CGDrawGlyphRun(CGContextRef pContext, new_matrix.d = -new_matrix.d; } quartz2d.setGraphicsTextMatrix(pContext, &new_matrix); - return quartz2d.drawGraphicsString( - pContext, pFont->GetPlatformFont(), font_size, glyph_indices.data(), - glyph_positions.data(), nChars, argb, nullptr); + return quartz2d.drawGraphicsString(pContext, pFont->GetPlatformFont(), + font_size, glyph_indices.data(), + glyph_positions.data(), nChars, argb); } } // namespace diff --git a/core/fxge/apple/fx_quartz_device.cpp b/core/fxge/apple/fx_quartz_device.cpp index 709f201f8a..62b9b9e618 100644 --- a/core/fxge/apple/fx_quartz_device.cpp +++ b/core/fxge/apple/fx_quartz_device.cpp @@ -79,20 +79,14 @@ bool CQuartz2D::drawGraphicsString(void* graphics, uint16_t* glyphIndices, CGPoint* glyphPositions, int32_t charsCount, - FX_ARGB argb, - CFX_Matrix* matrix) { + FX_ARGB argb) { if (!graphics) return false; + CGContextRef context = (CGContextRef)graphics; CGContextSetFont(context, (CGFontRef)font); CGContextSetFontSize(context, fontSize); - if (matrix) { - CGAffineTransform m = CGContextGetTextMatrix(context); - m = CGAffineTransformConcat( - m, CGAffineTransformMake(matrix->a, matrix->b, matrix->c, matrix->d, - matrix->e, matrix->f)); - CGContextSetTextMatrix(context, m); - } + int32_t a; int32_t r; int32_t g; diff --git a/fpdfsdk/cpdfsdk_interform.h b/fpdfsdk/cpdfsdk_interform.h index 14772efe8f..c44688f6dd 100644 --- a/fpdfsdk/cpdfsdk_interform.h +++ b/fpdfsdk/cpdfsdk_interform.h @@ -67,7 +67,7 @@ class CPDFSDK_InterForm : public IPDF_FormNotify { bool OnKeyStrokeCommit(CPDF_FormField* pFormField, const WideString& csValue); bool OnValidate(CPDF_FormField* pFormField, const WideString& csValue); - void OnCalculate(CPDF_FormField* pFormField = nullptr); + void OnCalculate(CPDF_FormField* pFormField); WideString OnFormat(CPDF_FormField* pFormField, bool& bFormatted); void ResetFieldAppearance(CPDF_FormField* pFormField, diff --git a/fpdfsdk/fpdf_annot_embeddertest.cpp b/fpdfsdk/fpdf_annot_embeddertest.cpp index 5fd5d587bc..767a5c78c0 100644 --- a/fpdfsdk/fpdf_annot_embeddertest.cpp +++ b/fpdfsdk/fpdf_annot_embeddertest.cpp @@ -320,7 +320,7 @@ TEST_F(FPDFAnnotEmbeddertest, AddAndSaveUnderlineAnnotation) { // Open the saved document. const char md5[] = "dba153419f67b7c0c0e3d22d3e8910d5"; - OpenSavedDocument(); + OpenSavedDocument(nullptr); page = LoadSavedPage(0); VerifySavedRendering(page, 612, 792, md5); @@ -762,7 +762,7 @@ TEST_F(FPDFAnnotEmbeddertest, AddAndModifyPath) { UnloadPage(page); // Open the saved document. - OpenSavedDocument(); + OpenSavedDocument(nullptr); page = LoadSavedPage(0); VerifySavedRendering(page, 595, 842, md5_new_annot); @@ -1076,7 +1076,7 @@ TEST_F(FPDFAnnotEmbeddertest, GetSetStringValue) { #endif // Open the saved annotation. - OpenSavedDocument(); + OpenSavedDocument(nullptr); page = LoadSavedPage(0); VerifySavedRendering(page, 595, 842, md5); { @@ -1198,7 +1198,7 @@ TEST_F(FPDFAnnotEmbeddertest, GetSetAP) { EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0)); UnloadPage(page); - OpenSavedDocument(); + OpenSavedDocument(nullptr); page = LoadSavedPage(0); { ScopedFPDFAnnotation new_annot(FPDFPage_GetAnnot(page, 0)); diff --git a/fpdfsdk/fpdf_edit_embeddertest.cpp b/fpdfsdk/fpdf_edit_embeddertest.cpp index 3c2b05ed8a..e692a94e04 100644 --- a/fpdfsdk/fpdf_edit_embeddertest.cpp +++ b/fpdfsdk/fpdf_edit_embeddertest.cpp @@ -464,7 +464,7 @@ TEST_F(FPDFEditEmbeddertest, SetText) { UnloadPage(page); // Re-open the file and check the changes were kept in the saved .pdf. - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); EXPECT_EQ(2, FPDFPage_CountObjects(saved_page)); { @@ -732,7 +732,7 @@ TEST_F(FPDFEditEmbeddertest, RemoveMarks) { UnloadPage(page); // Re-open the file and check the prime marks are not there anymore. - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); CheckMarkCounts(saved_page, 1, kExpectedObjectCount, 0, 4, 9, 1); @@ -784,7 +784,7 @@ TEST_F(FPDFEditEmbeddertest, RemoveMarkParam) { UnloadPage(page); // Re-open the file and check the "Factor" parameters are still gone. - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); size_t square_count = 0; @@ -839,7 +839,7 @@ TEST_F(FPDFEditEmbeddertest, MaintainMarkedObjects) { UnloadPage(page); - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); CheckMarkCounts(saved_page, 2, 18, 8, 3, 9, 1); @@ -870,7 +870,7 @@ TEST_F(FPDFEditEmbeddertest, MaintainIndirectMarkedObjects) { UnloadPage(page); - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); CheckMarkCounts(saved_page, 2, 18, 8, 3, 9, 1); @@ -901,7 +901,7 @@ TEST_F(FPDFEditEmbeddertest, RemoveExistingPageObject) { FPDFPageObj_Destroy(page_object); // Re-open the file and check the page object count is still 1. - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); EXPECT_EQ(1, FPDFPage_CountObjects(saved_page)); CloseSavedPage(saved_page); @@ -942,7 +942,7 @@ TEST_F(FPDFEditEmbeddertest, RemoveExistingPageObjectSplitStreamsNotLonely) { FPDFPageObj_Destroy(page_object); // Re-open the file and check the page object count is still 2. - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); EXPECT_EQ(2, FPDFPage_CountObjects(saved_page)); @@ -989,7 +989,7 @@ TEST_F(FPDFEditEmbeddertest, RemoveExistingPageObjectSplitStreamsLonely) { FPDFPageObj_Destroy(page_object); // Re-open the file and check the page object count is still 2. - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); EXPECT_EQ(2, FPDFPage_CountObjects(saved_page)); @@ -1104,7 +1104,7 @@ TEST_F(FPDFEditEmbeddertest, RemoveAllFromStream) { // Re-open the file and check the page object count is still 16, and that // content stream 1 was removed. - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); // Content stream 0: page objects 0-14. @@ -1171,7 +1171,7 @@ TEST_F(FPDFEditEmbeddertest, RemoveAllFromSingleStream) { UnloadPage(page); // Re-open the file and check the page object count is still 0. - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); EXPECT_EQ(0, FPDFPage_CountObjects(saved_page)); @@ -1235,7 +1235,7 @@ TEST_F(FPDFEditEmbeddertest, RemoveFirstFromSingleStream) { UnloadPage(page); // Re-open the file and check the page object count is still 0. - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); ASSERT_EQ(1, FPDFPage_CountObjects(saved_page)); @@ -1303,7 +1303,7 @@ TEST_F(FPDFEditEmbeddertest, RemoveLastFromSingleStream) { UnloadPage(page); // Re-open the file and check the page object count is still 0. - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); ASSERT_EQ(1, FPDFPage_CountObjects(saved_page)); @@ -1359,7 +1359,7 @@ TEST_F(FPDFEditEmbeddertest, RemoveAllFromMultipleStreams) { UnloadPage(page); // Re-open the file and check the page object count is still 0. - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); EXPECT_EQ(0, FPDFPage_CountObjects(saved_page)); @@ -1394,7 +1394,7 @@ TEST_F(FPDFEditEmbeddertest, InsertPageObjectAndSave) { UnloadPage(page); // Re-open the file and check the page object count is still 3. - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); EXPECT_EQ(3, FPDFPage_CountObjects(saved_page)); CloseSavedPage(saved_page); @@ -1427,7 +1427,7 @@ TEST_F(FPDFEditEmbeddertest, InsertPageObjectEditAndSave) { UnloadPage(page); // Re-open the file and check the page object count is still 3. - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); EXPECT_EQ(3, FPDFPage_CountObjects(saved_page)); CloseSavedPage(saved_page); @@ -1563,7 +1563,7 @@ TEST_F(FPDFEditEmbeddertest, EditOverExistingContent) { EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0)); UnloadPage(page); - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); VerifySavedRendering(saved_page, 612, 792, "ad04e5bd0f471a9a564fb034bd0fb073"); @@ -2359,7 +2359,7 @@ TEST_F(FPDFEditEmbeddertest, AddMark) { UnloadPage(page); // Re-open the file and check the new mark is present. - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); CheckMarkCounts(saved_page, 1, kExpectedObjectCount, 8, 4, 9, 2); @@ -2415,7 +2415,7 @@ TEST_F(FPDFEditEmbeddertest, SetMarkParam) { UnloadPage(page); // Re-open the file and cerify "Position" still maps to "End". - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); CheckMarkCounts(saved_page, 1, kExpectedObjectCount, 8, 4, 9, 1); @@ -2525,7 +2525,7 @@ TEST_F(FPDFEditEmbeddertest, AddMarkedText) { FPDF_ClosePage(page); // Re-open the file and check the changes were kept in the saved .pdf. - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE saved_page = LoadSavedPage(0); EXPECT_EQ(1, FPDFPage_CountObjects(saved_page)); diff --git a/fpdfsdk/fpdf_editpath_embeddertest.cpp b/fpdfsdk/fpdf_editpath_embeddertest.cpp index 59e5dbbabf..dcf3f2c351 100644 --- a/fpdfsdk/fpdf_editpath_embeddertest.cpp +++ b/fpdfsdk/fpdf_editpath_embeddertest.cpp @@ -31,7 +31,7 @@ TEST_F(FPDFEditPathEmbedderTest, VerifyCorrectColoursReturned) { FPDF_ClosePage(page); page = nullptr; - OpenSavedDocument(); + OpenSavedDocument(nullptr); page = LoadSavedPage(0); ASSERT(page); diff --git a/fpdfsdk/fpdf_save_embeddertest.cpp b/fpdfsdk/fpdf_save_embeddertest.cpp index 64a305fa86..510660ee82 100644 --- a/fpdfsdk/fpdf_save_embeddertest.cpp +++ b/fpdfsdk/fpdf_save_embeddertest.cpp @@ -82,7 +82,7 @@ TEST_F(FPDFSaveEmbedderTest, SaveLinearizedDoc) { EXPECT_EQ(8219u, GetString().length()); // Make sure new document renders the same as the old one. - EXPECT_TRUE(OpenSavedDocument()); + EXPECT_TRUE(OpenSavedDocument(nullptr)); for (int i = 0; i < kPageCount; ++i) { FPDF_PAGE page = LoadSavedPage(i); ASSERT_TRUE(page); diff --git a/fxjs/cfxjse_context.h b/fxjs/cfxjse_context.h index 5a299428ab..2e47adb65f 100644 --- a/fxjs/cfxjse_context.h +++ b/fxjs/cfxjse_context.h @@ -37,7 +37,7 @@ class CFXJSE_Context { void EnableCompatibleMode(); bool ExecuteScript(const char* szScript, CFXJSE_Value* lpRetValue, - CFXJSE_Value* lpNewThisObject = nullptr); + CFXJSE_Value* lpNewThisObject); private: CFXJSE_Context(const CFXJSE_Context&) = delete; diff --git a/fxjs/cfxjse_engine.cpp b/fxjs/cfxjse_engine.cpp index bf5778bf9a..ef6212e3f3 100644 --- a/fxjs/cfxjse_engine.cpp +++ b/fxjs/cfxjse_engine.cpp @@ -514,7 +514,8 @@ bool CFXJSE_Engine::RunVariablesScript(CXFA_Node* pScriptNode) { CreateVariablesContext(pScriptNode, pThisObject); AutoRestorer<CXFA_Object*> nodeRestorer(&m_pThisObject); m_pThisObject = pThisObject; - return pVariablesContext->ExecuteScript(btScript.c_str(), hRetValue.get()); + return pVariablesContext->ExecuteScript(btScript.c_str(), hRetValue.get(), + nullptr); } bool CFXJSE_Engine::QueryVariableValue(CXFA_Node* pScriptNode, diff --git a/fxjs/cfxjse_formcalc_context.cpp b/fxjs/cfxjse_formcalc_context.cpp index a2773b27d0..0eee3d4de5 100644 --- a/fxjs/cfxjse_formcalc_context.cpp +++ b/fxjs/cfxjse_formcalc_context.cpp @@ -3429,7 +3429,8 @@ void CFXJSE_FormCalcContext::Eval(CFXJSE_Value* pThis, auto returnValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate); pNewContext->ExecuteScript( - FX_UTF8Encode(wsJavaScriptBuf.AsStringView()).c_str(), returnValue.get()); + FX_UTF8Encode(wsJavaScriptBuf.AsStringView()).c_str(), returnValue.get(), + nullptr); args.GetReturnValue()->Assign(returnValue.get()); } diff --git a/fxjs/cjs_document.cpp b/fxjs/cjs_document.cpp index b135805363..fa9826d1ae 100644 --- a/fxjs/cjs_document.cpp +++ b/fxjs/cjs_document.cpp @@ -1199,7 +1199,7 @@ CJS_Return CJS_Document::calculateNow( return CJS_Return(JSMessage::kPermissionError); } - m_pFormFillEnv->GetInterForm()->OnCalculate(); + m_pFormFillEnv->GetInterForm()->OnCalculate(nullptr); return CJS_Return(); } diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp index e874640218..3f953d22df 100644 --- a/testing/embedder_test.cpp +++ b/testing/embedder_test.cpp @@ -420,7 +420,7 @@ void EmbedderTest::VerifySavedRendering(FPDF_PAGE page, } void EmbedderTest::VerifySavedDocument(int width, int height, const char* md5) { - OpenSavedDocument(); + OpenSavedDocument(nullptr); FPDF_PAGE page = LoadSavedPage(0); VerifySavedRendering(page, width, height, md5); CloseSavedPage(page); diff --git a/testing/embedder_test.h b/testing/embedder_test.h index b0dada0341..ef4fe02721 100644 --- a/testing/embedder_test.h +++ b/testing/embedder_test.h @@ -192,7 +192,7 @@ class EmbedderTest : public ::testing::Test, unsigned long size); // See comments in the respective non-Saved versions of these methods. - FPDF_DOCUMENT OpenSavedDocument(const char* password = nullptr); + FPDF_DOCUMENT OpenSavedDocument(const char* password); void CloseSavedDocument(); FPDF_PAGE LoadSavedPage(int page_number); void CloseSavedPage(FPDF_PAGE page); diff --git a/xfa/fxfa/cxfa_ffwidgethandler.cpp b/xfa/fxfa/cxfa_ffwidgethandler.cpp index eb9a4ca63a..212a029f26 100644 --- a/xfa/fxfa/cxfa_ffwidgethandler.cpp +++ b/xfa/fxfa/cxfa_ffwidgethandler.cpp @@ -332,32 +332,32 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateWidgetFormItem( CXFA_Node* CXFA_FFWidgetHandler::CreatePushButton(CXFA_Node* pParent, CXFA_Node* pBefore) const { CXFA_Node* pField = CreateField(XFA_Element::Button, pParent, pBefore); - CXFA_Node* pCaption = CreateCopyNode(XFA_Element::Caption, pField); - CXFA_Node* pValue = CreateCopyNode(XFA_Element::Value, pCaption); - CXFA_Node* pText = CreateCopyNode(XFA_Element::Text, pValue); + CXFA_Node* pCaption = CreateCopyNode(XFA_Element::Caption, pField, nullptr); + CXFA_Node* pValue = CreateCopyNode(XFA_Element::Value, pCaption, nullptr); + CXFA_Node* pText = CreateCopyNode(XFA_Element::Text, pValue, nullptr); pText->JSObject()->SetContent(L"Button", L"Button", false, false, true); - CXFA_Node* pPara = CreateCopyNode(XFA_Element::Para, pCaption); + CXFA_Node* pPara = CreateCopyNode(XFA_Element::Para, pCaption, nullptr); pPara->JSObject()->SetEnum(XFA_Attribute::VAlign, XFA_AttributeEnum::Middle, false); pPara->JSObject()->SetEnum(XFA_Attribute::HAlign, XFA_AttributeEnum::Center, false); CreateFontNode(pCaption); - CXFA_Node* pBorder = CreateCopyNode(XFA_Element::Border, pField); + CXFA_Node* pBorder = CreateCopyNode(XFA_Element::Border, pField, nullptr); pBorder->JSObject()->SetEnum(XFA_Attribute::Hand, XFA_AttributeEnum::Right, false); - CXFA_Node* pEdge = CreateCopyNode(XFA_Element::Edge, pBorder); + CXFA_Node* pEdge = CreateCopyNode(XFA_Element::Edge, pBorder, nullptr); pEdge->JSObject()->SetEnum(XFA_Attribute::Stroke, XFA_AttributeEnum::Raised, false); - CXFA_Node* pFill = CreateCopyNode(XFA_Element::Fill, pBorder); - CXFA_Node* pColor = CreateCopyNode(XFA_Element::Color, pFill); + CXFA_Node* pFill = CreateCopyNode(XFA_Element::Fill, pBorder, nullptr); + CXFA_Node* pColor = CreateCopyNode(XFA_Element::Color, pFill, nullptr); pColor->JSObject()->SetCData(XFA_Attribute::Value, L"212, 208, 200", false, false); - CXFA_Node* pBind = CreateCopyNode(XFA_Element::Bind, pField); + CXFA_Node* pBind = CreateCopyNode(XFA_Element::Bind, pField, nullptr); pBind->JSObject()->SetEnum(XFA_Attribute::Match, XFA_AttributeEnum::None, false); @@ -439,7 +439,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateImageField(CXFA_Node* pParent, CXFA_Node* CXFA_FFWidgetHandler::CreatePasswordEdit(CXFA_Node* pParent, CXFA_Node* pBefore) const { CXFA_Node* pField = CreateField(XFA_Element::PasswordEdit, pParent, pBefore); - CXFA_Node* pBind = CreateCopyNode(XFA_Element::Bind, pField); + CXFA_Node* pBind = CreateCopyNode(XFA_Element::Bind, pField, nullptr); pBind->JSObject()->SetEnum(XFA_Attribute::Match, XFA_AttributeEnum::None, false); return pField; @@ -449,7 +449,8 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateField(XFA_Element eElement, CXFA_Node* pParent, CXFA_Node* pBefore) const { CXFA_Node* pField = CreateFormItem(XFA_Element::Field, pParent, pBefore); - CreateCopyNode(eElement, CreateCopyNode(XFA_Element::Ui, pField)); + CreateCopyNode(eElement, CreateCopyNode(XFA_Element::Ui, pField, nullptr), + nullptr); CreateFontNode(pField); return pField; } @@ -468,7 +469,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateImage(CXFA_Node* pParent, CXFA_Node* pBefore) const { CXFA_Node* pField = CreateDraw(XFA_Element::Image, pParent, pBefore); CreateCopyNode(XFA_Element::ImageEdit, - CreateCopyNode(XFA_Element::Ui, pField)); + CreateCopyNode(XFA_Element::Ui, pField, nullptr), nullptr); return pField; } @@ -481,7 +482,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateText(CXFA_Node* pParent, CXFA_Node* pBefore) const { CXFA_Node* pField = CreateDraw(XFA_Element::Text, pParent, pBefore); CreateCopyNode(XFA_Element::TextEdit, - CreateCopyNode(XFA_Element::Ui, pField)); + CreateCopyNode(XFA_Element::Ui, pField, nullptr), nullptr); CreateFontNode(pField); return pField; } @@ -543,7 +544,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateTemplateNode(XFA_Element eElement, } CXFA_Node* CXFA_FFWidgetHandler::CreateFontNode(CXFA_Node* pParent) const { - CXFA_Node* pFont = CreateCopyNode(XFA_Element::Font, pParent); + CXFA_Node* pFont = CreateCopyNode(XFA_Element::Font, pParent, nullptr); pFont->JSObject()->SetCData(XFA_Attribute::Typeface, L"Myriad Pro", false, false); return pFont; @@ -552,7 +553,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateFontNode(CXFA_Node* pParent) const { CXFA_Node* CXFA_FFWidgetHandler::CreateMarginNode(CXFA_Node* pParent, uint32_t dwFlags, float fInsets[4]) const { - CXFA_Node* pMargin = CreateCopyNode(XFA_Element::Margin, pParent); + CXFA_Node* pMargin = CreateCopyNode(XFA_Element::Margin, pParent, nullptr); if (dwFlags & 0x01) pMargin->JSObject()->SetMeasure(XFA_Attribute::LeftInset, CXFA_Measurement(fInsets[0], XFA_Unit::Pt), @@ -574,8 +575,8 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateMarginNode(CXFA_Node* pParent, CXFA_Node* CXFA_FFWidgetHandler::CreateValueNode(XFA_Element eValue, CXFA_Node* pParent) const { - CXFA_Node* pValue = CreateCopyNode(XFA_Element::Value, pParent); - CreateCopyNode(eValue, pValue); + CXFA_Node* pValue = CreateCopyNode(XFA_Element::Value, pParent, nullptr); + CreateCopyNode(eValue, pValue, nullptr); return pValue; } diff --git a/xfa/fxfa/cxfa_ffwidgethandler.h b/xfa/fxfa/cxfa_ffwidgethandler.h index 58e531f098..283e6d5933 100644 --- a/xfa/fxfa/cxfa_ffwidgethandler.h +++ b/xfa/fxfa/cxfa_ffwidgethandler.h @@ -112,7 +112,7 @@ class CXFA_FFWidgetHandler { CXFA_Node* pBefore) const; CXFA_Node* CreateCopyNode(XFA_Element eElement, CXFA_Node* pParent, - CXFA_Node* pBefore = nullptr) const; + CXFA_Node* pBefore) const; CXFA_Node* CreateTemplateNode(XFA_Element eElement, CXFA_Node* pParent, CXFA_Node* pBefore) const; diff --git a/xfa/fxfa/parser/cxfa_pattern.cpp b/xfa/fxfa/parser/cxfa_pattern.cpp index f5809258a0..81391c9b64 100644 --- a/xfa/fxfa/parser/cxfa_pattern.cpp +++ b/xfa/fxfa/parser/cxfa_pattern.cpp @@ -79,7 +79,7 @@ void CXFA_Pattern::Draw(CXFA_Graphics* pGS, break; } - CXFA_GEPattern pattern(iHatch, crEnd, crStart); + CXFA_GEPattern pattern(iHatch, crEnd, crStart, nullptr); pGS->SaveGraphState(); pGS->SetFillColor(CXFA_GEColor(&pattern, 0x0)); diff --git a/xfa/fxgraphics/cxfa_gepattern.h b/xfa/fxgraphics/cxfa_gepattern.h index 0f4ced20ea..499d4ff277 100644 --- a/xfa/fxgraphics/cxfa_gepattern.h +++ b/xfa/fxgraphics/cxfa_gepattern.h @@ -19,7 +19,7 @@ class CXFA_GEPattern { CXFA_GEPattern(FX_HatchStyle hatchStyle, const FX_ARGB foreArgb, const FX_ARGB backArgb, - CFX_Matrix* matrix = nullptr); + CFX_Matrix* matrix); virtual ~CXFA_GEPattern(); |