diff options
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/fpdf_edit_embeddertest.cpp | 19 | ||||
-rw-r--r-- | fpdfsdk/fpdf_editpage.cpp | 33 | ||||
-rw-r--r-- | fpdfsdk/fpdf_view_c_api_test.c | 3 |
3 files changed, 3 insertions, 52 deletions
diff --git a/fpdfsdk/fpdf_edit_embeddertest.cpp b/fpdfsdk/fpdf_edit_embeddertest.cpp index 52cc9fed86..ee80f3a20c 100644 --- a/fpdfsdk/fpdf_edit_embeddertest.cpp +++ b/fpdfsdk/fpdf_edit_embeddertest.cpp @@ -560,12 +560,8 @@ void CheckMarkCounts(FPDF_PAGE page, EXPECT_EQ(L"Factor", key); EXPECT_EQ(FPDF_OBJECT_NUMBER, - FPDFPageObjMark_GetParamValueType(mark, 0)); - int square_root = FPDFPageObjMark_GetParamIntValue(mark, 0); - EXPECT_EQ(expected_square, square_root * square_root); - - EXPECT_EQ(FPDF_OBJECT_NUMBER, FPDFPageObjMark_GetParamValueTypeByKey(mark, "Factor")); + int square_root; EXPECT_TRUE(FPDFPageObjMark_GetParamIntValueByKey(mark, "Factor", &square_root)); EXPECT_EQ(expected_square, square_root * square_root); @@ -583,16 +579,6 @@ void CheckMarkCounts(FPDF_PAGE page, GetPlatformWString(reinterpret_cast<unsigned short*>(buffer)); EXPECT_EQ(L"Position", key); - EXPECT_EQ(FPDF_OBJECT_STRING, - FPDFPageObjMark_GetParamValueType(mark, 0)); - unsigned long get_param_value_return = - FPDFPageObjMark_GetParamStringValue(mark, 0, buffer, 256); - ASSERT_GT(get_param_value_return, 0u); - EXPECT_EQ((4u + 1u) * 2u, get_param_value_return); - std::wstring value = - GetPlatformWString(reinterpret_cast<unsigned short*>(buffer)); - EXPECT_EQ(L"Last", value); - // Should be the last object. EXPECT_EQ(object_count - 1, i); @@ -603,7 +589,8 @@ void CheckMarkCounts(FPDF_PAGE page, mark, "Position", buffer, 256, &length)); ASSERT_GT(length, 0u); EXPECT_EQ((4u + 1u) * 2u, length); - value = GetPlatformWString(reinterpret_cast<unsigned short*>(buffer)); + std::wstring value = + GetPlatformWString(reinterpret_cast<unsigned short*>(buffer)); EXPECT_EQ(L"Last", value); } else { FAIL(); diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp index 8d8c315b07..968d857e8b 100644 --- a/fpdfsdk/fpdf_editpage.cpp +++ b/fpdfsdk/fpdf_editpage.cpp @@ -375,15 +375,6 @@ FPDFPageObjMark_GetParamKey(FPDF_PAGEOBJECTMARK mark, WideString::FromUTF8(param_pair->first.AsStringView()), buffer, buflen); } -FPDF_EXPORT FPDF_OBJECT_TYPE FPDF_CALLCONV -FPDFPageObjMark_GetParamValueType(FPDF_PAGEOBJECTMARK mark, - unsigned long index) { - auto* param_pair = GetMarkParamPairAtIndex(mark, index); - if (!param_pair) - return FPDF_OBJECT_UNKNOWN; - - return param_pair->second->GetType(); -} FPDF_EXPORT FPDF_OBJECT_TYPE FPDF_CALLCONV FPDFPageObjMark_GetParamValueTypeByKey(FPDF_PAGEOBJECTMARK mark, @@ -399,16 +390,6 @@ FPDFPageObjMark_GetParamValueTypeByKey(FPDF_PAGEOBJECTMARK mark, return pObject->GetType(); } -FPDF_EXPORT int FPDF_CALLCONV -FPDFPageObjMark_GetParamIntValue(FPDF_PAGEOBJECTMARK mark, - unsigned long index) { - auto* param_pair = GetMarkParamPairAtIndex(mark, index); - if (!param_pair) - return 0; - - return param_pair->second->GetInteger(); -} - FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPageObjMark_GetParamIntValueByKey(FPDF_PAGEOBJECTMARK mark, FPDF_BYTESTRING key, @@ -425,20 +406,6 @@ FPDFPageObjMark_GetParamIntValueByKey(FPDF_PAGEOBJECTMARK mark, return true; } -FPDF_EXPORT unsigned long FPDF_CALLCONV -FPDFPageObjMark_GetParamStringValue(FPDF_PAGEOBJECTMARK mark, - unsigned long index, - void* buffer, - unsigned long buflen) { - auto* param_pair = GetMarkParamPairAtIndex(mark, index); - if (!param_pair) - return 0; - - return Utf16EncodeMaybeCopyAndReturnLength( - WideString::FromUTF8(param_pair->second->GetString().AsStringView()), - buffer, buflen); -} - FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPageObjMark_GetParamStringValueByKey(FPDF_PAGEOBJECTMARK mark, FPDF_BYTESTRING key, diff --git a/fpdfsdk/fpdf_view_c_api_test.c b/fpdfsdk/fpdf_view_c_api_test.c index c0021fc7c0..6e6d2ce5c8 100644 --- a/fpdfsdk/fpdf_view_c_api_test.c +++ b/fpdfsdk/fpdf_view_c_api_test.c @@ -139,12 +139,9 @@ int CheckPDFiumCApi() { CHK(FPDFImageObj_SetMatrix); CHK(FPDFPageObjMark_CountParams); CHK(FPDFPageObjMark_GetName); - CHK(FPDFPageObjMark_GetParamIntValue); CHK(FPDFPageObjMark_GetParamIntValueByKey); CHK(FPDFPageObjMark_GetParamKey); - CHK(FPDFPageObjMark_GetParamStringValue); CHK(FPDFPageObjMark_GetParamStringValueByKey); - CHK(FPDFPageObjMark_GetParamValueType); CHK(FPDFPageObjMark_GetParamValueTypeByKey); CHK(FPDFPageObjMark_SetIntParam); CHK(FPDFPageObjMark_SetStringParam); |