Przeglądaj źródła

【数字签名】修复查看数字签名界面内存崩溃

wanjun 6 miesięcy temu
rodzic
commit
bd6a6dfa96

+ 8 - 7
PDF Office/PDF Master/Class/DigtalSignature/CPDFDigtalView/KMPDFDigitalSignViewController.swift

@@ -268,18 +268,17 @@ class KMPDFDigitalSignViewController: NSViewController, CPDFViewDelegate {
     }
 
     func popUpSignatureWidgetState(_ signature: CPDFSignature, _ pdfListView: CPDFDigtalView) ->(){
-        
         if self.stateVC == nil {
             self.stateVC = CDSignatureCertificateStateViewController.init()
         }
         self.stateVC.signature = signature
         self.stateVC.pdfListView = pdfListView
-        self.stateVC.actionBlock = { stateVCSelf, actionType in
+        self.stateVC.actionBlock = { [weak self, weak stateVC] stateVCSelf, actionType in
+            guard let self = self, let stateVC = stateVC else { return }
             if actionType == .cancel {
-                stateVCSelf.dismiss(stateVCSelf)
+                stateVC.dismiss(stateVCSelf)
             } else if actionType == .confirm {
-                let signer = signature.signers.first
-                if let data = signer?.certificates {
+                if let signer = signature.signers.first, let data = signer.certificates {
                     let signatureDetail = DSignatureDetailsViewController.init()
                     signatureDetail.certificates = data
                     signatureDetail.signature = signature
@@ -290,8 +289,10 @@ class KMPDFDigitalSignViewController: NSViewController, CPDFViewDelegate {
                 }
             }
         }
-        self.presentAsSheet(self.stateVC)
-        self.stateVC.reloadData()
+        if let stateVC = self.stateVC {
+            self.presentAsSheet(stateVC)
+            stateVC.reloadData()
+        }
     }
      
     func signElectronicSignature(_ signatureWidgetAnnotation: CPDFSignatureWidgetAnnotation) -> () {

+ 3 - 3
PDF Office/PDF Master/Class/DigtalSignature/CPDFDigtalView/KMPDFDigitalSignViewController.xib

@@ -6,7 +6,7 @@
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMPDFDigitalSignViewController" customModule="PDF_Master" customModuleProvider="target">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMPDFDigitalSignViewController" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
                 <outlet property="contendView" destination="SJ2-pS-M3B" id="jyP-Zt-Wsa"/>
                 <outlet property="contentTopConst" destination="TVB-8H-a7j" id="PyN-MC-YU8"/>
@@ -49,7 +49,7 @@
                                         <rect key="frame" x="0.0" y="0.0" width="74" height="26"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
-                                            <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="FD6-Gh-1xx" customClass="KMCustomButton">
+                                            <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="FD6-Gh-1xx" customClass="KMCustomButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                                 <rect key="frame" x="0.0" y="0.0" width="74" height="26"/>
                                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                 <buttonCell key="cell" type="bevel" title="Exit" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="aYO-5U-m8F">
@@ -73,7 +73,7 @@
                                         <rect key="frame" x="0.0" y="0.0" width="74" height="26"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
-                                            <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="pzG-r6-BJl" customClass="KMCustomButton">
+                                            <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="pzG-r6-BJl" customClass="KMCustomButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                                 <rect key="frame" x="0.0" y="0.0" width="74" height="26"/>
                                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                 <buttonCell key="cell" type="bevel" title="Save" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="udW-bE-j0F">

+ 11 - 15
PDF Office/PDF Master/Class/DigtalSignature/ViewControllers/DSignatureDetailsViewController.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -97,7 +97,7 @@
                                                 </textFieldCell>
                                                 <tableColumnResizingMask key="resizingMask" resizeWithTable="YES"/>
                                                 <prototypeCellViews>
-                                                    <tableCellView identifier="KMSignatureTableViewCell" id="2r9-BS-Z9R" customClass="KMSignatureTableViewCell">
+                                                    <tableCellView identifier="KMSignatureTableViewCell" id="2r9-BS-Z9R">
                                                         <rect key="frame" x="8" y="0.0" width="139" height="24"/>
                                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                         <subviews>
@@ -111,9 +111,6 @@
                                                                 </textFieldCell>
                                                             </textField>
                                                         </subviews>
-                                                        <connections>
-                                                            <outlet property="contentLabel" destination="5Jg-mN-i42" id="GV6-M4-dnX"/>
-                                                        </connections>
                                                     </tableCellView>
                                                 </prototypeCellViews>
                                             </tableColumn>
@@ -298,7 +295,7 @@
                                                                     </textFieldCell>
                                                                     <tableColumnResizingMask key="resizingMask" resizeWithTable="YES"/>
                                                                     <prototypeCellViews>
-                                                                        <tableCellView identifier="KMSignatureTableViewCell" id="eai-cK-784" customClass="KMSignatureTableViewCell">
+                                                                        <tableCellView identifier="KMSignatureTableViewCell" id="eai-cK-784">
                                                                             <rect key="frame" x="8" y="0.0" width="291" height="24"/>
                                                                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                                             <subviews>
@@ -312,9 +309,6 @@
                                                                                     </textFieldCell>
                                                                                 </textField>
                                                                             </subviews>
-                                                                            <connections>
-                                                                                <outlet property="contentLabel" destination="R0X-g0-OhG" id="dIp-Lt-NCb"/>
-                                                                            </connections>
                                                                         </tableCellView>
                                                                     </prototypeCellViews>
                                                                 </tableColumn>
@@ -345,6 +339,7 @@
                                                             <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                             <size key="minSize" width="295" height="55"/>
                                                             <size key="maxSize" width="346" height="10000000"/>
+                                                            <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                                         </textView>
                                                     </subviews>
                                                 </clipView>
@@ -424,7 +419,7 @@
                                                 <rect key="frame" x="10" y="232" width="431" height="150"/>
                                                 <clipView key="contentView" id="zXP-74-cX2">
                                                     <rect key="frame" x="1" y="1" width="429" height="148"/>
-                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                                    <autoresizingMask key="autoresizingMask"/>
                                                     <subviews>
                                                         <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowHeight="52" rowSizeStyle="automatic" headerView="xwy-Kv-uzW" viewBased="YES" id="Tmz-vp-NdW">
                                                             <rect key="frame" x="0.0" y="0.0" width="429" height="120"/>
@@ -446,7 +441,7 @@
                                                                     <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
                                                                     <prototypeCellViews>
                                                                         <tableCellView id="wvh-5U-TVZ">
-                                                                            <rect key="frame" x="8" y="0.0" width="118" height="52"/>
+                                                                            <rect key="frame" x="18" y="0.0" width="118" height="52"/>
                                                                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                                             <subviews>
                                                                                 <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="71s-2w-sMP">
@@ -478,7 +473,7 @@
                                                                     <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
                                                                     <prototypeCellViews>
                                                                         <tableCellView id="mgK-KW-A9B">
-                                                                            <rect key="frame" x="143" y="0.0" width="277" height="52"/>
+                                                                            <rect key="frame" x="153" y="0.0" width="277" height="52"/>
                                                                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                                             <subviews>
                                                                                 <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="WO5-Sh-Maq">
@@ -529,7 +524,7 @@
                                                 <rect key="frame" x="10" y="74" width="431" height="150"/>
                                                 <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="n4t-rk-guB">
                                                     <rect key="frame" x="0.0" y="0.0" width="416" height="150"/>
-                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                                    <autoresizingMask key="autoresizingMask"/>
                                                     <subviews>
                                                         <textView editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" spellingCorrection="YES" smartInsertDelete="YES" id="2Qa-9e-K4F">
                                                             <rect key="frame" x="0.0" y="0.0" width="416" height="150"/>
@@ -538,6 +533,7 @@
                                                             <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                             <size key="minSize" width="416" height="150"/>
                                                             <size key="maxSize" width="1294" height="10000000"/>
+                                                            <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                                         </textView>
                                                     </subviews>
                                                 </clipView>
@@ -782,6 +778,6 @@ DQ
     </objects>
     <resources>
         <image name="ImageNameSigntureTrustedIcon" width="20" height="20"/>
-        <image name="ImageNameSigntureVerifySuccess" width="29" height="29"/>
+        <image name="ImageNameSigntureVerifySuccess" width="32" height="32"/>
     </resources>
 </document>