OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "public/fpdfview.h" | 7 #include "public/fpdfview.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 | 678 |
679 if (pPageView->IsLocked()) { | 679 if (pPageView->IsLocked()) { |
680 pPageView->TakePageOwnership(); | 680 pPageView->TakePageOwnership(); |
681 return; | 681 return; |
682 } | 682 } |
683 | 683 |
684 bool owned = pPageView->OwnsPage(); | 684 bool owned = pPageView->OwnsPage(); |
685 // This will delete the |pPageView| object. We must cleanup the PageView | 685 // This will delete the |pPageView| object. We must cleanup the PageView |
686 // first because it will attempt to reset the View on the |pPage| during | 686 // first because it will attempt to reset the View on the |pPage| during |
687 // destruction. | 687 // destruction. |
688 pPageView->GetFormFillEnv()->GetSDKDocument()->RemovePageView(pPage); | 688 pPageView->GetFormFillEnv()->RemovePageView(pPage); |
689 // If the page was owned then the pageview will have deleted the page. | 689 // If the page was owned then the pageview will have deleted the page. |
690 if (owned) | 690 if (owned) |
691 return; | 691 return; |
692 } | 692 } |
693 delete pPage; | 693 delete pPage; |
694 #endif // PDF_ENABLE_XFA | 694 #endif // PDF_ENABLE_XFA |
695 } | 695 } |
696 | 696 |
697 DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document) { | 697 DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document) { |
698 delete UnderlyingFromFPDFDocument(document); | 698 delete UnderlyingFromFPDFDocument(document); |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 if (!buffer) { | 1130 if (!buffer) { |
1131 *buflen = len; | 1131 *buflen = len; |
1132 } else if (*buflen >= len) { | 1132 } else if (*buflen >= len) { |
1133 memcpy(buffer, utf16Name.c_str(), len); | 1133 memcpy(buffer, utf16Name.c_str(), len); |
1134 *buflen = len; | 1134 *buflen = len; |
1135 } else { | 1135 } else { |
1136 *buflen = -1; | 1136 *buflen = -1; |
1137 } | 1137 } |
1138 return (FPDF_DEST)pDestObj; | 1138 return (FPDF_DEST)pDestObj; |
1139 } | 1139 } |
OLD | NEW |